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
  • Loading branch information
bhalevy committed Aug 15, 2023
1 parent 84d593a commit 2b5385d
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 @@ -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 2b5385d

Please sign in to comment.