New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Off-strategy compaction leaks input sstables into "cleanup set" #14304
Comments
@bhalevy assigned this to you, but I can pick it up if you need help. |
thanks. looks like you got a firm handle on this issue, so feel free to send a fix |
Roger that. |
…ables_requiring_cleanup Move the management of compaction_state::sstables_requiring_cleanup from compacting_sstable_registration to on_compaction_completion so it will be performed for all compaction types, as those sstables were compacted and about to be deleted. Adjust cleanup_incremental_compaction_test to check that cleanup doesn't attempt to cleanup already-deleted sstables that were left over by offstrategy compaction in sstables_requiring_cleanup. Fixes scylladb#14304 Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
…ables_requiring_cleanup Move the management of compaction_state::sstables_requiring_cleanup from compacting_sstable_registration to on_compaction_completion so it will be performed for all compaction types, as those sstables were compacted and about to be deleted. Adjust cleanup_incremental_compaction_test to check that cleanup doesn't attempt to cleanup already-deleted sstables that were left over by offstrategy compaction in sstables_requiring_cleanup. Fixes scylladb#14304 Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
…ables_requiring_cleanup Erase retired sstable from compaction_state::sstables_requiring_cleanup also on_compaction_completion (in addition to compacting_sstable_registration::release_compacting for offstrategy compaction with piggybacked cleanup or any other compaction type that doesn't use compacting_sstable_registration. Add cleanup_during_offstrategy_incremental_compaction_test that is modeled after cleanup_incremental_compaction_test to check that cleanup doesn't attempt to cleanup already-deleted sstables that were left over by offstrategy compaction in sstables_requiring_cleanup. Fixes scylladb#14304 Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
…m Benny Halevy Currently `sstable_requiring_cleanup` is updated using `compacting_sstable_registration`, but that mechanism is not used by offstrategy compaction, leading to #14304. This series introduces `compaction_manager::on_compaction_completion` that intercepts the call to the table::on_compaction_completion. This allows us to update `sstable_requiring_cleanup` right before the compacted sstables are deleted, making sure they are no leaked to `sstable_requiring_cleanup`, which would hold a reference to them until cleanup attempts to clean them up. `cleanup_incremental_compaction_test` was adjusted to observe the sstables `on_delete` (by adding a new observer event) to detect the case where cleanup attempts to delete the leaked sstables and fails since they were already deleted from the file system by offstrategy compaction. The test fails with the fix and passes with it. Fixes #14304 Closes #14858 * github.com:scylladb/scylladb: compaction_manager: on_compaction_completion: erase sstables from sstables_requiring_cleanup compaction/leveled_compaction_strategy: ideal_level_for_input: special case max_sstable_size==0 sstable: add on_delete observer compaction_manager: add on_compaction_completion sstable_compaction_test: cleanup_incremental_compaction_test: verify sstables_requiring_cleanup is empty
|
…m Benny Halevy Currently `sstable_requiring_cleanup` is updated using `compacting_sstable_registration`, but that mechanism is not used by offstrategy compaction, leading to scylladb#14304. This series introduces `compaction_manager::on_compaction_completion` that intercepts the call to the table::on_compaction_completion. This allows us to update `sstable_requiring_cleanup` right before the compacted sstables are deleted, making sure they are no leaked to `sstable_requiring_cleanup`, which would hold a reference to them until cleanup attempts to clean them up. `cleanup_incremental_compaction_test` was adjusted to observe the sstables `on_delete` (by adding a new observer event) to detect the case where cleanup attempts to delete the leaked sstables and fails since they were already deleted from the file system by offstrategy compaction. The test fails with the fix and passes with it. \Fixes scylladb#14304 \Closes scylladb#14858 * github.com:scylladb/scylladb: compaction_manager: on_compaction_completion: erase sstables from sstables_requiring_cleanup compaction/leveled_compaction_strategy: ideal_level_for_input: special case max_sstable_size==0 sstable: add on_delete observer compaction_manager: add on_compaction_completion sstable_compaction_test: cleanup_incremental_compaction_test: verify sstables_requiring_cleanup is empty (cherry picked from commit 108e510)
…m Benny Halevy Currently `sstable_requiring_cleanup` is updated using `compacting_sstable_registration`, but that mechanism is not used by offstrategy compaction, leading to scylladb#14304. This series introduces `compaction_manager::on_compaction_completion` that intercepts the call to the table::on_compaction_completion. This allows us to update `sstable_requiring_cleanup` right before the compacted sstables are deleted, making sure they are no leaked to `sstable_requiring_cleanup`, which would hold a reference to them until cleanup attempts to clean them up. `cleanup_incremental_compaction_test` was adjusted to observe the sstables `on_delete` (by adding a new observer event) to detect the case where cleanup attempts to delete the leaked sstables and fails since they were already deleted from the file system by offstrategy compaction. The test fails with the fix and passes with it. \Fixes scylladb#14304 \Closes scylladb#14858 * github.com:scylladb/scylladb: compaction_manager: on_compaction_completion: erase sstables from sstables_requiring_cleanup compaction/leveled_compaction_strategy: ideal_level_for_input: special case max_sstable_size==0 sstable: add on_delete observer compaction_manager: add on_compaction_completion sstable_compaction_test: cleanup_incremental_compaction_test: verify sstables_requiring_cleanup is empty (cherry picked from commit 108e510)
…m Benny Halevy Currently `sstable_requiring_cleanup` is updated using `compacting_sstable_registration`, but that mechanism is not used by offstrategy compaction, leading to scylladb#14304. This series introduces `compaction_manager::on_compaction_completion` that intercepts the call to the table::on_compaction_completion. This allows us to update `sstable_requiring_cleanup` right before the compacted sstables are deleted, making sure they are no leaked to `sstable_requiring_cleanup`, which would hold a reference to them until cleanup attempts to clean them up. `cleanup_incremental_compaction_test` was adjusted to observe the sstables `on_delete` (by adding a new observer event) to detect the case where cleanup attempts to delete the leaked sstables and fails since they were already deleted from the file system by offstrategy compaction. The test fails with the fix and passes with it. \Fixes scylladb#14304 \Closes scylladb#14858 * github.com:scylladb/scylladb: compaction_manager: on_compaction_completion: erase sstables from sstables_requiring_cleanup compaction/leveled_compaction_strategy: ideal_level_for_input: special case max_sstable_size==0 sstable: add on_delete observer compaction_manager: add on_compaction_completion sstable_compaction_test: cleanup_incremental_compaction_test: verify sstables_requiring_cleanup is empty (cherry picked from commit 108e510)
Today, compaction manager has a cleanup set marking all sstables requiring cleanup. Maintenance sstables can be included in this set. Turns out off-strategy compaction is not removing input sstables on completion, so they are leaked, causing additional write amplification as cleanup may pick them afterwards, and space issues as the space of those sstables aren't released till next cleanup happens.
The text was updated successfully, but these errors were encountered: