-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snapshot: Prevent indefinite wait on compact sync.Cond in EFOS
Previously, the code inside maybeScheduleDelayedFlush could rotate the memtable by calling `makeRoomForWrite(nil)` but then end up not calling `maybeScheduleFlush`, resulting in an indefinite wait on the condition variable for compactions/flushes in `WaitForFileOnly` if no other writes were happening to schedule the flush. This change addresses that by adding the missing call to `maybeScheduleFlush`. Also update the case where we call maybeScheduleFlush() in WaitforFileOnlySnapshot() to mark the right memtable as flushForced=true to prevent us from needlessly waiting on the condition lock. Also add a context.Context in WaitForFileOnly() to allow callers to use context cancellation to avoid busy-waiting if necessary.
- Loading branch information
Showing
4 changed files
with
54 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters