-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat(consensus): dag state to evict blocks based on gc round #5671
Draft
VorobyevIlya
wants to merge
9
commits into
consensus/feat/garbage-collector-2
Choose a base branch
from
consensus/feat/DagState-to-evict-blocks-based-on-GC-round
base: consensus/feat/garbage-collector-2
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.
Draft
feat(consensus): dag state to evict blocks based on gc round #5671
VorobyevIlya
wants to merge
9
commits into
consensus/feat/garbage-collector-2
from
consensus/feat/DagState-to-evict-blocks-based-on-GC-round
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
…votes from old blocks before gc_round
…t least CASHED_ROUNDS last rounds
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Skipped Deployments
|
e3ac97a
to
141c7f4
Compare
141c7f4
to
d6e2744
Compare
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.
Porting upstream change: MystenLabs/sui@34416bf
Description of change
Currently we evict the cached ref entries in DagState whenever we
flush
. At this point we evict the entries for each authority bydropping all the blocks which are
<= evict_round
, whereevict_round = authority_latest_commit_round - CACHED_ROUNDS
. TheCACHED_ROUNDS
here allow us to keep around for a little longer committed blocks. Of
course all the blocks that are
> evict_round
are kept.This can work fine so far where we don't use GC , as we expect
eventually to include blocks from other peers as weak links - no matter
how far back they are - and that will move the
authority_latest_commit_round
and trigger the eviction of their blocksfrom our memory. Now with GC we don't have those guarantees. It is
possible to get to a scenario where even a group of slow nodes that are
constantly behind
gc_round
, they keep proposing but their blocks neverget committed. Although their blocks should not end up in others DAGs ,
they will remain in their own and fill up their memory. Overall, the
current approach will provide weaker guarantees.
This PR is changing the eviction strategy so it's driven by the
gc_round
. Doing though the eviction purely on thegc_round
willchange a lot the semantics of the
DagState
as one of the intentionswas to keep recent cached data from each authority. That would also be
particularly visible for authorities for which we do not have frequent
block proposals, as we could end up always evicting all their blocks if
they are behind the
gc_round
. Then this would not allow us to docertain operations we used to do before with cached data(ex get latest
cached block per authority).
For that reason this PR is changing a bit the semantics of the
CACHED_ROUNDS
and from now on it will be the minimum/desired amount ofrounds we want to keep in cache for each of authority. The eviction
algorithm will still attempt to clean up records that are
<= gc_round
,but it will also make sure that
CACHED_ROUNDS
worth of data are keptaround.
Especially for more edge case situation where a node has not produced
blocks
> gc_round
, we guarantee to keepCACHED_ROUNDS
even when allof them are
<= gc_round
, but we'll eventually evict anything before -practically like a moving window.
Links to any relevant issues
Fixes #5643
Type of change
Choose a type of change, and delete any options that are not relevant.
How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.
Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.