From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.gruenbichler@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))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 0B2AADB30
 for <pbs-devel@lists.proxmox.com>; Tue, 19 Apr 2022 13:29:18 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id ED9E2275B7
 for <pbs-devel@lists.proxmox.com>; Tue, 19 Apr 2022 13:28:47 +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 id 7547D275AE
 for <pbs-devel@lists.proxmox.com>; Tue, 19 Apr 2022 13:28:47 +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 D07E2421DF
 for <pbs-devel@lists.proxmox.com>; Tue, 19 Apr 2022 13:19:33 +0200 (CEST)
Date: Tue, 19 Apr 2022 13:19:27 +0200
From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion <pbs-devel@lists.proxmox.com>
References: <20220415072817.14768-1-h.laimer@proxmox.com>
 <20220415072817.14768-3-h.laimer@proxmox.com>
In-Reply-To: <20220415072817.14768-3-h.laimer@proxmox.com>
MIME-Version: 1.0
User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid)
Message-Id: <1650366281.ioxite7lfe.astroid@nora.none>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-LEVEL: Spam detection results:  0
 AWL -1.426 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 ENA_SUBJ_ODD_CASE         3.2 Subject has odd case
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: Re: [pbs-devel] [PATCH proxmox-backup 2/4] api2: DataStoreListItem
 add maintenance info
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 19 Apr 2022 11:29:18 -0000

On April 15, 2022 9:28 am, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
>  pbs-api-types/src/datastore.rs | 5 +++++
>  src/api2/admin/datastore.rs    | 1 +
>  2 files changed, 6 insertions(+)
>=20
> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore=
.rs
> index 01e2319a..0fc5622e 100644
> --- a/pbs-api-types/src/datastore.rs
> +++ b/pbs-api-types/src/datastore.rs
> @@ -330,6 +330,9 @@ impl DataStoreConfig {
>              optional: true,
>              schema: SINGLE_LINE_COMMENT_SCHEMA,
>          },
> +        maintenance: {
> +            type: bool,
> +        }

this breaks remote scanning (of old remotes on new systems) - in this=20
case annotating it with a (serde) default of false seems sensible (if=20
the field is missing, it can only be because the other side doesn't have=20
maintenance mode yet, so it can be treated as 'no maintenance mode'). in=20
other cases wrapping a newly introduced field in an Option<> might make=20
more sense.

in general when changing API things (including return value schema)=20
backwards-compatibility should be kept in mind, even though we don't=20
have clusters in PBS we do have:
- sync/pull/remote between different versions of PBS
- pbs-client accessing pbs-server with version mismatch
- qemu-lib accessing pbs-server with version mismatch
- third-party clients accessing pbs-server

none of that should break with regular upgrades unless there is a very=20
good reason.