Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bloomstore): Keep synchronous state between cache and fs on entry eviction #11880

Closed
wants to merge 3 commits into from

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Feb 6, 2024

What this PR does / why we need it:

removeBlockDirectory is called by the cache when an item is evicted.

The cache entry is passed to this function. The function needs to evict/invalidate the entry synchronously, otherwise we could get a cache race condition where the item is already evicted from the cache, but the underlying directory isn't.

However, instead of removing the directory immediately, the function only renames it, so existing readers can still access the files. The actual cleanup of the directory happens asynchronously once the readers count is zero.

@chaudum chaudum force-pushed the chaudum/fetch-block-querier branch 2 times, most recently from a532a58 to e83e092 Compare February 6, 2024 20:15
@chaudum chaudum force-pushed the chaudum/make-evict-callback-synchronous branch from 7122524 to 0a05c39 Compare February 6, 2024 20:27
Base automatically changed from chaudum/fetch-block-querier to main February 6, 2024 20:58
@chaudum chaudum force-pushed the chaudum/make-evict-callback-synchronous branch from 0a05c39 to fcaddea Compare February 8, 2024 14:14
@chaudum chaudum force-pushed the chaudum/make-evict-callback-synchronous branch 2 times, most recently from 9abfe45 to 66e2e9f Compare February 19, 2024 16:19
@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 19, 2024
chaudum added 2 commits March 14, 2024 13:09
Signed-off-by: Christian Haudum <[email protected]>
@chaudum chaudum force-pushed the chaudum/make-evict-callback-synchronous branch 2 times, most recently from 53de5c3 to 114e6af Compare March 14, 2024 12:46
Signed-off-by: Christian Haudum <[email protected]>
@chaudum chaudum force-pushed the chaudum/make-evict-callback-synchronous branch from 114e6af to be54b1e Compare March 14, 2024 12:57
@chaudum chaudum changed the title Make block cache evict function synchronous fix(bloomstore): Make block cache evict function synchronous Mar 14, 2024
@chaudum chaudum changed the title fix(bloomstore): Make block cache evict function synchronous fix(bloomstore): Keep synchronous state between cache and fs on entry eviction Mar 14, 2024
@chaudum chaudum closed this Jun 21, 2024
@chaudum chaudum deleted the chaudum/make-evict-callback-synchronous branch June 21, 2024 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant