[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
Platform: 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
beryllium https://git.opendaylight.org/gerrit/#/c/37653/
boron https://git.opendaylight.org/gerrit/#/c/37654/

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
to the change behavior. Do you have any idea of how to affect the existing project?

Do you need this for Beryllium branch?
Although maybe we can address issues by your patch in master branch, we shouldn't apply (potential big) behavior change to stable 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.
Given that other openstack service providers work with the current code,
can you please elaborate the requirement by group based policy?
i.e. the reason why you came up with the patch.

Actually simple merge doesn't work because some model uses list or leaf-list.
e.g. port::fixed-ip, port::securitygroupos.
When updating those list, they are overwrited. So merge doesn't work for such lists.

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.
We are going to have a look at original data and modified data to see if objects are updated or created.

Generated at Wed Feb 07 20:25:37 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.