sstables: properly keep track of max local deletion time
We weren't updating max local deletion time for cells that contain ttl, or for tombstone cells. If there is a live cell with no ttl, then max local deletion time is supposed to store maximum value, which means that the sstable will not be fully expired later on. Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
@@ -1124,6 +1124,7 @@ void sstable::write_cell(file_writer& out, atomic_cell_view cell) {
|
||||
uint32_t deletion_time_size = sizeof(uint32_t);
|
||||
uint32_t deletion_time = cell.deletion_time().time_since_epoch().count();
|
||||
|
||||
_c_stats.update_max_local_deletion_time(deletion_time);
|
||||
_c_stats.tombstone_histogram.update(deletion_time);
|
||||
|
||||
write(out, mask, timestamp, deletion_time_size, deletion_time);
|
||||
@@ -1135,6 +1136,8 @@ void sstable::write_cell(file_writer& out, atomic_cell_view cell) {
|
||||
uint32_t expiration = cell.expiry().time_since_epoch().count();
|
||||
disk_string_view<uint32_t> cell_value { cell.value() };
|
||||
|
||||
_c_stats.update_max_local_deletion_time(expiration);
|
||||
|
||||
write(out, mask, ttl, expiration, timestamp, cell_value);
|
||||
} else {
|
||||
// regular cell
|
||||
@@ -1142,6 +1145,8 @@ void sstable::write_cell(file_writer& out, atomic_cell_view cell) {
|
||||
column_mask mask = column_mask::none;
|
||||
disk_string_view<uint32_t> cell_value { cell.value() };
|
||||
|
||||
_c_stats.update_max_local_deletion_time(std::numeric_limits<int>::max());
|
||||
|
||||
write(out, mask, timestamp, cell_value);
|
||||
}
|
||||
}
|
||||
@@ -1202,6 +1207,7 @@ void sstable::write_range_tombstone(file_writer& out,
|
||||
uint32_t deletion_time = t.deletion_time.time_since_epoch().count();
|
||||
|
||||
update_cell_stats(_c_stats, timestamp);
|
||||
_c_stats.update_max_local_deletion_time(deletion_time);
|
||||
_c_stats.tombstone_histogram.update(deletion_time);
|
||||
|
||||
write(out, deletion_time, timestamp);
|
||||
|
||||
Reference in New Issue
Block a user