Re: [netmod] Module updates in imported modules

Andy Bierman <andy@yumaworks.com> Tue, 13 June 2023 17:21 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BF2D2C14CE52 for <netmod@ietfa.amsl.com>; Tue, 13 Jun 2023 10:21:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.096
X-Spam-Level:
X-Spam-Status: No, score=-7.096 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W6aAFPwjR4n1 for <netmod@ietfa.amsl.com>; Tue, 13 Jun 2023 10:21:25 -0700 (PDT)
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 940D5C14CE2E for <netmod@ietf.org>; Tue, 13 Jun 2023 10:21:25 -0700 (PDT)
Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f64fb05a8aso7289676e87.0 for <netmod@ietf.org>; Tue, 13 Jun 2023 10:21:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks.com; s=google; t=1686676883; x=1689268883; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=r/wdtM/ddT9J437gqcHKUird2S3fgNBcDhZHbp5uD34=; b=sWFWs7MCUY5Qx4bsVfXEvmuHJ4Id3ukubo5L7Hj6GRaXKGycsJbYIBP7O3B/z3JdV9 LyWYbU/G6rCSv19kQfosMrMXR8Y24n+I0XGGdMqiheNkOEjaa960yzlwB4hwaL9B9YtP hTtBq5xM54tdD3gtQBwOfeH9mXI/TxDY8qTsU3aec9PhbHmBZOqdKRhDZ3F2prB9hrdo WxBDlXpgdBHOdPMXz2hbOMC/5r+PwPII0Kvli2PUwRiBeUD+xSRiNnR2H3afClk9c0US QDSeMvywub7ypE+Dhnmr9hjpWifRj7vj9dVR/91l9XfWpKM98/KpJzVhTYmvppxzQLND onPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686676883; x=1689268883; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r/wdtM/ddT9J437gqcHKUird2S3fgNBcDhZHbp5uD34=; b=OCYT7A7Swi1j2rUSCkpmfEG0yX+QueBxixNgY/ITtiJ/6VKEIjuu9M6qWfEYGAysY2 iapymL2HNIW1aHDKo9dlIH8ALDDuhrfAOPnMpVRAG84FVyEFrDE+QNsjbGrodG4olbLk VEL8hYQDCDdtbEITyT3bI66i3otAbWJYH7IEH4gkln2ryS47+n1P6eD36cRrX3r4uLWR OUHWMhUcMhlbZZyOqIBlf1cSdGht2uPcy9NyXfDLRcMaCGpRxOa9evYVx7/w7S0TYhK+ Ob5qT8xvBu1pDhfgRHoaZLAyQ3FJb23l22MSH02rUZvOjM8Yl+VoRjYCXGGogpwORknu YvqQ==
X-Gm-Message-State: AC+VfDzIn40C0RBaZKQDBTTOsB1CbAVnGaUJmJ+TUUuXUdTp3qt9taqX DxZYJ0oeYYlgPHHK20TFhqvATBlUQt18fGCxAQKpVyiKw7Ak29hItw06NA==
X-Google-Smtp-Source: ACHHUZ6WxJQXTHqb0MtoQy61KRrlIisdZiB4UDmH+tigSkR3m5Rbh4ZEGuL1/PfOcZyoILw4k9zwDdzhUEvqU85Ts48=
X-Received: by 2002:a2e:8ed8:0:b0:2b2:f9c8:6ad1 with SMTP id e24-20020a2e8ed8000000b002b2f9c86ad1mr5517930ljl.42.1686676882604; Tue, 13 Jun 2023 10:21:22 -0700 (PDT)
MIME-Version: 1.0
References: <CABCOCHRV5DdJoR6GqjQFAdNLPW2xjekS-H2On2vSSPDRjD_TBQ@mail.gmail.com> <A926AF71-7F62-4C61-AEA7-3F6D9CD74A81@tail-f.com> <CABCOCHRY-UEZcHyZV1gUjtQinf2uYtTAHe1=R6mcUjwh-d_wuw@mail.gmail.com> <DM6PR08MB5084DD25A245F36171A2CCBB9B55A@DM6PR08MB5084.namprd08.prod.outlook.com>
In-Reply-To: <DM6PR08MB5084DD25A245F36171A2CCBB9B55A@DM6PR08MB5084.namprd08.prod.outlook.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Tue, 13 Jun 2023 10:21:11 -0700
Message-ID: <CABCOCHRY=1ika-j2bi22sWBqkhDnpbMde=h0pQUzX_qt19Cqkg@mail.gmail.com>
To: "Jason Sterne (Nokia)" <jason.sterne@nokia.com>
Cc: Jan Lindblad <janl@tail-f.com>, NetMod WG <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000705f8105fe0610f4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/HtMUZ9ZIbEI2NPpHlTIqrc76riM>
Subject: Re: [netmod] Module updates in imported modules
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Jun 2023 17:21:29 -0000

