[GBP-63] Fix addition of EP augmentations across neutron-mapper/ofoverlay. Created: 29/May/15 Updated: 17/Jun/15 Due: 12/Jun/15 Resolved: 17/Jun/15 |
|
| Status: | Resolved |
| Project: | groupbasedpolicy |
| Component/s: | General |
| Affects Version/s: | unspecified |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Keith Burns | Assignee: | Konstantin Blagov |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 3434 |
| Priority: | Low |
| Description |
|
Ensure all "setAugmentation(class,getAugmentation)" type EP patterns pull all augmentations, not just OfOverlayContext/OfOverlayL3Context |
| Comments |
| Comment by Keith Burns [ 01/Jun/15 ] |
|
What can happen is when we assign a field to an Augmentation, we have to ensure that there aren't existing augmentations. Either pull the aug's and update and push back, or update the subtree using the specific key. |
| Comment by Konstantin Blagov [ 03/Jun/15 ] |
|
https://git.opendaylight.org/gerrit/#/c/21759/ Unfortunately, the code for EndpointBuilder (in fact, any builder) generated by Yangtools provides only "unsafe" version of addAugmentation method. So it is mostly on programmer's good will, whether the potentially existing (in Datastore) augmentations added by some other party will be replaced with the new augmentation or not. The most reliable way seems to carefully chose between "put" or "merge", and general knowledge of possibility to break consistency. The pressure will be on code reviewers to control the intention of the whole operation. |
| Comment by Konstantin Blagov [ 05/Jun/15 ] |
|
I added a method that can check if an EP with given key exists and if it has some other augmentations (not counting our OfOverlayContext/OfOverlayL3Context). So one can chose if put or merge should be done. |
| Comment by Konstantin Blagov [ 17/Jun/15 ] |
|
The only fragment of code where there was a possibility to unintentionally delete augmentations was eliminated by change https://git.opendaylight.org/gerrit/#/c/22114 |