Repository navigation
fix(storage): reclaim when a flusher waits for a clean block - #1374
Open
tonyalaribe wants to merge 1 commit into
Open
tonyalaribe wants to merge 1 commit into
tonyalaribe wants to merge 1 commit into
Conversation
A block device recovered with no clean block never wrote again: reclaim only runs after taking a clean block or finishing a write or reclaim, so get_clean_block parked every flusher forever. Start a reclaim when a waiter registers, and once after recovery.
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Start a reclaim when
get_clean_blockhas to park a waiter, and once at the end ofBlockManager::init. Previously reclaim ran only after taking a clean block or finishing a write or reclaim. A device recovered with 0 clean blocks therefore parked every flusher forever and never wrote again.on_reclaim_finishalready hands the reclaimed block to a waiting flusher, andreclaim_if_neededstill respectsclean_block_thresholdand reclaim concurrency.Add
test_store_write_after_recovery_without_clean_block. It overwrites every block file with a block that holds data, reopens the store, enqueues an entry, and boundswait()with a 10 s timeout. This needs tokio'stimefeature in dev-dependencies.Validation:
Elapsedwithout the fix and passes with it.cargo test -p foyer-storage: 29 lib tests passed.cargo fmtclean.Fixes #1373.