Re: [netmod] datastore-specific constraints

Ladislav Lhotka <lhotka@nic.cz> Thu, 13 December 2018 10:48 UTC

Return-Path: <lhotka@nic.cz>
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 7430512D7F8 for <netmod@ietfa.amsl.com>; Thu, 13 Dec 2018 02:48:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7
X-Spam-Level:
X-Spam-Status: No, score=-7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 iVpOuBXQzK8M for <netmod@ietfa.amsl.com>; Thu, 13 Dec 2018 02:48:55 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B63DE1286E3 for <netmod@ietf.org>; Thu, 13 Dec 2018 02:48:54 -0800 (PST)
Received: from birdie (unknown [IPv6:2001:718:1a02:1::380]) by mail.nic.cz (Postfix) with ESMTPSA id E5DF9629A7; Thu, 13 Dec 2018 11:48:52 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1544698132; bh=t/PqsngIo8+cp5PZK2bozgClo9JX0wmSUHq4CHYRrvs=; h=From:To:Date; b=ag2mNhw+3YiX50xz4gfuDH/JS1Ss+nTA607zQxVETXGxvSo97zeHOftuI6aS1qRwg HZyM+b46gQTCGQSJLrUHQzHRdjRcR6FY+K6O0OLWlk+1CJPtmNJCZBPuN1Gwgw4WQ3 SFsTl5JrQ2tBsOYyM1EFEfhchruqodPG/NZafkAo=
Message-ID: <90745533ba7f58415402badb681c43bad797d4a4.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: rwilton@cisco.com, janl@tail-f.com, netmod@ietf.org
Date: Thu, 13 Dec 2018 11:48:52 +0100
In-Reply-To: <20181213.112454.11250508028477040.mbj@tail-f.com>
References: <b434351564e5244c1341a247b819e5fe935788e5.camel@nic.cz> <20181213.095139.2195805691286738924.mbj@tail-f.com> <f962e20f8dfbe8f21db0abc399851f8acd454ed9.camel@nic.cz> <20181213.112454.11250508028477040.mbj@tail-f.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.30.3
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/h7Ffrpfcjo4_Ti5HLQ70kA4f-xg>
Subject: Re: [netmod] datastore-specific constraints
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, 13 Dec 2018 10:48:58 -0000

On Thu, 2018-12-13 at 11:24 +0100, Martin Bjorklund wrote:
> Ladislav Lhotka <lhotka@nic.cz> wrote:
> > On Thu, 2018-12-13 at 09:51 +0100, Martin Bjorklund wrote:
> > > Ladislav Lhotka <lhotka@nic.cz> wrote:
> > > > On Wed, 2018-12-12 at 15:23 +0000, Robert Wilton wrote:
> > > > > Hi Lada,
> > > > > I basically agree with Jan's suggestion.
> > > > > I don't think that I would use a when statement for this scenario
> since
> > > you
> > > > > want a leaf to report the operational value that is in effect, and one
> of
> > > the
> > > > > aims of NMDA is to try and get the configured and operational value
> onto
> > > the
> > > > > same path wherever possible.
> > > > > But, I think that the question about validity of must statements is
> more
> > > > > interesting.  RFC 8342 states that these can be violated in
> operational,
> > > but
> > > > > the intention is that the constraints in <operational> should
> generally
> > > apply
> > > > > (but never be actually checked by the server).  In this case, it might
> be
> > > > > useful to be able to annotate a must statement to indicate that it
> only
> > > > > applies to configuration data and not operational data.
> > > > 
> > > > Another option could be that "must" constraints on config data do not
> apply
> > > in
> > > > <operational>, whereas constraints on "config false" data serve as
> binding
> > > > guidelines for implementors.
> > > 
> > > Not sure what "binding guideline" means, but note that RFC 8342 says
> > > for <operational>:
> > > 
> > >    <operational> SHOULD conform to any constraints specified in the data
> > >    model, but given the principal aim of returning "in use" values, it
> > >    is possible that constraints MAY be violated [...]
> > 
> > According to the definition of SHOULD and MAY in RFC 2119, this sentence
> > contradicts itself.
> 
> It should probably have been "may" then...?

With a sound definition of syntactic and semantic constraints, we could state
that data in <operational>

- MUST satisfy syntactic constraints
- SHOULD satisfy semantic constraints that apply to config=false data

(semantic constraints on config=true data are checked before the data get into
<running>)

> 
> > >    Only semantic constraints MAY be violated.  These are the YANG
> > >    "when", "must", "mandatory", "unique", "min-elements", and
> > >    "max-elements" statements; and the uniqueness of key values.
> > 
> > It is nice to see "when" listed among semantic constraints.
> 
> Yeah, I was a bit surprised that this sentence classifies "when" as a
> semantic constraint...

Every truth will eventually be revealed. :-) 

> 
> > Note, however, that
> > in sec. 8.1 of RFC 7950, "when" ended up among the constraints that
> > are true in 
> > all data trees (despite my hefty protests in the past).
> 
> Note that also uniqueness of keys is listed in 8.1 as true all data
> trees, but relaxed by 8342.

Well, section 8.1 only says this about keys:

   o  All key leafs MUST be present for all list entries.

Their uniqueness is not mentioned (an omission?). Anyway, it is IMO a typical
semantic constraint that shouldn't be enforced in <candidate>, but due to the
limitations of the NETCONF protocol it has to be.

Lada

> 
> 
> /martin
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67