sstables: update tombstone_histogram for cells with expiration time

That tombstone_histogram is used to determine droppable data ratio
for a sstable, and unlike C*, we were only updating it for
tombstones. We need to update it with expiration time of cells too,
if any. Creation time (expiration - ttl) cannot be used because if
ttl > gc_grace_seconds, the resulting sstable could be considered
worth dropping by tomstone compaction before any data is actually
expired.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
Raphael S. Carvalho
2016-12-28 15:27:21 -02:00
parent 08488a75e0
commit e224653d70

View File

@@ -1457,6 +1457,10 @@ void sstable::write_cell(file_writer& out, atomic_cell_view cell, const column_d
disk_string_view<uint32_t> cell_value { cell.value() };
_c_stats.update_max_local_deletion_time(expiration);
// tombstone histogram is updated with expiration time because if ttl is longer
// than gc_grace_seconds for all data, sstable will be considered fully expired
// when actually nothing is expired.
_c_stats.tombstone_histogram.update(expiration);
write(out, mask, ttl, expiration, timestamp, cell_value);
} else {