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 2F92E1FF191 for ; Tue, 23 Sep 2025 10:06:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8CC977430; Tue, 23 Sep 2025 10:06:48 +0200 (CEST) Mime-Version: 1.0 Date: Tue, 23 Sep 2025 10:06:14 +0200 Message-Id: Cc: "pve-devel" From: =?utf-8?q?Michael_K=C3=B6ppl?= To: "Proxmox VE development discussion" X-Mailer: aerc 0.20.1 References: <20250917115316.131793-1-m.koeppl@proxmox.com> <20250917115316.131793-2-m.koeppl@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758614761948 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.033 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 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. [config.pm, proxmox.com] Subject: Re: [pve-devel] [PATCH ha-manager 1/2] fix #6613: update rules containing the resource to be deleted 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" On Tue Sep 23, 2025 at 9:53 AM CEST, Daniel Kral wrote: >> src/PVE/HA/Config.pm | 15 ++++++++++++++- >> 1 file changed, 14 insertions(+), 1 deletion(-) >> >> diff --git a/src/PVE/HA/Config.pm b/src/PVE/HA/Config.pm >> index 301c62f..9a7ed0e 100644 >> --- a/src/PVE/HA/Config.pm >> +++ b/src/PVE/HA/Config.pm >> @@ -419,17 +419,30 @@ sub get_resource_motion_info { >> >> # graceful, as long as locking + cfs_write works >> sub delete_service_from_config { >> - my ($sid) = @_; >> + my ($sid, $purge) = @_; >> >> return 1 if !service_is_configured($sid); >> >> my $res; >> PVE::HA::Config::lock_ha_domain( >> sub { >> + >> my $conf = read_resources_config(); >> $res = delete $conf->{ids}->{$sid}; >> write_resources_config($conf); >> >> + my $rules = read_rules_config(); > > The {read,write}_rules_config(...) should be included in the > if ($purge) {} block here > Thanks for the taking the time to have a look at this! Missed that one, will fix in a v2, thanks! >> + >> + if ($purge) { >> + for my $ruleid (keys $rules->{ids}->%*) { >> + my $rule_resources = $rules->{ids}->{$ruleid}->{resources} // {}; >> + >> + delete $rule_resources->{$sid}; >> + delete $rules->{ids}->{$ruleid} if !%$rule_resources; >> + } >> + } >> + >> + write_rules_config($rules); >> }, >> "delete resource failed", >> ); > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel