Re: [netmod] ?= ?==?utf-8?q? mandatory choice with non-presence container cas

Christian Hopps <chopps@chopps.org> Fri, 19 July 2019 11:27 UTC

Return-Path: <chopps@chopps.org>
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 0317D12017A for <netmod@ietfa.amsl.com>; Fri, 19 Jul 2019 04:27:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAD_ENC_HEADER=0.001, BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
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 wZUkGNj41Y7Q for <netmod@ietfa.amsl.com>; Fri, 19 Jul 2019 04:27:54 -0700 (PDT)
Received: from smtp.chopps.org (smtp.chopps.org [54.88.81.56]) by ietfa.amsl.com (Postfix) with ESMTP id 71D9212001E for <netmod@ietf.org>; Fri, 19 Jul 2019 04:27:54 -0700 (PDT)
Received: from stubbs.home (172-222-100-236.dhcp.chtrptr.net [172.222.100.236]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by smtp.chopps.org (Postfix) with ESMTPSA id B8DFD603A8; Fri, 19 Jul 2019 07:27:53 -0400 (EDT)
From: Christian Hopps <chopps@chopps.org>
Message-Id: <75D06E6E-CB49-4BD2-AC9B-F9A0DAADF62F@chopps.org>
Content-Type: multipart/signed; boundary="Apple-Mail=_ACB32D34-8876-42B0-8FE9-9791C7B930FB"; protocol="application/pgp-signature"; micalg=pgp-sha512
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Fri, 19 Jul 2019 07:27:52 -0400
In-Reply-To: <20190625.095812.959182004133340318.mbj@tail-f.com>
Cc: Christian Hopps <chopps@chopps.org>, Ladislav Lhotka <lhotka@nic.cz>, kent@watsen.net, netmod@ietf.org
To: Martin Bjorklund <mbj@tail-f.com>
References: <ad3-5d110500-55-63a2bc80@40796557> <0100016b8c38574d-9d8aad57-3e50-45c4-98bb-24091a765ded-000000@email.amazonses.com> <87tvceunai.fsf@nic.cz> <20190625.095812.959182004133340318.mbj@tail-f.com>
X-Mailer: Apple Mail (2.3445.104.11)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/QPkWO6WZyEv5sVmePieey_k-6VI>
Subject: Re: [netmod] ?= ?==?utf-8?q? mandatory choice with non-presence container cas
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: Fri, 19 Jul 2019 11:27:56 -0000


> On Jun 25, 2019, at 3:58 AM, Martin Bjorklund <mbj@tail-f.com> wrote:
> 
> Ladislav Lhotka <lhotka@nic.cz> wrote:
>> Kent Watsen <kent@watsen.net> writes:
>> 
>>> Hi Michal,
>>>> I agree, but these valid data were correctly printed into invalid
>>>> data. I do not think printing is allowed to change the validity of
>>>> data.
>>> The NP-container text is unclear.
>> 
>> This issue IMO has more to do with the "mandatory" statement under
>> "choice". Similar problems can be caused by data nodes that depend on
>> "when". For example:
>> 
>> choice sel {
>>   madatory true;
>>   leaf foo {
>>       when "...";
>>       ...
>>   }
>>   leaf bar { ... }
>>   leaf baz { ... }
>> 
>> If "foo" exists in instance data but its when condition becomes false,
>> the server is expected to remove the "foo" instance, but what next?
>> The data becomes invalid, but the server can hardly include "bar" or
>> "baz" on its own.
> 
> Right, so that change (that would make the when condition false) will
> be rejected by the server, since the resulting config would be
> invalid.

This is subtle, I wonder if it is called out somewhere for YANG module implementers? Basically what the above means (assuming a module sw design) is that prior to *any change anywhere in the system* the server software (probably) needs to re-run validation on the entire resulting config to make sure that the config will still be valid, prior to making the change.

The sort of obvious place this would happen is having baseline software that does not know about (has no code written for) some new feature that is added later by the vendor/user. This new sw has some when's in it that refer back to the baseline sw.

Thanks,
Chris.

> 
> 
> /martin
> 
> 
> 
> 
>> 
>> Lada
>> 
>>> I'm unsure if you saw the thread in NETCONF, but I filed this issue
>>> over the weekend.  Please add to it, if only to include a link to this
>>> thread: https://github.com/netmod-wg/yang-next/issues/88. Thanks, Kent
>>> _______________________________________________ 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
>> 
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod