mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
compaction_manager: rewrite_sstables: acquire _maintenance_ops_sem once
Like all other maintenance operations, acquire the _maintenance_ops_sem once for the whole task, rather than for each sstable. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
@@ -791,6 +791,8 @@ future<> compaction_manager::rewrite_sstables(replica::table* t, sstables::compa
|
||||
cmlog.debug("{} task {} table={}: done", options.type(), fmt::ptr(task.get()), fmt::ptr(task->compacting_table));
|
||||
});
|
||||
|
||||
auto maintenance_permit = co_await seastar::get_units(_maintenance_ops_sem, 1);
|
||||
|
||||
auto rewrite_sstable = [this, &task, &options, &compacting, can_purge] (const sstables::shared_sstable& sst) mutable -> future<> {
|
||||
stop_iteration completed = stop_iteration::no;
|
||||
do {
|
||||
@@ -807,8 +809,6 @@ future<> compaction_manager::rewrite_sstables(replica::table* t, sstables::compa
|
||||
compacting.release_compacting(exhausted_sstables);
|
||||
};
|
||||
|
||||
auto maintenance_permit = co_await seastar::get_units(_maintenance_ops_sem, 1);
|
||||
|
||||
_stats.pending_tasks--;
|
||||
_stats.active_tasks++;
|
||||
task->setup_new_compaction(descriptor.run_identifier);
|
||||
|
||||
Reference in New Issue
Block a user