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 93C5368CD4 for ; Fri, 4 Dec 2020 13:46:00 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 80EE79FD9 for ; Fri, 4 Dec 2020 13:45:30 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 59CE59FCC for ; Fri, 4 Dec 2020 13:45:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 26AEF44C83 for ; Fri, 4 Dec 2020 13:45:29 +0100 (CET) From: Thomas Lamprecht To: Dominik Csapak , Proxmox VE development discussion Reply-To: Proxmox VE development discussion References: <20201202092113.15911-1-d.csapak@proxmox.com> <20201202092113.15911-4-d.csapak@proxmox.com> <3434720d-ee6f-9d7d-a365-2a497e27c70f@proxmox.com> <4e1b5832-9271-6bab-31c6-d1705afb7409@proxmox.com> <2d2a829a-943b-53fe-cb2f-70dce16020d4@proxmox.com> Message-ID: <78ce411b-e5ae-1bdc-3697-d750b3960d58@proxmox.com> Date: Fri, 4 Dec 2020 13:45:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: <2d2a829a-943b-53fe-cb2f-70dce16020d4@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.073 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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. [metricserver.pm] Subject: Re: [pve-devel] [PATCH manager 1/7] api: cluster/metricserver: prevent simultaneosly setting and deleting of property 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: Fri, 04 Dec 2020 12:46:00 -0000 On 04.12.20 12:57, Thomas Lamprecht wrote: > On 04.12.20 12:30, Dominik Csapak wrote: >> On 12/3/20 10:05 AM, Thomas Lamprecht wrote: >>> On 02.12.20 10:21, Dominik Csapak wrote: >>>> like we do in other apis of section configs (e.g. storage) >>>> >>>> Signed-off-by: Dominik Csapak >>>> --- >>>> =C2=A0 PVE/API2/Cluster/MetricServer.pm | 2 ++ >>>> =C2=A0 1 file changed, 2 insertions(+) >>>> >>>> diff --git a/PVE/API2/Cluster/MetricServer.pm b/PVE/API2/Cluster/Met= ricServer.pm >>>> index 9a14985e..ec3c7b75 100644 >>>> --- a/PVE/API2/Cluster/MetricServer.pm >>>> +++ b/PVE/API2/Cluster/MetricServer.pm >>>> @@ -213,6 +213,8 @@ __PACKAGE__->register_method ({ >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 my $d =3D $options->{$k} || die "no such option '$k'\n"; >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 die "unable to delete required option '$k'\n" if !$d->{optional= }; >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 die "unable to delete fixed option '$k'\n" if $d->{fixed}; >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = die "cannot set and delete property '$k' at the same time!\n" >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = if defined($opts->{$k}); >>>> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 delete $data->{$k}; >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>> >>> >>> That counts as API change, strictly speaking.. >> >> ok, so should we leave it as is for now? >> >>> For container and VMs we order >>> deletions before setting the value, and the one from container is the= last >>> one which got some actual thoughts and discussion going on, IIRC, alb= eit not >>> to sure if about that exact behavior (as it was probably pre-existing= ). >>> >>> It'd be good to at least decide for one behavior and try making that = universal, >>> as else this is confusing.. >>> >> >> yeah that makes sense (though i think the ordering is irrelevant, sinc= e >> even in container you cannot set and delete at the same time) >> >=20 > I mean yes but no. It's ordered delete first, so it actually just behav= es like > a set (update). >=20 I only looked at the internal update method and missed the check which er= rors=20 also for CTs in the API, so ignore this.