Skip to content

Commit

Permalink
compaction_manager: run_offstrategy_compaction: retrieve owned_ranges…
Browse files Browse the repository at this point in the history
… from compaction_state

perform_offstrategy is called from try_perform_cleanup
when there are sstables in the maintenance set that require
cleanup.

The input sstables are inserted into the compaction_state
`sstables_requiring_cleanup` and `try_perform_cleanup`
expects offstrategy compaction to clean them up along
with reshape compaction.

Otherwise, the maintenance sstables that require cleanup
are not cleaned up by cleanup compaction, since
the reshape output sstable(s) are not analyzed again
after reshape compaction, where that would insert
the output sstable(s) into `sstables_requiring_cleanup`
and trigger their cleanup in the subsequent cleanup compaction.

The latter method is viable too, but it is less effficient
since we can do reshape+cleanup in one pass, vs.
reshape first and cleanup later.

Fixes #15041

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

Closes #15043
  • Loading branch information
bhalevy authored and avikivity committed Aug 14, 2023
1 parent 1937a5c commit 9f77a32
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compaction/compaction_manager.cc
Expand Up @@ -1308,6 +1308,7 @@ class offstrategy_compaction_task_executor : public compaction_task_executor, pu
new_unused_sstables.insert(sst);
return sst;
};
desc->owned_ranges = _compaction_state.owned_ranges_ptr;
auto input = boost::copy_range<std::unordered_set<sstables::shared_sstable>>(desc->sstables);

sstables::compaction_result ret;
Expand Down

0 comments on commit 9f77a32

Please sign in to comment.