mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-08 16:03:20 +00:00
sstables: compaction/scrub: prevent infinite loop when last partition end is missing
Scrub compaction will add the missing last partition-end in a stream when allowed to modify the stream. This however can cause an infinite loop: 1) user calls fill_buffer() 2) process fragments until underlying is at EOS 3) add missing partition end 4) set EOS 5) user sees that last buffer wasn't empty 6) calls fill_buffer() again 7) goto (3) To prevent this cycle, break out of `fill_buffer()` early when both the scrub reader and the underlying is at EOS.
This commit is contained in:
@@ -1277,6 +1277,9 @@ class scrub_compaction final : public regular_compaction {
|
||||
, _validator(*_schema)
|
||||
{ }
|
||||
virtual future<> fill_buffer(db::timeout_clock::time_point timeout) override {
|
||||
if (_end_of_stream) {
|
||||
return make_ready_future<>();
|
||||
}
|
||||
return repeat([this, timeout] {
|
||||
return _reader.fill_buffer(timeout).then([this] {
|
||||
fill_buffer_from_underlying();
|
||||
|
||||
Reference in New Issue
Block a user