-
Notifications
You must be signed in to change notification settings - Fork 22
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
Implement the Cached index using TVars #1197
Open
jasagredo
wants to merge
1
commit into
main
Choose a base branch
from
js/tvar-cache
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
jasagredo
requested review from
nfrisby,
amesgen,
fraser-iohk,
dnadales and
RenateEilers
as code owners
July 31, 2024 11:27
jasagredo
force-pushed
the
js/tvar-cache
branch
2 times, most recently
from
July 31, 2024 11:41
9f26a42
to
b822723
Compare
jasagredo
commented
Jul 31, 2024
...onsensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs
Outdated
Show resolved
Hide resolved
...onsensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs
Show resolved
Hide resolved
jasagredo
force-pushed
the
js/tvar-cache
branch
3 times, most recently
from
July 31, 2024 15:01
4c1408f
to
0533805
Compare
In the past some nodes have been crashing because of a misalingment in the data in the Cached Index. Ensuring that the changes are atomic via `stm` seems to solve the problem. In terms of logic, this PR only moves the modifications into `atomically` blocks, the overall logic is the same.
jasagredo
force-pushed
the
js/tvar-cache
branch
from
August 1, 2024 09:10
0533805
to
3a3bee6
Compare
jorisdral
reviewed
Aug 1, 2024
return $ Just $ Right pastChunkInfo | ||
| otherwise -> do | ||
((Just $ Right pastChunkInfo, TracePastChunkHit chunk nbPastChunks), cached') | ||
| otherwise -> | ||
-- Cache miss for an chunk in the past. We don't want to hold on to | ||
-- the 'cacheVar' MVar, blocking all other access to the cace, while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
-- the 'cacheVar' MVar, blocking all other access to the cace, while | |
-- the 'cacheVar' TVar, blocking all other access to the cace, while |
nfrisby
reviewed
Aug 21, 2024
@@ -409,13 +409,14 @@ newEnv hasFS registry tracer cacheConfig chunkInfo chunk = do | |||
-- Will expire past chunks that haven't been used for 'expireUnusedAfter' from | |||
-- the cache. | |||
expireUnusedChunks :: | |||
forall h m blk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary tyvar bindings?
12 tasks
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.
In the past some nodes have been crashing because of a misalingment in the data in the Cached Index. Ensuring that the changes are atomic via
stm
seems to solve the problem.In terms of logic, this PR only moves the modifications into
atomically
blocks, the overall logic is the same.Depends on #1196
Closes #359