diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2022-08-20 01:08:10 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-08-30 22:44:26 +0200 |
commit | 975bd48a0027ba6241ba169b57a23ccf6b34415d (patch) | |
tree | 19e0eeed820893732e3cb1827ea9a931ad1a207e | |
parent | f68ae52392ddff704588e376b9d58d1ef5b7e49b (diff) | |
download | openvswitch-975bd48a0027ba6241ba169b57a23ccf6b34415d.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 3d8d549bf..163561e3d 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -4029,7 +4029,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++) { |