-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure backpressure's task is executed last (fixes #124)
In most workloads writes are relatively rare and spaced apart. The write buffer is a handoff between the writer and the async maintenance task being triggered. That buffer may grow to a limit, at which point the cache forces backpressure to cope with the high write rate. In this case the writer blocks and tries to help out by performing the maintenace work. In the above case the writer's task could not be scheduled, so when it performs the clean-up it must also run its pending task. Previously this was done prior to the buffers being drained, as order shouldn't matter. But in a unit test a user could observe a premature eviction, because the last addition was pushed to the front of the admission window. This fix now keeps the writer's task at the tail, so the writer won't evict the entry early. That won't have much of a real-world impact, but does play nicer in unit tests.
- Loading branch information
Showing
3 changed files
with
24 additions
and
17 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