[NEUTRON-122] Updated objects should not be rewritten in WriteTransaction Created: 15/Apr/16 Updated: 03/May/16 Resolved: 03/May/16 |
|
| Status: | Resolved |
| Project: | neutron |
| Component/s: | transcriber |
| Affects Version/s: | Multiple |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Tomas Cechvala | Assignee: | Tomas Cechvala |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 5734 |
| Priority: | High |
| Description |
|
When listening to changes in DS, "put" creates/replaces data. When changing properties of an object in WriteTransaction by using "put", various listener implementations expect data modification and not creation/replacement. E.g. when a class implements listening to changes in DS by extending DataTreeChangeListener, modification type WRITE is received when modifying existing data in transactions by "put". However, by using "merge" received modification type is SUBTREE_MODIFIED, which is a proper consequence. |
| Comments |
| Comment by Tomas Cechvala [ 15/Apr/16 ] |
|
Proposed patches for |
| Comment by Isaku Yamahata [ 16/Apr/16 ] |
|
Hello Tomas, thank you for reporting this. Can you please clarify the affected project? Group Based Policy? Given it is tested with other openstack providers, I hesitate to apply the patch Do you need this for Beryllium branch? |
| Comment by Tomas Cechvala [ 18/Apr/16 ] |
|
Hello Isaku, thank you for responding on this. The affected project is Group Based Policy. You are right, we don't need a patch for this in beryllium. I just abandoned it. https://git.opendaylight.org/gerrit/#/c/37653/ In other projects, e.g. OVSDB, it seems to me that they also unintentionally process updates as creations. The fix would probably affect their update implementations, which have probably never run before so maybe they should be notified about this. |
| Comment by Isaku Yamahata [ 19/Apr/16 ] |
|
I suppose ovsdb/netvirt handles it intentionally. Actually simple merge doesn't work because some model uses list or leaf-list. |
| Comment by Tomas Cechvala [ 21/Apr/16 ] |
|
Lists (containers too) are overriden when we "put" them not "merge" them into transaction. If you do put on a subnode, e.g fixed-ips in port, modification type for port will be SUBTREE_MODIFIED and for fixed-ips WRITE. When using put on entire node (list or container), not just subnodes, WRITE will be the data change event even though we expect modification of the object (e.g changing device owner on a port when attaching it to a router). Merge should not break anything, when data don't exist, WRITE should be received. |
| Comment by Tomas Cechvala [ 03/May/16 ] |
|
After a brief team discussion I became convinced that using merge is not a good approach because it does not have any affect when removing sub-nodes. |