From 16a0025dc3bedc32fa4aaa0f67e70bc2cdde91be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Mon, 12 Sep 2022 16:19:06 +0300 Subject: [PATCH] readers/mutation_readers: compacting_reader: remember injected partition-end Currently injecting a partition-end doesn't update `_last_uncompacted_kind`, which will allow for a subsequent `next_partition()` call to trigger injecting a partition-end, leading to an invalid mutation fragment stream (partition-end after partition-end). Fix by changing `_last_uncompacted_kind` to `partition_end` when injecting a partition-end, making subsequent injection attempts noop. Fixes: #11608 --- readers/mutation_readers.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/readers/mutation_readers.cc b/readers/mutation_readers.cc index 35ea870d7e..a6d11cd28a 100644 --- a/readers/mutation_readers.cc +++ b/readers/mutation_readers.cc @@ -1409,6 +1409,7 @@ private: if (_last_uncompacted_kind != mutation_fragment_v2::kind::partition_end) { _ignore_partition_end = true; _compactor.consume_end_of_partition(*this, _gc_consumer); + _last_uncompacted_kind = mutation_fragment_v2::kind::partition_end; _ignore_partition_end = false; } }