mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 20:46:56 +00:00
drain suffers from the same problem as startup suffers now: memtables are flushed as part of the drain routine, and because there are no incoming writes the shares the controller assign to flushes go down over time, slowing down the process of drain. This patch reorders things so that we stop compactions first, and flush later. It guarantees that when flush do happen it will have the full bandwidth to work with. There is a comment in the code saying we should stop compactions forcefully instead of waiting for them to finish. I consider this orthogonal to this patch therefore I am not touching this. Doing so will make the drain operation even faster but can be done later. Even when we do it, having the flushes proceed alone instead of during compactions will make it faster. Signed-off-by: Glauber Costa <glauber@scylladb.com>