Subject: [Netconf] clarification on <discard-changes>

From: Kent Watsen <[email-masked]>
Date: Wed, 6 Feb 2013 22:28:40 +0000

Riddle me this: two NETCONF clients connect to the same NETCONF server.
One client locks the candidate datastore, which is already a copy of the
running datastore, and then pauses, during which the other client executes
<discard-changes> - what RPC-reply should the 2nd client receive?

Possible answers:

    1. <rpc-error>   - lock is tested before request is considered

    2. <ok/>         - request is considered first and, since there were
no changes
                       to discard, there was no need to check the lock's
status

    3. Up to vendor  - RFC 6241 is underspecified

Thanks,
Kent

---

From: Phil Shafer <[email-masked]>
Date: Wed, 6 Feb 2013 20:43:11 -0500

>    3. Up to vendor  - RFC 6241 is underspecified

6241 says:

      When the lock is acquired, the server MUST prevent any changes to
      the locked resource other than those requested by this session.

and:

      When a lock is active, using the <edit-config> operation
      on the locked configuration datastore and using the locked
      configuration as a target of the <copy-config> operation will be
      disallowed by any other NETCONF session.  Additionally, the system
      will ensure that these locked configuration resources will not be
      modified by other non-NETCONF management operations such as SNMP
      and CLI.

The <discard-changes> section doesn't discuss locks.

So (3) is definitely true, but (1) seems fairly obviously the
right behavior.

Thanks,
 Phil

---

From: Andy Bierman <[email-masked]>
Date: Wed, 6 Feb 2013 17:51:54 -0800

> So (3) is definitely true, but (1) seems fairly obviously the
We return an 'in-use' error -tag (1).
We test the lock before checking if there are really any changes to discard.

Thanks,
>  Phil

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 07 Feb 2013 09:07:13 +0100 (CET)

> > So (3) is definitely true, but (1) seems fairly obviously the

+1

> We test the lock before checking if there are really any changes to discard.

So do we.

/martin