This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
fix: fix bugs for considering eviction in parallel and others #66
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.
get_data_from_cache
andput_data_to_cache
aren't atomic. Think about one thread executesget_data_from_cache
very early, and it is swapped out, another thread completeput_data_from_cache
for the same key, and this thread wakes up, try to executeput_data_from_cache
, it will poll from s3, update cache again, but there is no need. So I still want to use status_of_keys to track all the keys in the mem and disk replacer, and if it is completed, then threads can directly return, which is the most efficient way to handle it. So I fix bugs for these situations.TODO: when mem_replacer wants to evict A from mem to disk, is there any possibility that the status of A is incompleted? (Currently I just use continue to aviod eviction to disk and write to disk conflicts...)