[NETCONF-70] Support multiple Yang model revisions for mounted nodes Created: 24/Sep/15 Updated: 13/Aug/19 |
|
| Status: | Confirmed |
| Project: | netconf |
| Component/s: | netconf |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Wojciech Dec | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| Description |
|
Current code supports only one version of a given Yang model mounted from remote devices. The presence of another same model revision breaks things. |
| Comments |
| Comment by Wojciech Dec [ 25/Sep/15 ] |
|
Clarifying: Issue is seen when same model, but with different revisions is mounted from two or more netconf devices. Although logs are from Helium, issue is also there in Lithium: 2015-07-24 20:50:06,501 | ERROR | lt-dispatcher-35 | DataChangeListener | 161 - org.opendaylight.controller.sal-distributed-datastore - 1.1.1.Helium-SR1-00004_1-SNAPSHOT | Error notifying listener org.opendaylight.controller.listeners.impl.MyAppl ] |
| Comment by Wojciech Dec [ 03/Feb/16 ] |
|
Perhaps I'm missing something here, but how does 4577 solve the problem described here? The issue is that the binding aware code "binds" to the Yang model derived version, and if the device doesn't have that version, it fails with the error below. Given that the Yang RFC mandates that yang models be backwards compatible, this is broken behavior. |
| Comment by Wojciech Dec [ 25/May/16 ] |
|
Re-opening: The 4577 fix provides an impractical workaround. It is not realistic to specify, mount and maintain a separate cache for each device. |
| Comment by Abbas P Pareedkunju [ 31/May/16 ] |
|
Hi, On the latest build it seems working fine. opendaylight-user@root>shell:exec curl -u'admin:admin' -X PATCH -H "Content-Type:application/yang.patch+json" -d '{"ietf-restconf:yang-patch":{"patch-id":"0","edit":[{"edit-id":"0","operation":"replace","target":"/","value":{"car:cars":{"car-entry":[ {"id":"0"}]}}}]}' localhost:8080/restconf/config/car:cars ;echo opendaylight-user@root> Can this be closed? Thanks, |
| Comment by Wojciech Dec [ 31/May/16 ] |
|
(In reply to Abbas P Pareedkunju from comment #5) ]}}}]}' localhost:8080/restconf/config/car:cars ;echo Working fine in what way? |
| Comment by Abbas P Pareedkunju [ 31/May/16 ] |
|
Hi, On the latest build it seems working fine. opendaylight-user@root>shell:exec curl -u'admin:admin' -X PATCH -H "Content-Type:application/yang.patch+json" -d '{"ietf-restconf:yang-patch":{"patch-id":"0","edit":[{"edit-id":"0","operation":"replace","target":"/","value":{"car:cars":{"car-entry":[ {"id":"0"}]}}}]}' localhost:8080/restconf/config/car:cars ;echo opendaylight-user@root> Can this be closed? Thanks, |
| Comment by Abbas P Pareedkunju [ 31/May/16 ] |
|
Missed your last comment. And due to the slowness in the system, my comment has been posted twice. Apologies ! |
| Comment by Giles Heron [ 31/May/16 ] |
|
Hi Woj, this isn't meant to be one model per device. rather it's one model per device software revision where two revisions expose different versions of the same model but with the same revision date. unless I've mis-remembered it Giles |
| Comment by Wojciech Dec [ 31/May/16 ] |
|
I don't quite follow "two revisions expose different versions of the same model but with the same revision date"; seems like a direct violation of the Yang spec. In any case, the "fix" that led to the closure of this defect requires that when mounting a device, a separate directory is specified for that device's model cache. That a) is totally opaque to the user (what operator would ever remember) b) fails as soon as the mounted device gets upgraded to a new model (coz the cache still stays). So, what I'm arguing for here is that a cleaner solution be devised. |
| Comment by Giles Heron [ 31/May/16 ] |
|
So the model here (IIRC) is you specify a directory to store the cached schemas in. So there's nothing to stop you using the same directory for multiple devices. So while you specify the cache dir per device there isn't generally one cache dir per device. And re violations of the YANG spec I think it was issues with auto-generated YANG models that prompted this. There may also be cases where you need to hand-edit a specific rev of a YANG model for some devices but not others (e.g. incorrect implementation on the device OS). Remember - not all devices do everything correctly (sure, I know I'm teaching you to suck eggs here). |
| Comment by Ryan Goulding [ 31/May/16 ] |
|
"So there's nothing to stop you using the same directory for multiple devices. So while you specify the cache dir per device there isn't generally one cache dir per device." Correct; this is how I designed this; it is a workaround to deal with the fact that YANG revisionless imports are broken in ODL. Generally, we set up a cache for a specific version of router and make the changes locally there (if necessary, sometimes just honoring the device manufacturers yang works). In fact, without specifying a specific revision for import, the revision that is resolved is non-deterministic (hence why you will see hard-coded assumptions in the standard files utilized by ODL like https://git.opendaylight.org/gerrit/#/c/21049/). Initially Tony was working on a solution to correctly handle revisionless imports through programatic resolution, but I believe he punted this since it could be solved through the binding v2 specification work. While Please feel free to work on a different approach; I'd be interested to see how others solve it. |
| Comment by Wojciech Dec [ 31/May/16 ] |
|
We may be talking about overlapping things. Adding a cache store directory that's a parameter in a mount point isn't cool. Who on earth will ever know about that parameter, remember to use it, when to change it, etc, when to clean the cache, besides perhaps the people here? As far as the Yang spec is concerned, there really is only one correct answer here: The spec, which says that revisions have to be a) renumbered b) backwards compatible. It is a rat hole to engineer for non-yang spec compliant cases. Besides, the fundamental issue remains: A BA app built against device model rev X does not communicate properly with a mixed pool of devices running models X and Y. |
| Comment by Tomas Cere [ 31/May/16 ] |
|
(In reply to Wojciech Dec from comment #13) That's why there's documentation for this feature on the wiki, right? That's why there's documentation for it on the wiki, right? > So, what I'm arguing for here is that a cleaner solution be devised. Seems like you don't really want to cache the models. As for the BA app problem when it can't be used for multiple revisions of the same model the v2 binding spec should fix that but that's still some time away. |
| Comment by Wojciech Dec [ 31/May/16 ] |
|
(In reply to Tomas Cere from comment #14) "we have a wiki" is fine for non essential nerd-knobs. > I don't see where I said that, but anyway... > To summarize:
|
| Comment by Tomas Cere [ 31/May/16 ] |
|
(In reply to Wojciech Dec from comment #15) Well cleaning up the cache(== delete) after disconnect defeats the entire purpose(which is to avoid redownloading of schemas already present in the system) of the cache doesn't it? You don't want to use as you put it "nerd-knobs", that's fine, but this issue is not something we can fix on netconf level as this has to do with binding generation. The fix by Ryan can be of use to some people that encounter similar issues, or are willing to workaround the issue and should be mentioned here. |
| Comment by Wojciech Dec [ 31/May/16 ] |
|
(In reply to Tomas Cere from comment #16) A cache is by definition time-bound. Otherwise it becomes a rubbish dump. Anyway, the problem I opened is different... Sure, Ryan's fix can be useful to whoever has the problem, but mentioning it in the context of "it fixes" the issue raised by this bug is simply not true. If the component is wrong, let's change that. |
| Comment by Tomas Cere [ 31/May/16 ] |
|
Added the binding spec dependency which should be enough |