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 8D5C51FF164
	for <inbox@lore.proxmox.com>; Fri, 25 Apr 2025 15:58:49 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id DC37C3488C;
	Fri, 25 Apr 2025 15:58:55 +0200 (CEST)
Message-ID: <2b9e6096-76c4-4135-a29a-a8431c7fac7f@proxmox.com>
Date: Fri, 25 Apr 2025 15:58:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Daniel Kral <d.kral@proxmox.com>,
 Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20250325151254.193177-1-d.kral@proxmox.com>
 <cab3e44f-1294-429d-8e06-b6743c3cb3a7@proxmox.com>
 <c93a04b3-b177-4bfc-8a8a-8e10fd635b15@proxmox.com>
 <d977b382-95ab-4f51-b1ce-8268630a5e24@proxmox.com>
 <500c452d-581d-4fb7-81d2-fe0f46d29fd6@proxmox.com>
Content-Language: en-US
From: Fiona Ebner <f.ebner@proxmox.com>
In-Reply-To: <500c452d-581d-4fb7-81d2-fe0f46d29fd6@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.036 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] [RFC cluster/ha-manager 00/16] HA colocation rules
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-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

Am 25.04.25 um 15:25 schrieb Daniel Kral:
> On 4/25/25 14:25, Fiona Ebner wrote:
>> Am 25.04.25 um 10:36 schrieb Daniel Kral:
>>> On 4/24/25 12:12, Fiona Ebner wrote:
>>> As suggested by @Lukas off-list, I'll also try to make the check
>>> selective, e.g. the user has made an infeasible change to the config
>>> manually by writing to the file and then wants to create another rule.
>>> Here it should ignore the infeasible rules (as they'll be dropped
>>> anyway) and only check if the added rule / changed rule is infeasible.
>>
>> How will you select the rule to drop? Applying the rules one-by-one to
>> find a first violation?
> 
> AFAICS we could use the same helpers to check whether the rules are
> feasible, and only check whether the added / updated ruleid is one that
> is causing these troubles. I guess this would be a reasonable option
> without duplicating code, but still check against the whole config.
> There's surely some optimization potential here, but then we would have
> a larger problem at reloading the rule configuration for the manager
> anyway. For the latter I could check for what size of a larger
> configuration this could become an actual bottleneck.
> 
> For either adding a rule or updating a rule, we would just make the
> change to the configuration in-memory and run the helper. Depending on
> the result, we'd store the config or error out to the API user.

ACK, I also don't think we need to worry too much about optimization
here yet.

>>> But as you said, it must not change the user's configuration in the end
>>> as that would be very confusing to the user.
>>
>> Okay, so dropping dynamically. I guess we could also disable such rules
>> explicitly/mark them as being in violation with other rules somehow:
>> Tri-state enabled/disabled/conflict status? Explicit field?
>>
>> Something like that would make such rules easily visible and have the
>> configuration better reflect the actual status.
>>
>> As discussed off-list now: we can try to re-enable conflicting rules
>> next time the rules are loaded.
> 
> Hm, there's three options now:
> 
> - Allowing conflicts over the create / update API and auto-resolving the
> conflicts as soon as we're able to (e.g. on the load / save where the
> rule becomes feasible again).
> 
> - Not allowing conflicts over the create / update API, but set the state
> to 'conflict' if manual changes (or other circumstances) made the rules
> be in conflict with one another.
> 
> - Having something like the SDN config, where there's a working
> configuration and a "draft" configuration that needs to be applied. So
> conflicts are allowed in drafts, but not in working configurations.
> 
> The SDN option seems too much for me here, but I just noticed some
> similarity.
> 
> I guess one of the first two makes more sense. If there's no arguments
> against this, I'd choose the second option as we can always allow
> intentional conflicts later if there's user demand or we see other
> reasons in that.

I do prefer the second option :)


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