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

moves shreds deduper to shred-sigverify stage #30786

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

behzadnouri
Copy link
Contributor

@behzadnouri behzadnouri commented Mar 18, 2023

Problem

Shreds arriving at tvu/tvu_forward/repair sockets are each processed in
a separate thread, and since each thread has its own deduper, the
duplicates across these sockets are not filtered out.
Using a common deduper across these threads will require an RwLock
wrapper and may introduce lock contention.

Summary of Changes

The commit instead moves the shred-deduper to shred-sigverify-stage
where all these shreds arrive through the same channel.

behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 18, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that:
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 18, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 18, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
If turbine_disabled is true, the commit discards turbine packets
earlier in the pipeline so that they won't interfere with the deduper
and the packets can get through once turbine is enabled again.

This is a pre-requisite of:
solana-labs#30786
so that local-cluster tests pass.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
If turbine_disabled is true, the commit discards turbine packets
earlier in the pipeline so that they won't interfere with the deduper
and the packets can get through once turbine is enabled again.

This is a prerequisite of:
solana-labs#30786
so that local-cluster tests pass.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
If turbine_disabled is true, the commit discards turbine packets
earlier in the pipeline so that they won't interfere with the deduper
and the packets can get through once turbine is enabled again.

This is a prerequisite of:
solana-labs#30786
so that local-cluster tests pass.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 20, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit that referenced this pull request Mar 20, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
#30786
can use the same thread-pool for shred deduplication.
behzadnouri added a commit that referenced this pull request Mar 20, 2023
If turbine_disabled is true, the commit discards turbine packets
earlier in the pipeline so that they won't interfere with the deduper
and the packets can get through once turbine is enabled again.

This is a prerequisite of:
#30786
so that local-cluster tests pass.
@behzadnouri behzadnouri force-pushed the mv-shred-deduper branch 2 times, most recently from 1e9a73c to 92f2d3b Compare March 20, 2023 21:34
@behzadnouri behzadnouri changed the title moves shred-fetch deduper to shred-sigverify stage moves shreds deduper to shred-sigverify stage Mar 20, 2023
Shreds arriving at tvu/tvu_forward/repair sockets are each processed in
a separate thread, and since each thread has its own deduper, the
duplicates across these sockets are not filtered out.
Using a common deduper across these threads will require an RwLock
wrapper and may introduce lock contention.
The commit instead moves the shred-deduper to shred-sigverify-stage
where all these shreds arrive through the same channel.
mergify bot pushed a commit that referenced this pull request Mar 21, 2023
Instead the thread-pool is passed explicitly from higher in the call
stack so that
#30786
can use the same thread-pool for shred deduplication.

(cherry picked from commit c6e7aaf)

# Conflicts:
#	core/src/sigverify_shreds.rs
#	ledger/src/sigverify_shreds.rs
mergify bot pushed a commit that referenced this pull request Mar 21, 2023
If turbine_disabled is true, the commit discards turbine packets
earlier in the pipeline so that they won't interfere with the deduper
and the packets can get through once turbine is enabled again.

This is a prerequisite of:
#30786
so that local-cluster tests pass.

(cherry picked from commit e66edeb)

# Conflicts:
#	core/src/shred_fetch_stage.rs
@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #30786 (bc280c3) into master (bc933c6) will increase coverage by 0.0%.
The diff coverage is 47.9%.

@@           Coverage Diff           @@
##           master   #30786   +/-   ##
=======================================
  Coverage    81.4%    81.4%           
=======================================
  Files         725      725           
  Lines      203596   203602    +6     
=======================================
+ Hits       165833   165866   +33     
+ Misses      37763    37736   -27     

mergify bot added a commit that referenced this pull request Mar 21, 2023
…t of #30787) (#30827)

* removes lazy-static thread-pool from sigverify-shreds (#30787)

Instead the thread-pool is passed explicitly from higher in the call
stack so that
#30786
can use the same thread-pool for shred deduplication.

(cherry picked from commit c6e7aaf)

# Conflicts:
#	core/src/sigverify_shreds.rs
#	ledger/src/sigverify_shreds.rs

* resolves mergify merge conflicts

---------

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
mergify bot added a commit that referenced this pull request Mar 21, 2023
…30799) (#30828)

* moves turbine-disabled check to shred-fetch-stage (#30799)

If turbine_disabled is true, the commit discards turbine packets
earlier in the pipeline so that they won't interfere with the deduper
and the packets can get through once turbine is enabled again.

This is a prerequisite of:
#30786
so that local-cluster tests pass.

(cherry picked from commit e66edeb)

# Conflicts:
#	core/src/shred_fetch_stage.rs

* resolves mergify merge conflicts

---------

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 21, 2023
…t of solana-labs#30787)

removes lazy-static thread-pool from sigverify-shreds solana-labs#30787

Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.

(cherry picked from commit c6e7aaf)
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 21, 2023
…t of solana-labs#30787)

removes lazy-static thread-pool from sigverify-shreds solana-labs#30787

Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.

(cherry picked from commit c6e7aaf)
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Mar 21, 2023
…t of solana-labs#30787)

removes lazy-static thread-pool from sigverify-shreds solana-labs#30787

Instead the thread-pool is passed explicitly from higher in the call
stack so that
solana-labs#30786
can use the same thread-pool for shred deduplication.

(cherry picked from commit c6e7aaf)
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

any concerns here wrt extra load on the shred sigverify channel? afaict we're going from up to one copy of the shred per source to all sanitized shreds going over that channel. should we consider introducing some load shedding?

@behzadnouri
Copy link
Contributor Author

any concerns here wrt extra load on the shred sigverify channel? afaict we're going from up to one copy of the shred per source to all sanitized shreds going over that channel. should we consider introducing some load shedding?

hmmm, that is not change compared to before.
Before duplicates were only marked as discard but they were still sent down the channel anyways:
https://github.com/solana-labs/solana/blob/d4a6e00ff/core/src/shred_fetch_stage.rs#L103-L123
So same number of packets are sent through the sigverify channel like before.

Copy link
Contributor

@jbiseda jbiseda left a comment

Choose a reason for hiding this comment

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

LGTM

@behzadnouri behzadnouri merged commit 25b7811 into solana-labs:master Mar 22, 2023
@behzadnouri behzadnouri deleted the mv-shred-deduper branch March 22, 2023 13:19
mergify bot pushed a commit that referenced this pull request Mar 22, 2023
Shreds arriving at tvu/tvu_forward/repair sockets are each processed in
a separate thread, and since each thread has its own deduper, the
duplicates across these sockets are not filtered out.
Using a common deduper across these threads will require an RwLock
wrapper and may introduce lock contention.
The commit instead moves the shred-deduper to shred-sigverify-stage
where all these shreds arrive through the same channel.

(cherry picked from commit 25b7811)

# Conflicts:
#	core/src/shred_fetch_stage.rs
#	core/src/sigverify_shreds.rs
mergify bot added a commit that referenced this pull request Mar 22, 2023
) (#30861)

* moves shreds deduper to shred-sigverify stage (#30786)

Shreds arriving at tvu/tvu_forward/repair sockets are each processed in
a separate thread, and since each thread has its own deduper, the
duplicates across these sockets are not filtered out.
Using a common deduper across these threads will require an RwLock
wrapper and may introduce lock contention.
The commit instead moves the shred-deduper to shred-sigverify-stage
where all these shreds arrive through the same channel.

(cherry picked from commit 25b7811)

# Conflicts:
#	core/src/shred_fetch_stage.rs
#	core/src/sigverify_shreds.rs

* resolves mergify merge conflicts

---------

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants