DbSetCommand on a map column can race
Bug #1867652 reported by
Terry Wilson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ovsdbapp |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I do not have a concrete example of this happening, but calling db_set() on a map column will take the value that was set, update some keys, then write that value to the whole column. If something else has updated the same column, even though we may think we are just appending values, we will overwrite that existing change. The row.verify() method is used to detect that issue and retry the transaction after reading the update that we missed. We should be using setkey() but there is currently a bug with it for some columns which hopefully will be fixed with https:/
To post a comment you must log in.
Reviewed: https:/ /review. opendev. org/713286 /git.openstack. org/cgit/ openstack/ ovsdbapp/ commit/ ?id=b92d8742bf3 f5e436bcb916061 8b343e3c4595fa
Committed: https:/
Submitter: Zuul
Branch: master
commit b92d8742bf3f5e4 36bcb9160618b34 3e3c4595fa
Author: Terry Wilson <email address hidden>
Date: Mon Mar 16 11:20:05 2020 -0500
Call row.verify() when updating map columns with db_set
The verify() method will ensure that if the row's column in the db
has changed since we set it, that we will be notified and try the
transaction again with new values. This is important when we do a
read-update operation like we do for map columns in db_set. Since
we read the values add a few keys, then overwrite the whole value,
it is important that we don't do that if we have stale data.
Since ovs 2.6, there has been a setkey() operation that would
allow modifying a map w/o overwriting the whole value, but there
is a bug where it doesn't handle maps that have a refTable value
like Qos.queues. So using that before it is fixed [1] and all
packages have picked it up would cause breakage.
[1] https:/ /patchwork. ozlabs. org/patch/ 1254735/
Closes-bug: #1867652 e9e169b9f5d6caa ace600abb0c
Change-Id: Ic898cefb4ced76