[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Canonical configuration database order



Phil Shafer wrote:
Andy Bierman writes:
The canonical order for named sibling instances is the natural sort order,
based on the key associated with the nodes.

FWIW, JUNOS has both auto-sorted and user-sorted lists.  For example,
the terms of an import policy are named by the user and ordered by
the user, since the order matters.  But for interface definitions,
the order doesn't matter, so we sort them automatically.  Both have
keys (term name and interface name), to allow users to refer to
them.  The term name for policies is not important to the routing
code, which simply applies the terms in the order they appear in
the configuration, but is necessary to allow users to do stuff like:

    edit policy foo term goo
    copy term goo to term zoo
    delete term goo
    insert term goo before term moo


Your user-sorted list is a position-dependent (unnamed) list.
For automation purposes, I always leave the order unchanged.

Presumably, these CLI commands can be NV-stored, so they
will appear in a specific place in the <running> config.
Now consider a 'merge' <edit-config> operation.
There is no deterministic algorithm you can use to reliably
automate the merge operation for unnamed instances.
(That's one area where data-model callbacks are difficult to eliminate.)

In some data models concatenation may be the algorithm,
but it doesn't have to be.  In your example, if I merged
these commands with an identical existing set by concatenation,
the result would be syntactically correct, but operational garbage.


Thanks,
 Phil

Andy

--
to unsubscribe send a message to netconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>