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:27 +0200 |
commit | 93e88f39e18ac262ea07795b058347be6f356472 (patch) | |
tree | 76d86b3099312517109c881fd2e0eaf7257fa51f | |
parent | f1a14e9600ff81680e72befa0d34e5e1b932b3bf (diff) | |
download | openvswitch-93e88f39e18ac262ea07795b058347be6f356472.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 86d4e3e62..f08099683 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -3965,7 +3965,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++) { |