mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 13:37:04 +00:00
When the multishard reader is destroyed there might be severeal pending read-aheads running in the background. These read-aheads need their associated reader to stay alive until after the read-ahead completes. To solve this move the flat_mutation_reader into a struct and manage this struct's lifetime through a shared pointer. Fibers associated with read-aheads that might outlive the multishard reader will hold on to a copy of the shard pointer keeping the underlying reader alive until they complete. To avoid doing any extra work a flag is added to this state which is set when the multishard reader is destroyed. When this flag is set, pending continuations will return early. All this is encapsulated in multishard_combining_reader::shard_reader the multishard reader code itself need not be changed.
51 KiB
51 KiB