Due to an error in transforming the above routine, readers who have <= a buffer worth of content are dropped without consuming them. This is due to the outer consume loop being conditioned on `is_end_of_stream()`, which will be set for readers that eagerly pre-fill their buffer and also have no more data then what is in their buffer. Change the condition to also check for `is_buffer_empty()` and only drop the reader if both of these are true. Fixes: #9594 Tests: unit(mutation_writer_test --repeat=200, dev) Signed-off-by: Botond Dénes <bdenes@scylladb.com> Message-Id: <20211108092923.104504-1-bdenes@scylladb.com>