[YANG] deep keys and unique statements

Andy Bierman <ietf@andybierman.com> Fri, 18 January 2008 16:18 UTC

Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1JFtuq-0005aG-Cn; Fri, 18 Jan 2008 11:18:00 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JFtup-0005a9-HL for yang-confirm+ok@megatron.ietf.org; Fri, 18 Jan 2008 11:17:59 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JFtup-0005a1-7E for yang@ietf.org; Fri, 18 Jan 2008 11:17:59 -0500
Received: from smtp114.sbc.mail.mud.yahoo.com ([68.142.198.213]) by ietf-mx.ietf.org with smtp (Exim 4.43) id 1JFtuo-00039S-QJ for yang@ietf.org; Fri, 18 Jan 2008 11:17:59 -0500
Received: (qmail 38370 invoked from network); 18 Jan 2008 16:17:58 -0000
Received: from unknown (HELO andrew-biermans-computer.local) (andybierman@att.net@67.126.240.103 with plain) by smtp114.sbc.mail.mud.yahoo.com with SMTP; 18 Jan 2008 16:17:57 -0000
X-YMail-OSG: qIsRDfMVM1mn6QauG3VxMzSgqq1FMGJhuqoPb9wRlN.5UH2f
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4790D279.3070804@andybierman.com>
Date: Fri, 18 Jan 2008 08:23:21 -0800
From: Andy Bierman <ietf@andybierman.com>
User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031)
MIME-Version: 1.0
To: yang@ietf.org
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: c0bedb65cce30976f0bf60a0a39edea4
Subject: [YANG] deep keys and unique statements
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org

Hi,

I share Ladislav's concern that YANG requires all key components
to be leafs at the very top-level within the list.

IMO, there is no harm or massive complexity introduced if
a key leaf is allowed to be nested within N containers.
A key must be mandatory, and have only one instance per list entry,
therefore nested lists or choices cannot contain key leafs.

This 'container only' is not a CLR -- just the properties of a key.
The implementation burden of buffering input does not seem
that important, since key leafs can appear anywhere in list,
and there may be a lot of XML-on-the-wire before the key leaf
shows up.  Key components do not have to be used in 'XML order'
either, which also requires buffering to support.

On the other hand, the unique-stmt allows arbitrary combinations
of leaf instances anywhere within the list.  The complexity
built into the unique-stmt is extensive, as even a 2-d table shows:


   list foo {
     // all nodes except the key leafs (x, c, d) are optional
     config true;
     key x;
     unique "y bar/a baz/e baz/c";

     list bar {
       config false;
       leaf a { type int32; }
       leaf b { type string; }
     }

     list baz {
       key "d c";
       leaf c { type float32; }
       leaf d { type float64; }
       leaf e { type binary; }
     }

     leaf x { type instance-identifier; }
     leaf y { type keyref { path "baz/c"; } }

   }


The agent has to check all the instances of all the leafs and only
enforce uniqueness in the entries that are complete.  One missing
optional leaf, and the entire unique-stmt is ignored instead (for that
entry).

Besides this unbounded complexity, it seems very odd for
the leafs within the nested lists (bar and baz) to have
uniqueness constraints placed 'from above', since they are
not required to be unique within the list that defines the leafs.

It also seems broken that config and non-config leafs can be
combined in the uniqueness test.  The 'config' and 'unique'
statements are not relevant in notification data, so is it
an error or just no-op if they are entered for notification
data-def-stmts?  (Could be from uses expansion as well.)
(Note that keyref adds an indirection twist to the complexity.)

Andy




_______________________________________________
YANG mailing list
YANG@ietf.org
https://www1.ietf.org/mailman/listinfo/yang