Re: [netmod] Adding a pre-existing leaf into a new 'choice' - NBC change?

Andy Bierman <andy@yumaworks.com> Thu, 22 November 2018 13:53 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 A01D2130EE0 for <netmod@ietfa.amsl.com>; Thu, 22 Nov 2018 05:53:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.358
X-Spam-Level:
X-Spam-Status: No, score=-3.358 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-1.459, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KgkxkInS3ZC8 for <netmod@ietfa.amsl.com>; Thu, 22 Nov 2018 05:53:07 -0800 (PST)
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C74F3130DCE for <netmod@ietf.org>; Thu, 22 Nov 2018 05:53:06 -0800 (PST)
Received: by mail-lj1-x22c.google.com with SMTP id v1-v6so8071969ljd.0 for <netmod@ietf.org>; Thu, 22 Nov 2018 05:53:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9lqEiF5Z9NaeiikHe5QubOXQJdTEjn30la+eW9OmUeg=; b=k8KTfeYBa9NvKc0qGTzYIzDe9l7kZBLhZCfZ/nB7l0DbaB6NhLzUVs21c4qQafHQB1 q8LeKC+4rwwxU9wxMN6/1VOG+DBlh5nrazwyS5qn6V8IkDgvcJb/dy+vFiXdRU7aGcWM C/hW4m8yLNmU3LgIPusvhKuucdW7DodeRS8FCF1gDXXaJxfxKqLZeoalIClxHuWN7MrF 3F3e53YyXDlKmH2TGzVAe1d3y6HS2J5+cxctuSpTvAmDZ00VnbLn8b/KXl5hAkc3ce6Y RgLkoUC/2VrxOONkAg/E41wzxFAvbfwYSrWEDgiPHoIl8GfzYIHlBcUl2pGZTZkB8x0f XGdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9lqEiF5Z9NaeiikHe5QubOXQJdTEjn30la+eW9OmUeg=; b=j6+67jMbhDk+AOeZ1e+J4mAv4108c8YFf2JSKAQF44MJL/5gSlbtymz2qn75vUyxzi xpxj0GVMjY18KvhkXMB61EISMuMwFfoMdn5rCVG5OjSXAqmSuvlz6R0wZxiGLGKBTXjZ 3B3sgOJNoOoPpsPpWjS3N2v7em34a837gCCTrg/ZivawAQHpSo4jmgORrajSOdwUcvsL mmFVc1boHvMc6h3iN05N7NK2oCTnySD0sF3E0dRB5519ZCV1FWtFdJ3qkiJ5IewEqTZo Qqe4mRf5tEzkGYAbkHeAxCz/pnyhEwhymfyjmvzDDTn752fBgTVyGMTUC2tMYBoL3q4a NPLg==
X-Gm-Message-State: AA+aEWbEjeOHAiKZQeCrdM6E7FuKZvv+Z8/j7qFNyBDX967ySD0GkvRX NRJR/eupWTdRxRtZqRLfM/CNyvIity6QfO6/IjhHjPZzm1ux8Q==
X-Google-Smtp-Source: AFSGD/WEGiqP3DeHFGuSZxY9qawXjIQGFNFNXUdiKduIrqL5Km0QKSrx/SOc7Rdog+r6p9mq59oJtmHzTZwLrRX9GE4=
X-Received: by 2002:a2e:9556:: with SMTP id t22-v6mr530659ljh.36.1542894784681; Thu, 22 Nov 2018 05:53:04 -0800 (PST)
MIME-Version: 1.0
References: <VI1PR07MB3981A171F18213B030D289A79BD80@VI1PR07MB3981.eurprd07.prod.outlook.com> <CABCOCHQM9Y_+ENB_sFGDQ6NufGm=mBRU-Ns4xiLXddMWXTUO6w@mail.gmail.com> <87wop5kzgb.fsf@nic.cz> <20181122.143948.1543843065251732639.mbj@tail-f.com>
In-Reply-To: <20181122.143948.1543843065251732639.mbj@tail-f.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 22 Nov 2018 05:52:53 -0800
Message-ID: <CABCOCHS18StYKGC4f7cPWFraKNHRsC9cWfrmfZ0j773awdicvQ@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: Ladislav Lhotka <lhotka@nic.cz>, "Sterne, Jason (Nokia - CA)" <jason.sterne@nokia.com>, NetMod WG <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000091317a057b412f9e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Y_zSdHesmbaPvAJ19kdimms1ZcA>
Subject: Re: [netmod] Adding a pre-existing leaf into a new 'choice' - NBC change?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: Thu, 22 Nov 2018 13:53:11 -0000

On Thu, Nov 22, 2018 at 5:39 AM Martin Bjorklund <mbj@tail-f.com> wrote:

> Hi,
>
> Ladislav Lhotka <lhotka@nic.cz> wrote:
> > Andy Bierman <andy@yumaworks.com> writes:
> >
> > > On Mon, Nov 19, 2018 at 12:32 PM Sterne, Jason (Nokia - CA/Ottawa) <
> > > jason.sterne@nokia.com> wrote:
> > >
> > >> Hi all,
> > >>
> > >>
> > >>
> > >> If we have a YANG model with a leaf:
> > >>
> > >>
> > >>
> > >> MODEL VERSION 1:
> > >>
> > >> container my-model {
> > >>
> > >>     leaf a { type string; }
> > >>
> > >> }
> > >>
> > >>
> > >>
> > >> And then later we produce another version of the model where that
> leaf is
> > >> placed into a choice construct:
> > >>
> > >>
> > >>
> > >> MODEL VERSION 2:
> > >>
> > >> container my-model {
> > >>
> > >>     choice some-choice {
> > >>
> > >>         case x {
> > >>
> > >>             leaf a { type string; }
> > >>
> > >>         }
> > >>
> > >>     }
> > >>
> > >> }
> > >>
> > >>
> > >>
> > >> Is that considered a non-backwards-compatible change?
> > >>
> > >
> > >
> > > yes -- even though the data node /my-model/x did not change,
> > > the schema node /my-model/a changed to /my-model/some-choice/x/a.
> > > Any leafref path pointing at this leaf will break.
> >
> > This is not correct. A leafref path is a special XPath, and as such
> > includes only data nodes, i.e. NOT choice and case nodes.
> >
> > What does change are schema node identifier. This could be significant
> > in an augment statement, but not ini this example because a leaf cannot
> > be augmented anyway.
> >
> > I don't see anything else that could break, so Jason's change seems
> > backward compatible to me.
>
> Since it does change the schema tree, this is not legal according to
> 7950.  So in that sense it is not backwards compatible.  The rules in
> 7950 protect both clients and other modules that import the module.
>
>
This text is confusing wrt/ schema tree vs data tree:


9.9 <https://tools.ietf.org/html/rfc7950#section-9.9>.  The leafref
Built-In Type

   The leafref built-in type is restricted to the value space of some
   leaf or leaf-list node in the schema tree and optionally further
   restricted by corresponding instance nodes in the data tree.  The
   "path" substatement (Section 9.9.2
<https://tools.ietf.org/html/rfc7950#section-9.9.2>) is used to
identify the referred
   leaf or leaf-list node in the schema tree.  The value space of the
   referring node is the value space of the referred node.





>
> /martin
>
>

Andy


>
>
> >
> > Lada
> >
> > >
> > >
> > > Andy
> > >
> > >
> > >>
> > >> Does the answer depend on whether the choice contains other cases (or
> > >> other cases that are the default case)?
> > >>
> > >>
> > >>
> > >
> > > no
> > >
> > >
> > >> MODEL VERSION 3:
> > >>
> > >> container my-model {
> > >>
> > >>     choice some-choice {
> > >>
> > >>         case x {
> > >>
> > >>             leaf a { type string; }
> > >>
> > >>         }
> > >>
> > >>         case y {
> > >>
> > >>             leaf b { type string; }
> > >>
> > >>         }
> > >>
> > >>     }
> > >>
> > >> }
> > >>
> > >>
> > >>
> > >> A client 'foo' using VERSION 1 would still be able to set & read back
> leaf
> > >> a in the same way as it always did.
> > >>
> > >>
> > >>
> > >> But if another client 'bar' (using VERSION 3) sets leaf 'b', then
> leaf 'a'
> > >> would disappear. That could be surprising to client 'foo' although
> perhaps
> > >> no more surprising than if another client simply deletes leaf 'a'
> (using
> > >> VERSION 1).
> > >>
> > >>
> > >>
> > >> Jason
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> _______________________________________________
> > >> netmod mailing list
> > >> netmod@ietf.org
> > >> https://www.ietf.org/mailman/listinfo/netmod
> > >>
> > > _______________________________________________
> > > netmod mailing list
> > > netmod@ietf.org
> > > https://www.ietf.org/mailman/listinfo/netmod
> >
> > --
> > Ladislav Lhotka
> > Head, CZ.NIC Labs
> > PGP Key ID: 0xB8F92B08A9F76C67
> >
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> >
>