From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7EF41914B1 for ; Tue, 27 Sep 2022 12:13:32 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6161E1D210 for ; Tue, 27 Sep 2022 12:13:32 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 27 Sep 2022 12:13:31 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E2AC4445D3 for ; Tue, 27 Sep 2022 12:13:30 +0200 (CEST) Message-ID: <315b33bc-d3cb-cdc8-ca6a-2cdb5678749d@proxmox.com> Date: Tue, 27 Sep 2022 12:13:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Content-Language: en-US To: Wolfgang Bumiller Cc: pve-devel@lists.proxmox.com References: <20220926094507.46263-1-l.nunner@proxmox.com> <20220927084632.c5lz3xgtzkou5asi@casey.proxmox.com> <20220927095944.wsyvolsajbrajnhh@casey.proxmox.com> From: Leo Nunner In-Reply-To: <20220927095944.wsyvolsajbrajnhh@casey.proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 1.039 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -2.319 Looks like a legit reply (A) 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 firewall] fix #4204: automatically update usages of group when it is renamed 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: , X-List-Received-Date: Tue, 27 Sep 2022 10:13:32 -0000 On 9/27/22 11:59, Wolfgang Bumiller wrote: > On Tue, Sep 27, 2022 at 11:28:26AM +0200, Leo Nunner wrote: >> On 9/27/22 10:46, Wolfgang Bumiller wrote: >>> On Mon, Sep 26, 2022 at 11:45:07AM +0200, Leo Nunner wrote: >>>> + $cluster_conf->{groups}->{$param->{group}} = $cluster_conf->{groups}->{$param->{rename}}; >>>> + $cluster_conf->{group_comments}->{$param->{group}} = $cluster_conf->{group_comments}->{$param->{rename}}; >>>> + >>>> + # Update comment if provided >>>> $cluster_conf->{group_comments}->{$param->{group}} = $param->{comment} if defined($param->{comment}); >>>> + >>> At this point you'd need to also store the cluster fw config, because >>> *reading* the configs isn't necessarily done with a lock on the cluster >>> config, and you don't want to race against readers seeing the new group >>> being referred to without actually having the it in the config. >>> >>> You'll still be racing against clients having read the cluster config >>> while you're *here* and then reading their host config *after* you've >>> updated it... >> Is there actually a way around this? Unless we use something like inotify, >> there'll be no way for them to actually know about the new group if they've >> read the cluster config before I updated it. > Well, not yet, and we'd need to distinguish between the race and the > group *actually* not existing. > Currently it'll produce a warning in the log which we might consider to > be "good enough". > We *could* try to remember which groups were missing in the previous run > and assume new missing groups are part of a race, but I'm not sure it's > worth it. Though syncing up would be simple enough as we only need to > lock/unlock the cluster fw config once. Would this still be in the scope of this patch or should we just leave it like this for now?