On Tue, Jun 13, 2023 at 8:48 AM Jason Sterne (Nokia) <jason.sterne@nokia.com>
wrote:

> Hi Andy,
>
>
>
> From my read of 7950, adding a mandatory leaf to a grouping isn’t allowed.
> Section 11 lists every case of allowable changes. Can you point out what
> statement(s) you feel allow it?
>





   The "grouping" statement is not a data definition statement and, as
   such, does not define any nodes in the schema tree.



IMO the constraints in sec 11. apply to the schema tree (i.e., uses
expansion) but the text is not clear about that.
E.g., many constraints are ignored within an sx:structure. The context of
the uses-stmt matters.

The same grouping can be used for the first time in 1 module and not be an
update,
so the mandatory node rule does not apply.

So incrementing the grouping module major-version if any possible uses
expansion leads to NBC changes is required.



>
> If there is some ambiguity about that in RFC7950 personally I think any
> clarification would be to make it not-allowed (aka NBC). The module A that
> defines a grouping (or a typedef, or the name of a choice, etc, etc)
> doesn’t know how other modules will import module A, or augment module A.
>
>
>
> So a client/app (or developer of that client/app) that uses modules A, B
> and C in your original example would “trigger” on the fact that module A
> had an NBC change. The developers would then examine the changes to A and
> determine how those impact them (by seeing where that grouping is used,
> whether the client uses those nodes, etc).
>

Perhaps an example showing an NBC change to an imported module should be
added.


>
> Jason
>

Andy


