diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2023-01-03 17:22:36 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2023-01-18 13:54:42 +0100 |
commit | 7402dae8f463f9ca091efb69bb346bfa64c3935b (patch) | |
tree | 88d51ea5361e9167ee5fa80d046185a23c95fec3 /ovsdb | |
parent | b02356ebbf6b049bfbd8938bbeb6cdb717001797 (diff) | |
download | openvswitch-7402dae8f463f9ca091efb69bb346bfa64c3935b.tar.gz |
ovsdb: Fix database statistics during the database replacement.
The counter for the number of atoms has to be re-set to the number from
the new database, otherwise the value will be incorrect. For example,
this is causing the atom counter doubling after online conversion of
a clustered database.
Miscounting may also lead to increased memory consumption by the
transaction history or otherwise too aggressive transaction history
sweep.
Fixes: 317b1bfd7dd3 ("ovsdb: Don't let transaction history grow larger than the database.")
Acked-by: Han Zhou <hzhou@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ovsdb')
-rw-r--r-- | ovsdb/ovsdb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c index 11786f376..afec96264 100644 --- a/ovsdb/ovsdb.c +++ b/ovsdb/ovsdb.c @@ -715,5 +715,8 @@ ovsdb_replace(struct ovsdb *dst, struct ovsdb *src) dst->rbac_role = ovsdb_get_table(dst, "RBAC_Role"); + /* Get statistics from the new database. */ + dst->n_atoms = src->n_atoms; + ovsdb_destroy(src); } |