compact_mutation: Don't count dead partitions

With this patch we stop counting dead partitions (i.e., partitions
containing only tombstones) towards the partition limit, which should
apply only to partitions with live rows.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
This commit is contained in:
Duarte Nunes
2016-08-01 16:28:36 +00:00
parent 0f902738f0
commit 167e400ca8

View File

@@ -231,7 +231,7 @@ public:
}
_row_limit -= _rows_in_current_partition;
_partition_limit -= 1;
_partition_limit -= _rows_in_current_partition > 0;
_consumer.consume_end_of_partition();
if (!sstable_compaction()) {
return _row_limit && _partition_limit ? stop_iteration::no : stop_iteration::yes;
@@ -253,4 +253,4 @@ struct compact_for_query : compact_mutation<only_live, compact_for_sstables::no,
template<typename CompactedMutationsConsumer>
struct compact_for_compaction : compact_mutation<emit_only_live_rows::no, compact_for_sstables::yes, CompactedMutationsConsumer> {
using compact_mutation<emit_only_live_rows::no, compact_for_sstables::yes, CompactedMutationsConsumer>::compact_mutation;
};
};