[ovs-dev] why we need op wait when add-port or delete port

ychen ychen103103 at 163.com
Fri Mar 11 08:31:14 UTC 2016


Another 3  questions:
1. when use ovs-vsctl to add or del port p0 in br0, is that ok in the transaction when I change the op wait to the following?
  for port adding, the  operation wait is only for br0(condition must exist), p0(conditon must not exist)
 for port deleting, the operation wait is only for br0(condition must exist), p0(condition must exist)


2. I noticed that when add-port p0 in br0, why we need to use op wait for another bridge and all the ports in that bridge?
3. when use ovs-vsctl add-port, can I use op mutate instead of op update in the transaction, exp:
old format:
{
"where": [["_uuid", "==", ["uuid", "774222f2-9ab9-427f-a634-b818dc13cb2e"]]],
"row": {
"ports": ["set", [ 
["named-uuid", "row35edc309_3d4a_4791_8aae_ab3a1ac73aa8"],
["uuid", "46b3b3f3-0e75-4d3c-bea0-088b4d7bbec2"],
["uuid", "d31a00e7-edf7-4ae6-a589-5c0537b7dde7"]
]]
},
"op": "update",   
"table": "Bridge"
}, 


new format:
{
"mutations":[["ports","insert",["named-uuid","row35edc309_3d4a_4791_8aae_ab3a1ac73aa8"]]], 
"table":"Bridge", 
"where":[["_uuid","==",["uuid","774222f2-9ab9-427f-a634-b818dc13cb2e"]]], 
"op":"mutate"
}










At 2016-03-08 12:32:30, "Ben Pfaff" <blp at ovn.org> wrote:
>On Tue, Mar 08, 2016 at 11:43:53AM +0800, ychen wrote:
>>   I noticed that when add or delete port, the transaction always send op wait with all the ports in the same bridge.
>>  If the port p0 and p1 are totally independent, and have no relationship with each other, why when I add port p1, I need to wait port p0?
>
>This implements transactional atomicity.  If two transactions each add a
>different port, and they execute at the same time, one of them needs to
>fail and be retried, otherwise only one of the ports will be added in
>the end.


More information about the dev mailing list