From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 5B2611FF16F
	for <inbox@lore.proxmox.com>; Tue, 29 Apr 2025 10:04:50 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 8EB2C60FE;
	Tue, 29 Apr 2025 10:04:59 +0200 (CEST)
Message-ID: <57891198-e24e-4cdb-8cd3-e56c33d9b8df@proxmox.com>
Date: Tue, 29 Apr 2025 10:04:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Fiona Ebner <f.ebner@proxmox.com>,
 Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20250325151254.193177-1-d.kral@proxmox.com>
 <20250325151254.193177-9-d.kral@proxmox.com>
 <cd302144-9018-4fbc-b83a-226bc24bc25e@proxmox.com>
Content-Language: en-US
From: Daniel Kral <d.kral@proxmox.com>
In-Reply-To: <cd302144-9018-4fbc-b83a-226bc24bc25e@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.012 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
Subject: Re: [pve-devel] [PATCH ha-manager 07/15] manager: read and update
 rules config
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

On 4/25/25 16:30, Fiona Ebner wrote:
> Am 25.03.25 um 16:12 schrieb Daniel Kral:
>> +    my $new_rules = $haenv->read_rules_config();
>> +
>> +    # TODO We should also check for a service digest here, but we would've to
>> +    #      calculate it here independently or also expose it through read_service_config()
> 
> Ah, so read_and_check_resources_config() drops the digest and produces a
> hash with the only keys being the $sids. Easiest is probably to add
> wantarray in the relevant place(s) and return a list with the digest
> second. And I guess we don't need that anymore after we migrated from HA
> groups to location rules, since it's only used to get the groups? If
> yes, then we should add a reminder to remove it again.

Yes, the digest for services and HA groups shouldn't be needed anymore 
as soon as we migrate the groups to be location rules. I'll expose it 
through read_and_check_resources_config() as you suggested and add the 
TODOs for removing it later.

> 
>> +    if ($new_rules->{digest} ne $self->{last_rules_digest}
>> +	|| $self->{groups}->{digest} ne $self->{last_groups_digest}) {
>> +	$self->{rules} = $new_rules;
>> +	PVE::HA::Rules::checked_config($self->{rules}, $self->{groups}, $sc);
> 
> Might not matter now, but I'd prefer: check first, then assign.

ACK, will do that!

> 
>> +    }
>> +
>> +    $self->{last_rules_digest} = $self->{rules}->{digest};
>> +    $self->{last_groups_digest} = $self->{groups}->{digest};
>> +
>>       $self->update_crm_commands();
>>   
>>       for (;;) {
> 



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel