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

SnapshotPackagerService pushes incremental snapshot hashes to CRDS #20442

Merged
merged 4 commits into from
Oct 8, 2021

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Oct 5, 2021

Now that CRDS supports incremental snapshot hashes,
SnapshotPackagerService needs to push 'em!

This commit does two main things:

  1. SnapshotPackagerService now knows about incremental snapshot hashes,
    and will push SnapshotPackage::IncrementalSnapshot hashes to CRDS.
  2. At startup, when loading from a full + incremental snapshot, the
    hashes need to be passed all the way to SnapshotPackagerService so it
    can push these starting hashes to CRDS. Those values have been piped
    through.

Fixes #20441 and #20423

@codecov
Copy link

codecov bot commented Oct 5, 2021

Codecov Report

Merging #20442 (225cc10) into master (1fcfbfc) will decrease coverage by 0.0%.
The diff coverage is 35.8%.

@@            Coverage Diff            @@
##           master   #20442     +/-   ##
=========================================
- Coverage    82.1%    82.1%   -0.1%     
=========================================
  Files         492      493      +1     
  Lines      137136   137206     +70     
=========================================
+ Hits       112676   112690     +14     
- Misses      24460    24516     +56     

@brooksprumo brooksprumo marked this pull request as ready for review October 6, 2021 20:52
gossip/src/cluster_info.rs Outdated Show resolved Hide resolved
wallclock: u64,
pub(crate) from: Pubkey,
pub(crate) base: (Slot, Hash),
pub(crate) hashes: Vec<(Slot, Hash)>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to break hashes struct into different indexes like we do when we have multiple votes, hence why we use an index in the gossip key for those votes:

Vote(VoteIndex, Pubkey),
.

This has the benefits that people can't push unbounded vectors and also if we update one hash, we don't have to rewrite the entire vector in gossip

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, I didn't know that was an option; I was following the precedent from SnapshotHashes.

@behzadnouri What do you think about changing the way IncrementalSnapshotHashes is in CRDS to be what @carllin suggested above?

@carllin Some additional info: this vec is at most 25 entries (but usually only 4, since 4 is the default number of incremental snapshot archives to retain), and it's pushed maximum once per incremental_snapshot_interval, which defaults to 100 slots, so not very often.

If Behzad OKs that change, I would prefer to break that out as a follow-on PR instead of doing that work within this PR. Does that work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has the benefits that people can't push unbounded vectors

They already cannot do it. After some point the value will not fit into a Packet and cannot be sent over push-messages or pull-reponses.
Each added crds value will have an overhead, so I think we are better to keep the current definition. The indexing is only useful when there is no way to use a single crds value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@behzadnouri makes sense, thanks!

Now that CRDS supports incremental snapshot hashes,
SnapshotPackagerService needs to push 'em!

This commit does two main things:

1. SnapshotPackagerService now knows about incremental snapshot hashes,
   and will push SnapshotPackage::IncrementalSnapshot hashes to CRDS.
2. At startup, when loading from a full + incremental snapshot, the
   hashes need to be passed all the way to SnapshotPackagerService so it
   can push these starting hashes to CRDS.  Those values have been piped
   through.

Fixes solana-labs#20441 and solana-labs#20423
@brooksprumo brooksprumo merged commit 5440c1d into solana-labs:master Oct 8, 2021
@brooksprumo brooksprumo deleted the sps1 branch October 8, 2021 20:15
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
…olana-labs#20442)

Now that CRDS supports incremental snapshot hashes,
SnapshotPackagerService needs to push 'em!

This commit does two main things:

1. SnapshotPackagerService now knows about incremental snapshot hashes,
   and will push SnapshotPackage::IncrementalSnapshot hashes to CRDS.
2. At startup, when loading from a full + incremental snapshot, the
   hashes need to be passed all the way to SnapshotPackagerService so it
   can push these starting hashes to CRDS.  Those values have been piped
   through.

Fixes solana-labs#20441 and solana-labs#20423
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants