Re: [netmod] VRFY :Y09: introduce optional keys
Andy Bierman <andy@yumaworks.com> Fri, 09 January 2015 10:52 UTC
Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E78D41A874D for <netmod@ietfa.amsl.com>; Fri, 9 Jan 2015 02:52:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.979
X-Spam-Level:
X-Spam-Status: No, score=-1.979 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
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 beLRcRKA9KlI for <netmod@ietfa.amsl.com>; Fri, 9 Jan 2015 02:52:18 -0800 (PST)
Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E393F1A8747 for <netmod@ietf.org>; Fri, 9 Jan 2015 02:52:17 -0800 (PST)
Received: by mail-la0-f54.google.com with SMTP id pv20so13799871lab.13 for <netmod@ietf.org>; Fri, 09 Jan 2015 02:52:16 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CSe1dds4QCLFn8WLTk+vHXvQvNxEQJ/SsoUs1O6+eGk=; b=YhgnmJO2YnxPyRoqsmh73xi8XNlo9N9m9K400MNFqvMZnHOCo4Sm7aqdrfvhGQoDHZ qTXlwzrNomG5fkyVqQBtPWDiR2MzuK5p2cSwbalQZx4aEt/Y83Zvu3PzllpEOrZA8MJc RaHnLMK0hoaqlPulsThbM7NXRL1QQlno9Cj6GQw7Q1lf/ZycTMmcwz1LpIazHLdWrIZs PP3ZlvqTYcAfGDl7gwPGb2GZxjtUoK0E0BcRcN3/a3rMPS9Pn7y4cu7ERCwGZCK5H5zy w1+wkOMhlZluAe4ahCYRPGvyD2y4LQjTsyY2cqyXnIlAS5l7jW2chLUL93SzUhoxHUFt hNmA==
X-Gm-Message-State: ALoCoQleeEAi+MROT2FORMDozNw3Gpg/enHI3qV8cH0Y7aVw7s4IVlDOrgwOcKwZt/kyhByt8leF
MIME-Version: 1.0
X-Received: by 10.112.8.69 with SMTP id p5mr20717914lba.97.1420800736343; Fri, 09 Jan 2015 02:52:16 -0800 (PST)
Received: by 10.112.77.231 with HTTP; Fri, 9 Jan 2015 02:52:16 -0800 (PST)
In-Reply-To: <013A9B371AC6DF4C8AD261897D8F243E117A4FD2@xmb-aln-x08.cisco.com>
References: <20150107143216.GA13482@elstar.local> <20150108.102157.2289650364805875177.mbj@tail-f.com> <0CD84218-D27C-4DB2-8E4A-8D9D651BE308@nic.cz> <CABCOCHTvRDvp3ukfaVOicuC+BBwR5KMZDyKEq_+rU2NpRsW_MA@mail.gmail.com> <013A9B371AC6DF4C8AD261897D8F243E117A4FD2@xmb-aln-x08.cisco.com>
Date: Fri, 09 Jan 2015 02:52:16 -0800
Message-ID: <CABCOCHQUCkF8eykQut94CaNfpn1ZpkKtGM738ZkVayqSPpE+Tg@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: "Peyman Owladi -X (powladi - Ensoft Ltd at Cisco)" <powladi@cisco.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <http://mailarchive.ietf.org/arch/msg/netmod/mKbU-n7oxI0a6g1ThxH1oa2zUFI>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] VRFY :Y09: introduce optional keys
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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, 09 Jan 2015 10:52:21 -0000
Hi, I do not think this is a minor change to YANG so it is inappropriate for a minor update. Solutions which alter the instance-identifier data type will break NACM and this is also not a minor update change. I do not know of any real use-cases in which a value cannot be selected that means not-in-use. The "union" data-type can almost always be used to create a typedef for this purpose. There is no real operational need to suppress sending a few key leafs during a "create" operation. NETCONF is not optimized for small message size in any way. I do not think that lack of optional keys is a bug in YANG and therefore it should not be part of YANG 1.1 at all. Andy On Fri, Jan 9, 2015 at 2:29 AM, Peyman Owladi -X (powladi - Ensoft Ltd at Cisco) <powladi@cisco.com> wrote: > >> -----Original Message----- >> From: netmod [mailto:netmod-bounces@ietf.org] On Behalf Of Andy Bierman >> Sent: 08 January 2015 15:20 >> To: Ladislav Lhotka >> Cc: netmod@ietf.org >> Subject: Re: [netmod] VRFY :Y09: introduce optional keys >> >> On Thu, Jan 8, 2015 at 2:22 AM, Ladislav Lhotka <lhotka@nic.cz> wrote: >> > >> >> On 08 Jan 2015, at 10:21, Martin Bjorklund <mbj@tail-f.com> wrote: >> >> >> >> Hi, >> >> >> >> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote: >> >>> The 2014-12-03 virtual interim meeting proposal is to adopt Y09-03. >> >> >> >> The reasons for proposing Y09-03 (instead of Y09-02) were: >> >> >> >> 1. The instance-identifier syntax proposed in Y09-02 doesn't work, >> >> b/c empty strings and 0-values integers would also return "true" >> >> in the expression "not(key)". >> >> >> >> But this turned out to be a false claim; the syntax proposed in >> >> Y09-02 is correct. >> >> >> >> 2. Y09-02 is tricky to implement in "common databases", since they >> >> require values for all keys. >> > >> > In some common databases (e.g. mongodb) a declaration of a key is just >> an instruction for the server to generate an index. I think it is more a >> limitation of NETCONF’s edit-config design. >> > >> > An implication for both Y09-02 and Y09-03 is that if a key is not set >> at the time a list entry is created, it cannot be set afterwards. >> > >> >> >> >> But the idea for how to handle Y09-03 in these databases was to >> >> store additional info that the default value is set. The same >> >> technique can be used to handle purely optional keys. >> >> >> >> Thus, I prefer Y09-02. >> > >> > Me too, Lada > > I think that as well as not having any downsides, Y09-02 actually addresses the set of issues better than Y09-03; sometimes there isn't a default that makes sense, in which case adding absence to the value space of a key is important. > >> Neither solution works. >> I agree with David that they should not be added at all to YANG. > > Is the key concern here the handling of default values? > >> Please answer the questions below wrt/ how lists with default keys work: >> >> What if the designer does not want a list to automatically instantiate >> entries? >> How is this accomplished? > > If we do have defaults, I would have thought that having a default value for a key shouldn't mean a list entry is automatically instantiated -- i.e. there should still be no list entries until they are explicitly created. > > Perhaps this could be made explicit by requiring that at least one key has no default value? > >> typedef X { >> type int32; >> default 42; >> } >> >> list broken { >> key x; >> leaf x { type X; } >> leaf y { type string; mandatory true; } >> } >> >> Does the server automatically create a default entry for x=42? >> If so, then isn't the mandatory-stmt violated immediately? >> Are must-stmts in the default key leaf evaluated? >> >> Are <edit-config> requests for list "broken" allowed to omit the <x> >> leaf? Is the server supposed to fill in x=42 in such cases? > > Per RFC6020 section 7.6.1: > > "... if the leaf's type has > a default value, and the leaf is not mandatory, then the leaf's > default value is the type's default value. In all other cases, the > leaf does not have a default value." > > So in this example, since the leaf is mandatory, the default value is ignored, and the client must specify a value. (Otherwise this same problem would apply to any leaf in the list.) > > Cheers, > Peyman > >> >> >> >> /martin >> >> >> Andy >> >> >> >> >> >> >> >> _______________________________________________ >> >> netmod mailing list >> >> netmod@ietf.org >> >> https://www.ietf.org/mailman/listinfo/netmod >> > >> > -- >> > Ladislav Lhotka, CZ.NIC Labs >> > PGP Key ID: E74E8C0C >> > >> > >> > >> > >> > _______________________________________________ >> > 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
- [netmod] VRFY :Y09: introduce optional keys Juergen Schoenwaelder
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys David Reid
- Re: [netmod] VRFY :Y09: introduce optional keys Martin Bjorklund
- Re: [netmod] VRFY :Y09: introduce optional keys Ladislav Lhotka
- Re: [netmod] VRFY :Y09: introduce optional keys Ladislav Lhotka
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys Peyman Owladi -X (powladi - Ensoft Ltd at Cisco)
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys Martin Bjorklund
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys Martin Bjorklund
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys Ladislav Lhotka
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys Ladislav Lhotka
- Re: [netmod] VRFY :Y09: introduce optional keys Andy Bierman
- Re: [netmod] VRFY :Y09: introduce optional keys Ladislav Lhotka
- [netmod] VRFY :Y09: introduce optional keys Juergen Schoenwaelder