v3.1: turbine: Fix and cleanup redundant metric (backport of #9287)#9303
Merged
v3.1: turbine: Fix and cleanup redundant metric (backport of #9287)#9303
Conversation
The broadcast-process-shred-stats (and interrupted variant) have duplicate fields for the number of data and coding shred. This is probably a relic of when we rolled merkle shreds out. So, remove the duplicate fields. This also addresses a small issue where some shreds would be counted in metrics for the wrong slot when we have an interrupted slot (cherry picked from commit 89ead14)
t-nelson
approved these changes
Nov 26, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3.1 #9303 +/- ##
=========================================
- Coverage 83.2% 83.2% -0.1%
=========================================
Files 865 865
Lines 375625 375605 -20
=========================================
- Hits 312710 312634 -76
- Misses 62915 62971 +56 🚀 New features to boost your workflow:
|
AshwinSekar
approved these changes
Nov 26, 2025
This file contains hidden or 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
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.
Problem
The
broadcast-process-shreds-interrupted-statsandbroadcast-process-shreds-statsmetrics have duplicate fields for the number of shreds per slot (probably an artifact of when we rolled merkle shreds out):num_data_shreds&num_merkle_data_shredsnum_coding_shreds&num_merkle_coding_shredsAdditionally, there is currently a bug that will report the wrong values when a slot is interrupted. When the slot is interrupted, we call the below function to create a
LAST_IN_SLOTshred which will signal to the rest of the cluster that we're abandoning the block:agave/turbine/src/broadcast_stage/standard_broadcast_run.rs
Lines 208 to 212 in df2b614
In the function, we accumulate into the passed in
stats:agave/turbine/src/broadcast_stage/standard_broadcast_run.rs
Lines 77 to 102 in df2b614
but then report metrics on
self.process_shred_statswithout accumulating the just modifiedstats:agave/turbine/src/broadcast_stage/standard_broadcast_run.rs
Line 106 in df2b614
Instead, the
statsobject now has some counters updated for the interrupted slot that will get aggregated intoself.process_shred_stats(the next "active" slot) later on:agave/turbine/src/broadcast_stage/standard_broadcast_run.rs
Line 331 in df2b614
Assuming we generated
Sshreds in this function, this results in us under reporting the number of shreds for the interrupted slot bySand over reporting the number of shreds for the next slot bySSummary of Changes
self.process_shred_statswithinfinish_prev_slot()num_data_shreds; includingmerkleseemed redundant to me since all shreds are now of the Merkle variantThere is probably some more cleanup that could be done; ie, this feels unnecessary:
agave/turbine/src/broadcast_stage/standard_broadcast_run.rs
Lines 135 to 141 in df2b614
However, I decided to keep the PR slimmer to keep our options for BP open
This is an automatic backport of pull request #9287 done by Mergify.