summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2022-08-20 01:08:10 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-08-30 22:44:27 +0200
commit1ee4e9d0840e661efd40158594192aa541a81788 (patch)
tree174e67eba238d2bcc9d2dc152a1d30de65fbad36
parent22170b2a9bb35fb93c606e5005fe8429daeca8d7 (diff)
downloadopenvswitch-1ee4e9d0840e661efd40158594192aa541a81788.tar.gz
raft: Fix unnecessary periodic compactions.
While creating a new database file and storing a new snapshot into it, raft module by mistake updates the base offset for the old file. So, the base offset of a new file remains zero. Then the old file is getting replaced with the new one, copying new offsets as well. In the end, after a full compaction, base offset is always zero. And any offset is twice as large as zero. That triggers a new compaction again at the earliest scheduled time. In practice this issue triggers compaction every 10-20 minutes regardless of the database load, after the first one is triggered by the actual file growth or by the 24h maximum limit. Fixes: 1b1d2e6daa56 ("ovsdb: Introduce experimental support for clustered databases.") Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-August/051977.html Reported-by: Oleksandr Mykhalskyi <oleksandr.mykhalskyi@netcracker.com> Acked-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--ovsdb/raft.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ovsdb/raft.c b/ovsdb/raft.c
index 0b6b9e298..9e8190293 100644
--- a/ovsdb/raft.c
+++ b/ovsdb/raft.c
@@ -3952,7 +3952,7 @@ raft_write_snapshot(struct raft *raft, struct ovsdb_log *log,
if (error) {
return error;
}
- ovsdb_log_mark_base(raft->log);
+ ovsdb_log_mark_base(log);
/* Write log records. */
for (uint64_t index = new_log_start; index < raft->log_end; index++) {