Re: [Netconf] nmda-restconf operations (was: netconf-binary-encoding comments)

Ladislav Lhotka <lhotka@nic.cz> Mon, 16 July 2018 12:57 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BF7B4130E02; Mon, 16 Jul 2018 05:57:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=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 tPs291czlUtJ; Mon, 16 Jul 2018 05:57:15 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) by ietfa.amsl.com (Postfix) with ESMTP id C169D130DF9; Mon, 16 Jul 2018 05:57:14 -0700 (PDT)
Received: by trail.lhotka.name (Postfix, from userid 109) id 160F71820CBC; Mon, 16 Jul 2018 15:03:31 +0200 (CEST)
Received: from localhost (unknown [89.24.60.123]) by trail.lhotka.name (Postfix) with ESMTPSA id 9D0AD18202E0; Mon, 16 Jul 2018 15:03:29 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Andy Bierman <andy@yumaworks.com>
Cc: Kent Watsen <kwatsen@juniper.net>, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, "draft-ietf-netconf-nmda-restconf@ietf.org" <draft-ietf-netconf-nmda-restconf@ietf.org>, "netconf@ietf.org" <netconf@ietf.org>, Robert Wilton <rwilton=40cisco.com@dmarc.ietf.org>
In-Reply-To: <CABCOCHR-0CNzUjHXDfqbO7XbOMejjyr+B8m5H1vmv5MWi8Ny=g@mail.gmail.com>
References: <82A8420F-445C-42BD-9A47-DCF62A9864BC@juniper.net> <20180709173041.xkihqyccjcucjslj@anna.jacobs.jacobs-university.de> <13FABA4A-C367-4E27-88FF-3EA48638249F@juniper.net> <87va9mf23z.fsf@nic.cz> <CABCOCHS2nmjsZ7nDk9OhbkM5dGTLEWHpngxhWbaUtX2v+x2TLA@mail.gmail.com> <17b6cb1c2cd297a11b2dc6d4b54647aa0f4a47b7.camel@nic.cz> <CABCOCHR-0CNzUjHXDfqbO7XbOMejjyr+B8m5H1vmv5MWi8Ny=g@mail.gmail.com>
Date: Mon, 16 Jul 2018 14:57:11 +0200
Message-ID: <87601fcp94.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/JaU7Kn_LaMJhJj6GH1p_wQ4Z7rM>
Subject: Re: [Netconf] nmda-restconf operations (was: netconf-binary-encoding comments)
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jul 2018 12:57:18 -0000

Andy Bierman <andy@yumaworks.com> writes:

> On Wed, Jul 11, 2018 at 10:16 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>
>> On Wed, 2018-07-11 at 08:40 -0700, Andy Bierman wrote:
>> >
>> >
>> > On Wed, Jul 11, 2018 at 4:22 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>> > > Kent Watsen <kwatsen@juniper.net> writes:
>> > >
>> > > >>> This isn't what I meant.  To be more specific, I'm wondering if the
>> > > nmda-restconf
>> > > >>> draft would benefit from having a sentence like:
>> > > >>>
>> > > >>>    A RESTCONF server supporting NMDA datastores MAY implement the
>> > > >>>    "ietf-netconf" [RFC6241] and "ietf-netconf-nmda" [I-D.
>> ietf-netconf-
>> > > nmda-
>> > > >>>    netconf] modules to enable the NETCONF operations defined in
>> those
>> > > >>>    drafts to appear {+restconf}/operations resource.
>> > > >>>
>> > > >>> Note: I put "MAY" as RESTCONF may someday have a more native way
>> to do
>> > > this.
>> > > >>>
>> > > >>
>> > > >> Well, "ietf-netconf" does not really support NMDA well and this is
>> why
>> > > >> we have "ietf-netconf-nmda". Does not make much sense to point to
>> > > >> "ietf-netconf" in an NMDA document.
>> > > >
>> > > > But we'd still need lock, unlock, commit, commit-confirmed, etc.,
>> > > > right?
>> > >
>> > > These would make RESTCONF server stateful, thus violating REST
>> principles.
>> > > My
>> > > draft
>> > >
>> > > https://datatracker.ietf.org/doc/draft-lhotka-netconf-
>> restconf-transactions/
>> > >
>> > > tries to achieve similar effects in a RESTful way.
>> > >
>> >
>> >
>> > I like the idea of "private candidate" datastores you call "staging".
>> > I would keep the term candidate.
>>
>> The problem with this is that <candidate> in NETCONF has a looser
>> semantics (it
>> can also be shared).
>>
>> >
>> > This idea was discussed during RESTCONF draft development, but
>> > as the client creating a "transaction" resource. I think your draft is on
>> > the right track, and datastores are protocol-independent so NETCONF
>> > can use the same datastores with RPC operations.
>>
>> Yes, it can certainly be improved. I already have some pending updates,
>> but I
>> wanted to keep it simple for start.
>>
>> >
>> > You ignore the problem of concurrent edits, which is why this idea was
>> not
>> > pursued
>> > at the time. What happens when the altered data overlaps across private
>> > candidates?
>>
>> I don't ignore it, the text says that the user's staging datastore has to
>> be
>> atomically merged into <intended>, I just didn't want to specify the
>> procedure.
>> In any case, the result has to be a valid <intended>. But I am open to a
>> discussion.
>>
>
>
> Leaving it as an implementation detail is the IETF's way of ignoring
> problems.

Here, the situation may be further complicated by factors that are not
present in git, such as NACM or validation issues. But in fact, the
particular procedure is not so important from the protocol viewpoint:
by issuing the commit operation, the client says: "Dear server, here is
my intention how the configuration should look like, do whatever you can
to merge it with the existing config."

>
>
>>
>> > What are the procedures equivalent to git pull, push, merge?
>> > How are collisions handled? What exactly is a collision?
>> > Not trivial standards issues to solve.
>>
>> I think it can be left open, I even suspect there is no universal solution
>> suitable for all use cases. Our implementation (JetConf) does the
>> following:
>>
>> - each user's edit operation is applied to the staging datastore and also
>> recorded in a journal
>>
>> - at commit, if <intended> hasn't been changed in the mean time, then the
>> staging datastore simply becomes <intended>
>>
>> - otherwise, the edit operations from the journal are applied sequentially
>> on
>> the actual contents of <intended>.
>>
>>
>
> This is "last one wins".

No, as I wrote, if an operation writes data that were changed in the
mean time, the commit fails.

Lada

> You will find this sort of works for create and merge but no so much for
> replace and delete.
>
>
>
>> (Actually, we are not NMDA-compatible yet and don't have <intended> but it
>> works
>> this way).
>>
>> Lada
>>
>
>
> Andy
>
>
>>
>> >
>> > > Lada
>> > >
>> >
>> >
>> > Andy
>> >
>> > > >
>> > > > Maybe it's a moot point, since ietf-netconf-nmda requires that ietf-
>> > > netconf
>> > > > is implemented too, but I thought being explicit would be helpful
>> here.
>> > > >
>> > > > So, adding something like this to nmda-restconf would be good?
>> > > >
>> > > >
>> > > > Kent // contributor
>> > > >
>> > > > _______________________________________________
>> > > > Netconf mailing list
>> > > > Netconf@ietf.org
>> > > > https://www.ietf.org/mailman/listinfo/netconf
>> > >
>> --
>> Ladislav Lhotka
>> Head, CZ.NIC Labs
>> PGP Key ID: 0xB8F92B08A9F76C67
>>

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