>
>
> *From:* netmod <netmod-bounces@ietf.org> *On Behalf Of *Andy Bierman
> *Sent:* Friday, June 9, 2023 2:30 PM
> *To:* Jan Lindblad <janl@tail-f.com>
> *Cc:* NetMod WG <netmod@ietf.org>
> *Subject:* Re: [netmod] Module updates in imported modules
>
>
>
>
>
> *CAUTION:* This is an external email. Please be very careful when
> clicking links or opening attachments. See the URL nok.it/ext for
> additional information.
>
>
>
>
>
>
>
> On Fri, Jun 9, 2023 at 1:23 AM Jan Lindblad <janl@tail-f.com> wrote:
>
> Andy,
>
>
>
> I think you have a lot of good points in this discussion, but here is one
> I don't quite understand.
>
>
>
> You state that the addition of leaf three in the 1.1.0 version of grouping
> A would be BC. 7950 sec 11 lists things you are allowed to do and still
> call your module BC. By which rule in section 11 would you argue that the
> 1.1.0 change is BC? To me, this addition of a mandatory leaf in an existing
> grouping, appear not to be covered in any of the BC cases. It also breaks
> the architectural idea expressed in the first paragraph of sec 11:
>
>
>
>    [...] changes to published modules are not allowed
>
>    if they have any potential to cause interoperability problems between
>
>    a client using an original specification and a server using an
>
>    updated specification.
>
>
>
>
>
> I think this text applies to schema nodes (i.e., uses expansion, not
> groupings).
>
> Adding a mandatory leaf to a grouping is allowed.
>
>
>
> The NBC change occurs here because it is an augment using a mandatory
> NP-container.
>
> The same "uses" in a P-container or a list is not an NBC change.
>
>
>
> My point is that none of the protections in these drafts work because the
> module
>
> with the "uses" is not the module being changed.  Even when A(2.0.0) is
> used by a server,
>
> none of the protections work because module C never gets updated, just A.
>
>
>
>
>
> Also, if your comment about SIDs not being updated as imported modules
> change is true, that is indeed a major problem for the SID generation.
>
>
>
>
>
> The SID file for module C is created and uses A(1.1.0).
>
> Over time new revisions of A are published.
>
> A server can choose any revision of A in its implementation.
>
> A client hardwired to expect A(1.1.0) could still work with A(1.2.0).
>
> The node 'three' would be encoded as text and not a SID.
>
> A client hardwired to expect A(1.1.0) may not still work with A(2.0.0).
>
> The node 'two' would be encoded as a number and not a string anymore.
>
> However, this exact situation can occur if the server uses a deviation to
> replace the type for leaf 'two'.
>
>
>
> Every time a new revision of any imported module gets updated, a new SID
> file may be needed.
>
> E.g: 3 revisions of C.sid:
>
>
>
>  - module C using A(1.1.0)  == [default sid-file-version=0]
>
>  - module C using A(1.2.0)  == sid-file-version=1
>
>  - module C using A(2.0.0)  == sid-file-version=2
>
>
>
> It is valid for a server to use any 1 of the 3 revisions of module A.
>
> Of course, this is a "hello world" example. A "real world" example will be
> much more complicated.
>
> Allowing NBC changes to YANG makes the problem more complicated as well.
>
>
>
>
>
> Best Regards,
>
> /jan
>
>
>
>
>
>
>
> Andy
>
>
>
>
>
>
>
> On 8 Jun 2023, at 21:18, Andy Bierman <andy@yumaworks.com> wrote:
>
>
>
> Hi,
>
>
>
> It is not clear how the new drafts work for changes in imported groupings.
>
> This is a very common design pattern.
>
>
>
>  module A {
>
>    // version 1.0.0
>
>     grouping A {
>
>        leaf one { type string; }
>
>        leaf two { type string; }
>
>    }
>
> }
>
>
>
>  module A {
>
>    // version 1.1.0
>
>     grouping A {
>
>        leaf one { type string; }
>
>        leaf two { type string; }
>
>        leaf three { type string; mandatory true; }
>
>    }
>
> }
>
>
>
> module B {
>
>    container top;
>
> }
>
>
>
> module C {
>
>    import A { prefix A; }
>
>    import B { prefix B; }
>
>
>
>   augment "/B:top" {
>
>     container C {
>
>        uses A:A;
>
>     }
>
>  }
>
> }
>
>
>
> In this example, the server starts out with module A(1.0.0).
>
> Modules B and C are some versions (doesn't matter).
>
>
>
> In a new server release, ONLY module A has been updated to 1.1.0.
>
> This is a BC change to the grouping so no major version update.
>
> Modules B and C are byte-exact and not changed at all.
>
>
>
> However now there is an NBC change caused by module C
>
> from a BC change in module A. (augment a mandatory node)
>
>
>
>
>  module A {
>
>    // version 2.0.0
>
>     grouping A {
>
>        leaf one { type string; }
>
>        leaf two { type uint32; }
>
>        leaf three { type string; mandatory true; }
>
>    }
>
> }
>
>
>
> Even if there is an NBC change to a grouping module, it is only apparent
> from
>
> compiling a specific YANG library, not from the individual modules.
>
> There is only an NBC change if the server chooses A(2.0.0).
>
>
>
> (out of scope here)
>
> Since module C never changed, the SID file for module C may not be changed,
>
> especially if module A is a standard module. If A(1.1.0) or (2.0.0) is
> used by the server then
>
> the SID for /top/C/three is missing.
>
>
>
> The module update draft should mention NBC issues from groupings.
>
>
>
>
>
> Andy
>
>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>
>
>
>