From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 770F31FF184 for ; Thu, 20 Nov 2025 18:54:06 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1BB23FC00; Thu, 20 Nov 2025 18:54:11 +0100 (CET) Message-ID: <1bf34a63-00ed-4a09-9c10-dfc166b9c256@proxmox.com> Date: Thu, 20 Nov 2025 18:53:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox VE development discussion , Daniel Kral References: <20251103151823.387984-1-d.kral@proxmox.com> <20251103151823.387984-3-d.kral@proxmox.com> Content-Language: en-US From: Thomas Lamprecht In-Reply-To: <20251103151823.387984-3-d.kral@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1763661185803 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.022 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [resourceaffinity.pm] Subject: Re: [pve-devel] [PATCH ha-manager 2/2] fix #6801: only consider target node during positive resource affinity migration X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 03.11.25 um 16:18 schrieb Daniel Kral: > When a HA resource with positive affinity to other HA resources is moved > to another node, the other HA resources in positive affinity are > automatically moved to the same target node as well. > > If the HA resources have significant differences in migration time > (more than the average HA Manager round of ~10 seconds) the already > migrated HA resources in 'started' state will check for better node > placements while the other(s) are still migrating. > This search includes whether the positive resource affinity rules are > held and will query where the other HA resources are. When HA resources > are still migrating this will report that these are both on the source > and target node, which is correct from a accounting standpoint, but will > add equal weights on both nodes and might result in the already started > HA resource to be migrated to the source node. So, just to confirm, this does not change the accounting part at all, or? Patch looks OK to me in general though, but would like to recheck with a slightly fresher mind tomorrow, maybe we could have a quick chat too for clearing this up. > > Therefore, only consider the target node for positive affinity during > migration or relocation to prevent this from happening. > > As a side-effect, two test cases for positive resource affinity rules > will result in a slightly quicker convergence to a steady state as these > now will get the information about the common target node sooner. > > Signed-off-by: Daniel Kral > --- > src/PVE/HA/Rules/ResourceAffinity.pm | 6 ++-- > .../log.expect | 25 +++-------------- > .../log.expect | 28 +++++++++---------- > .../README | 3 -- > .../log.expect | 28 +++---------------- > 5 files changed, 26 insertions(+), 64 deletions(-) > > diff --git a/src/PVE/HA/Rules/ResourceAffinity.pm b/src/PVE/HA/Rules/ResourceAffinity.pm > index 4f5ffca5..9303bafd 100644 > --- a/src/PVE/HA/Rules/ResourceAffinity.pm > +++ b/src/PVE/HA/Rules/ResourceAffinity.pm > @@ -517,8 +517,10 @@ sub get_resource_affinity { > for my $csid (keys $positive->%*) { > my ($current_node, $target_node) = $get_used_service_nodes->($csid); > > - $together->{$current_node}++ if defined($current_node); > - $together->{$target_node}++ if defined($target_node); > + # consider only the target node for positive affinity to prevent already > + # moved HA resources to move back to the source node (see #6801) > + my $node = $target_node // $current_node; > + $together->{$node}++ if defined($node); > } > > for my $csid (keys $negative->%*) { _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel