forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compaction_manager: flush_all_tables before major compaction
Major compaction already flushes each table to make sure it considers any mutations that are present in the memtable for the purpose of tombstone purging. See 64ec1c6 However, compaction is unaware of mutations in the commitlog and due to sharing commitlog segments by different tables, it is possible the data or tombstones will get resurrected by commitlog replay in case the node restarts right after the respective data and tombstones are purged by (major) compaction after f42eb4d. This patch calls `database::flush_all_tables`, based on the `compaction_flush_all_tables_before_major_seconds` interval, before tables are compacted to ensure that any data in membtables is flushed to sstables, AND a new commitlog segment is forced so that major compaction would be able to purge tombstones more efficiently, without them being locked by live commitlog segments. Note that this requires flushing all tables (and their memtables) in each shard since they share the commitlog and an unflushed and unrelated table may hold a commitlog segment that stores mutations from another table that is about to get compacted. in the case that not all tables are flushed prior to major compaction, we revert to the old behavior of flushing each table in the keyspace before major-compacting it. Fixes scylladb#15777 Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
- Loading branch information
Showing
5 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters