mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 23:35:27 +00:00
ovsdb-idl: Track changes for table references.
If a change of a row is tracked, make sure the rows that reference this row are also added in tracked changes, unless change tracking is not required for those rows. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -2299,6 +2299,24 @@ ovsdb_idl_process_update2(struct ovsdb_idl_table *table,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Recursively add rows to tracked change lists for current row
|
||||||
|
* and the rows that reference this row. */
|
||||||
|
static void
|
||||||
|
add_tracked_change_for_references(struct ovsdb_idl_row *row)
|
||||||
|
{
|
||||||
|
if (ovs_list_is_empty(&row->track_node) &&
|
||||||
|
ovsdb_idl_track_is_set(row->table)) {
|
||||||
|
ovs_list_push_back(&row->table->track_list,
|
||||||
|
&row->track_node);
|
||||||
|
|
||||||
|
const struct ovsdb_idl_arc *arc;
|
||||||
|
LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) {
|
||||||
|
add_tracked_change_for_references(arc->src);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false
|
/* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*
|
*
|
||||||
@@ -2362,10 +2380,7 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json,
|
|||||||
= row->table->change_seqno[change]
|
= row->table->change_seqno[change]
|
||||||
= row->table->db->change_seqno + 1;
|
= row->table->db->change_seqno + 1;
|
||||||
if (table->modes[column_idx] & OVSDB_IDL_TRACK) {
|
if (table->modes[column_idx] & OVSDB_IDL_TRACK) {
|
||||||
if (ovs_list_is_empty(&row->track_node)) {
|
add_tracked_change_for_references(row);
|
||||||
ovs_list_push_back(&row->table->track_list,
|
|
||||||
&row->track_node);
|
|
||||||
}
|
|
||||||
if (!row->updated) {
|
if (!row->updated) {
|
||||||
row->updated = bitmap_allocate(class->n_columns);
|
row->updated = bitmap_allocate(class->n_columns);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user