Subject: Re: [netmod] I-D Action: draft-ietf-netmod-rfc6020bis-07.txt

From: Randy Presuhn <[email-masked]>
Date: Mon, 28 Sep 2015 09:34:13 -0700 (GMT-07:00)

Hi -

>From: Martin Bjorklund <[email-masked]>
>Sent: Sep 28, 2015 3:15 AM
>To: [email-masked]
>Cc: [email-masked]
>Subject: Re: [netmod] I-D Action: draft-ietf-netmod-rfc6020bis-07.txt
...
>Ok; the intention was "replace if it exists, and create otherwise"
>(i.e., "replace" as in NETCONF edit operation).   We can make this
>explicit:
>
>NEW:
>
>- If the "when" statement is a child of any other data definition
>  statement, the accessible tree is tentatively altered during the
>  processing of the XPath expression by replacing all instances of the
>  data node for which the "when" statement is defined with a single
>  dummy node with the same name, but with no value and no children.
>  If no instances of the data node exists, the dummy node is created.
>  The context node is this dummy node.

A standard should avoid prescribing a specific implementation
strategy, and should instead limit itself to describing what
the observable behaviours of the relevant interfaces must be.

Randy

---

From: Andy Bierman <[email-masked]>
Date: Mon, 28 Sep 2015 09:52:13 -0700

On Mon, Sep 28, 2015 at 9:34 AM, Randy Presuhn <[email-masked]
> wrote:

> the observable behaviours of the relevant interfaces must be.
Agreed.

I also do not understand why one would replace any instances with a dummy
node.
The dummy node is just to test whether the context node should be created
or not.

I also found other text related to when-stmt that prescribed an evaluation
order.
This is also implementation-specific.  What if the when-stmt is affected
by 2 nodes and both are edited in the same <edit-config>?  NETCONF has no
edit processing order so which one is first?  (A: ???, so YANG cannot rely
on
edit processing order).

> Randy

Andy

>
>
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
>

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 29 Sep 2015 09:18:40 +0200 (CEST)

> the observable behaviours of the relevant interfaces must be.

Absolutely!  This text is not supposed to prescribe anything for the
implementation. (*) Maybe it needs to be rephrased.  Do you have any
suggestions?

(*) FWIW, in our implementation we do not actually delete anything;
but it behaves as if it was deleted.

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 29 Sep 2015 09:57:43 +0200 (CEST)

> I also do not understand why one would replace any instances with a dummy

Consider this:

  container foo {
    when "not(bar = 42)";
    leaf bar { type int32; }
  }

Suppose the db is empty.  The when expression now evaluates to true,
and you can configure bar.  If you now set bar to 42, the when
expression evaluates to false so foo/bar should be deleted; but then
the when expression evaluates to true so it should exist.

There are two ways we can handle this:

1) Try to make sure the result is deterministic; this is what the
   proposed text does.

2) Accept this behavior, since it only happens if people write such
   (bad) expressions.  In this case we should just create the dummy
   node if the context node doesn't exist, and remove the text about
   replace.
   
> edit processing order so which one is first?  (A: ???, so YANG cannot rely

AFAIK there is no text that relies on any specific NETCONF edit-config
processing order.  If there is, let me know.

/martin

---

From: Ladislav Lhotka <[email-masked]>
Date: Tue, 29 Sep 2015 11:10:48 +0200

> the observable behaviours of the relevant interfaces must be.

"when" statement relies on XPath but in some situations context for
XPath evaluation is not properly defined. The proposed solution to
Issue Y18 tries to alleviate this problem by defining tentative
manipulations to XML infoset that provide the necessary context.

I am not particularly happy with this solution but still it is IMO
better than hand-waving. I think "when" statement is a problematic
inovation over standard XML schema languages because it defies
grammar-based validation.

Lada

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C