speedb icon indicating copy to clipboard operation
speedb copied to clipboard

WBM: Fix stall deadlock with multiple cfs

Open Yuval-Ariel opened this issue 1 year ago • 0 comments

With a setting of multiple cfs and WriteBufferManager with allow_stall, the DB can enter a deadlock when the WBM initiates a stall. This happens since only the oldest cf is picked for flush when HandleWriteBufferManagerFlush is called to flush the data and prevent the stall. When using multiple CFs, this does not ensure the FreeMem will evict enough memory to prevent a stall and no other flush is scheduled.

To fix this, add cfs to the flush queue so that we'll be below the mutable_limit_.

closes #857

Yuval-Ariel avatar Apr 14 '24 13:04 Yuval-Ariel