Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Cache tvu peers for broadcast #10373

Merged
merged 1 commit into from
Jun 3, 2020
Merged

Conversation

sakridge
Copy link
Contributor

@sakridge sakridge commented Jun 2, 2020

Problem

Broadcast get_peers taking 100s of ms on testnet which delays the broadcast and also creates more contention on the gossip lock so other things like votes cannot happen sooner.

Summary of Changes

Keep broadcast peers cached and update from 1 thread every second.

Fixes #

@sakridge sakridge requested a review from carllin June 2, 2020 20:30
@sakridge sakridge force-pushed the broadcast-opt branch 2 times, most recently from 74195dd to 5427afc Compare June 2, 2020 22:15
carllin
carllin previously approved these changes Jun 2, 2020
@mergify mergify bot dismissed carllin’s stale review June 2, 2020 22:47

Pull request has been modified.

@codecov
Copy link

codecov bot commented Jun 3, 2020

Codecov Report

Merging #10373 into master will decrease coverage by 0.0%.
The diff coverage is 87.5%.

@@            Coverage Diff            @@
##           master   #10373     +/-   ##
=========================================
- Coverage    81.3%    81.3%   -0.1%     
=========================================
  Files         288      288             
  Lines       67094    67172     +78     
=========================================
+ Hits        54590    54650     +60     
- Misses      12504    12522     +18     

@sakridge sakridge added the v1.2 label Jun 3, 2020
@sakridge sakridge merged commit 2cf719a into solana-labs:master Jun 3, 2020
@sakridge sakridge deleted the broadcast-opt branch June 3, 2020 15:24
mergify bot pushed a commit that referenced this pull request Jun 3, 2020
solana-grimes pushed a commit that referenced this pull request Jun 3, 2020
sakridge added a commit to sakridge/solana that referenced this pull request Jun 8, 2020
sakridge added a commit that referenced this pull request Jun 9, 2020
* Skip gossip requests with different shred version and split lock (#10240)


(cherry picked from commit 3f508b3)

* More cluster stats and add epoch stakes cache in retransmit stage (#10345)

* More cluster info metrics for push request/response counts

* Cache staked peers for the epoch

(cherry picked from commit ef37b82)

* Cache tvu peers for broadcast (#10373)


(cherry picked from commit 2cf719a)

* Add pull request count metrics (#10421)


(cherry picked from commit 3d2230f)
Comment on lines +314 to +317
&& self
.last_peer_update
.compare_and_swap(now, last, Ordering::Relaxed)
== last
Copy link
Contributor

Choose a reason for hiding this comment

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

ref: #18842

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants