compaction: fix running compaction counter when splitting sstables

The counter was being increased before taking the semaphore, so
every pending split would count as a running compaction which
misleads the user as a result.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <f2050cc3599cee7af29d4579368a154708b37731.1481248048.git.raphaelsc@scylladb.com>
This commit is contained in:
Raphael S. Carvalho
2016-12-08 23:47:32 -02:00
committed by Avi Kivity
parent 872b5ef5f0
commit 732ee275f8

View File

@@ -243,8 +243,8 @@ void compaction_manager::submit_sstable_rewrite(column_family* cf, sstables::sha
_compacting_sstables.insert(sst);
auto task = make_lw_shared<compaction_manager::task>();
_tasks.push_back(task);
_stats.active_tasks++;
task->compaction_done = with_semaphore(sem, 1, [cf, sst] {
_stats.active_tasks++;
return cf->compact_sstables(sstables::compaction_descriptor(
std::vector<sstables::shared_sstable>{sst},
sst->get_sstable_level(),