From 9c7ff01c5d79968d36afa2e5adf0bb2f32a65152 Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Wed, 11 Nov 2020 19:15:13 -0300 Subject: [PATCH] compaction: Make sure a partition is filtered out only by producer If interposer consumer is enabled, partition filtering will be done by the consumer instead, but that's not possible because only the producer is able to skip to the next partition if the current one is filtered out, so scylla crashes when that happens with a bad function call in queue_reader. This is a regression which started here: 55a8b6e3c9 To fix this problem, let's make sure that partition filtering will only happen on the producer side. Fixes #7590. Signed-off-by: Raphael S. Carvalho Message-Id: <20201111221513.312283-1-raphaelsc@scylladb.com> (cherry picked from commit 13fa2bec4c11859b5140bf0e0c9ee0ebad91bfd7) --- sstables/compaction.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sstables/compaction.cc b/sstables/compaction.cc index 4a79006328..8eff060c0c 100644 --- a/sstables/compaction.cc +++ b/sstables/compaction.cc @@ -609,10 +609,12 @@ private: std::move(gc_consumer)); return seastar::async([cfc = std::move(cfc), reader = std::move(reader), this] () mutable { - reader.consume_in_thread(std::move(cfc), make_partition_filter(), db::no_timeout); + reader.consume_in_thread(std::move(cfc), db::no_timeout); }); }); - return consumer(make_sstable_reader()); + // producer will filter out a partition before it reaches the consumer(s) + auto producer = make_filtering_reader(make_sstable_reader(), make_partition_filter()); + return consumer(std::move(producer)); } virtual reader_consumer make_interposer_consumer(reader_consumer end_consumer) {