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:43:46 +0200 |
commit | a32a4e1fa2d3fad284834d4b7bccc2e71d33f9da (patch) | |
tree | f243f45d5e36d3695149fbc4561408ea1c14c85c /ovsdb | |
parent | 1336eeb5705f7b4856731cb39d92faf1fb68bbbb (diff) | |
download | openvswitch-a32a4e1fa2d3fad284834d4b7bccc2e71d33f9da.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>
Diffstat (limited to 'ovsdb')
-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 b2c21e70f..b2361b173 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -4039,7 +4039,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++) { |