From 73808c12ebf8684e0151ee4dbd2eff63bf6a5b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Mon, 18 Jan 2021 13:59:24 +0200 Subject: [PATCH] mutation compactor: query compaction: ignore purgeable tombstones This behaviour is makes query result building sensitive to whether the data was recently compacted or not, in particular different digests will be produced depending on whether purgeable tombstones happened to be compacted (and thus purged) or not. This means that two replicas can produce different digests for the same data if has compacted some purgeable tombstones and the other not. To avoid this, drop purgeable tombstones during query compaction as well. --- mutation_compactor.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mutation_compactor.hh b/mutation_compactor.hh index fd7a662226..d284e649b4 100644 --- a/mutation_compactor.hh +++ b/mutation_compactor.hh @@ -291,6 +291,10 @@ public: // We are passing only dead (purged) data so pass is_live=false. gc_consumer.consume(std::move(sr_garbage), current_tombstone, false); }); + } else { + if (can_purge_tombstone(current_tombstone)) { + current_tombstone = {}; + } } _static_row_live = is_live; if (is_live || (!only_live() && !sr.empty())) { @@ -333,6 +337,10 @@ public: // We are passing only dead (purged) data so pass is_live=false. gc_consumer.consume(std::move(cr_garbage), t, false); }); + } else { + if (can_purge_tombstone(t)) { + t = {}; + } } if (only_live() && is_live) {