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 scylladb#15041

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

\Closes scylladb#15043

(cherry picked from commit 9f77a32)
  • Loading branch information
bhalevy committed Sep 19, 2023
1 parent 9b8a561 commit 172718f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compaction/compaction_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ class compaction_manager::offstrategy_compaction_task : public compaction_manage
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 172718f

Please sign in to comment.