From e224653d706fd2616bb4d0e47f0eadd60bbd93ed Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Wed, 28 Dec 2016 15:27:21 -0200 Subject: [PATCH] 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 --- sstables/sstables.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sstables/sstables.cc b/sstables/sstables.cc index ae05012147..f1f62f9a52 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -1457,6 +1457,10 @@ void sstable::write_cell(file_writer& out, atomic_cell_view cell, const column_d disk_string_view 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 {