From nobody Thu May 2 02:16:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1603469713; cv=none; d=zohomail.com; s=zohoarc; b=ZZ9OlxcXA59j64kFxnPbRSbMOjkX8j3/Gg9+GRYDgCamzUakPX4ky5+Orge+37/ZKcvhk1RFQtJqaRECQ7NMOTPOoyP39CTKR2924HyKuswIX6Cdv/w/QhnErwwEI9//1oSX5u51+e/o3YpIDcFkAk5HfJ4nskL/K3kylslu8k0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603469713; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=bypnxhjVJ8hrVMcfMf2eie599ceBF4c9S0o8XImtOP8=; b=bokCK81d4wbPkYvoc83L4mj6Khr7my+tJy4L3uDbrYup36xhdrYphQKjhSx3Gn/+wGHPYp2Zth5OmNPrLVFOFzIRQKL9Lm5P7905HkBy3VCfjy6zhcM8EmkWKrSzc3iLmTSPgl0jx5r9E1/sHvF9eXT/ApQnZ/fjy7ov9X1mzAE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1603469713948455.5035896561408; Fri, 23 Oct 2020 09:15:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.11148.29545 (Exim 4.92) (envelope-from ) id 1kVziR-0006ti-4z; Fri, 23 Oct 2020 16:14:55 +0000 Received: by outflank-mailman (output) from mailman id 11148.29545; Fri, 23 Oct 2020 16:14:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kVziR-0006tb-1n; Fri, 23 Oct 2020 16:14:55 +0000 Received: by outflank-mailman (input) for mailman id 11148; Fri, 23 Oct 2020 16:14:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kVziP-0006tE-Nb for xen-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:14:53 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2d8e22ab-e6c9-40b2-8a2d-ca541c165d7c; Fri, 23 Oct 2020 16:14:52 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kVziO-00086m-GP for xen-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:14:52 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kVziO-0002NH-FT for xen-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:14:52 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kVziM-0008Eb-Mc; Fri, 23 Oct 2020 17:14:50 +0100 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kVziP-0006tE-Nb for xen-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:14:53 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2d8e22ab-e6c9-40b2-8a2d-ca541c165d7c; Fri, 23 Oct 2020 16:14:52 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kVziO-00086m-GP for xen-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:14:52 +0000 Received: from iwj (helo=mynotebook.example.org) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1kVziO-0002NH-FT for xen-devel@lists.xenproject.org; Fri, 23 Oct 2020 16:14:52 +0000 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by mariner.uk.xensource.com with esmtp (Exim 4.89) (envelope-from ) id 1kVziM-0008Eb-Mc; Fri, 23 Oct 2020 17:14:50 +0100 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2d8e22ab-e6c9-40b2-8a2d-ca541c165d7c DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From; bh=bypnxhjVJ8hrVMcfMf2eie599ceBF4c9S0o8XImtOP8=; b=CNMrdGwN7QU51wM8mbKr5MB+Dt BmON7cpvCNnRPx7mC1vI8NYOp0Th1sQomSET6+WarLDKdmzGjku4OFAhxngYTxje4pXPvNJc2KOSy +4kNySUcyd1hyjTlS9v+RrR/UMy/v43mf2wPi2BQ6LO/JE/JDJLuFOIk5gn9xt11bvNI=; From: Ian Jackson To: xen-devel@lists.xenproject.org Cc: Ian Jackson Subject: [OSSTEST PATCH] host reuse fixes: Properly clear out old static tasks from history Date: Fri, 23 Oct 2020 17:14:44 +0100 Message-Id: <20201023161444.2133-1-iwj@xenproject.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xenproject.org) Content-Type: text/plain; charset="utf-8" The algorithm for clearing out old lifecycle entries was wrong: it would delete all entries for non-live tasks. In practice this would properly remove all the old entries for non-static tasks, since ownd tasks typically don't releease things until the task ends (and it becomes non-live). And it wouldn't remove more than it should do unless some now-not-live task had an allocation overlapping with us, which is not supposed to be possible if we are doing a host wipe. But it would not remove static tasks ever, since they are always live. Change to a completely different algorithm: * Check that only us (ie, $ttaskid) has (any shares of) this host allocated. There's a function resource_check_allocated_core which already does this and since we're conceptually part of Executive it is proper for us to call it. This is just a sanity check. * Delete all lifecycle entries predating the first entry made by us. (We could just delete all entries other than ours, but in theory maybe some future code could result in a siutation where someone else could have had another share briefly at some point.) This removes old junk from the "Tasks that could have affected" in reports. Signed-off-by: Ian Jackson --- Osstest/JobDB/Executive.pm | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm index 1dcf55ff..097c8d75 100644 --- a/Osstest/JobDB/Executive.pm +++ b/Osstest/JobDB/Executive.pm @@ -515,15 +515,19 @@ sub jobdb_host_update_lifecycle_info ($$$) { #method =20 if ($mode eq 'wiped') { db_retry($flight, [qw(running)], $dbh_tests,[], sub { - $dbh_tests->do(<{Others}; + $dbh_tests->do(<