From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <t.lamprecht@proxmox.com>
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) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 6278A68CD4
 for <pve-devel@lists.proxmox.com>; Fri,  4 Dec 2020 12:58:09 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 51C039B77
 for <pve-devel@lists.proxmox.com>; Fri,  4 Dec 2020 12:57:39 +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))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id C6BDE9B6D
 for <pve-devel@lists.proxmox.com>; Fri,  4 Dec 2020 12:57:38 +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 72D7E442F6
 for <pve-devel@lists.proxmox.com>; Fri,  4 Dec 2020 12:57:38 +0100 (CET)
To: Dominik Csapak <d.csapak@proxmox.com>,
 Proxmox VE development discussion <pve-devel@lists.proxmox.com>
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>
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
Message-ID: <2d2a829a-943b-53fe-cb2f-70dce16020d4@proxmox.com>
Date: Fri, 4 Dec 2020 12:57:37 +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: <4e1b5832-9271-6bab-31c6-d1705afb7409@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 <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>
X-List-Received-Date: Fri, 04 Dec 2020 11:58:09 -0000

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 <d.csapak@proxmox.com>
>>> ---
>>> =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/Metr=
icServer.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 d=
ie "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 i=
f 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..
>=20
> ok, so should we leave it as is for now?
>=20
>> 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, albe=
it not
>> to sure if about that exact behavior (as it was probably pre-existing)=
=2E
>>
>> It'd be good to at least decide for one behavior and try making that u=
niversal,
>> as else this is confusing..
>>
>=20
> yeah that makes sense (though i think the ordering is irrelevant, since=

> 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 behaves=
 like
a set (update).