Re: Clarification on put vs merge and createMissingParent

Robert Varga <nite@...>

On 27/11/2018 20:45, Robert Varga wrote:
But genius code is also doing a put and that works, it doesn't delete
any existing ports. In fact Genius code most times adds multiple ports
in quick succession. Only difference between two is Genius code sets
Got a pointer to that code?

Assuming bridgeNode exists in the data store, createMissingParents=true
should not have a bearing on the effects of the overall list (but I may
be missing something or there could be a bug).
Sorry for self-reply, it just occurred to me.

There are slight differences in handling
createMissingParents={true,false} between controller APIs, md-sal APIs
and mdsal-3.0.2 in this particular case (keyed list entry):

1) Controller and MD-SAL < 3.0.2 (read: up until Neon right now) with
createMissingParents=false will issue an empty merge to the parent list:

This is needed because before yangtools-2.1.0 the list needed to be
created, but there is no way to address the list itself in Binding (you
can address a list's parent and you can address all its entries, but you
cannot address the list itself)

2) MDSAL >= 3.0.2 (read: Neon real soon now) will take no additional steps

This is noted in with
yangtools-2.1.0 the list node comes as goes as needed, hence the hoopla
in 1) is not necessary.

3) Controller with createMissingParents=true will walk the path and
issue an empty merge for each path component:

Note that this is a superset of 1).

4) MD_SAL with createMissingParents=true will create a single "empty
parents" structure and merge it that as immediate descendant of root:

The difference between 3) and 4) exists because 4) is seen as more
efficient way of achieving the same goal -- but the details are sketchy,
as that was Tony's patch a looong time ago. I do believe it was all
about the utility 4) uses actually coming from netconf to yangtools (and
not being available when 3) was implemented) and us not wanting to risk
a behaviour change in the controller.

Nevertheless, the expectation is that all of these different approaches
produce the same resulting data tree content and same ModificationType
in associated DTCLs.

So if we have exhausted all other alternatives, someone can check if the
behaviour changes with, assuming
Netvirt is using MD-SAL APIs :)


Join to automatically receive all group messages.