forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make CostTracker aware of inflight transactions (#437)
When a leader is packing a Bank, transactions costs are added to the CostTracker and then later updated or removed, depending on if the tx is committed. However, it is possible for a Bank to be frozen while there are several tx's in flight. CostUpdateService submits a metric with cost information almost immediately after a Bank has been frozen. The result is that we have observed cost details being submitted before some cost removals take place, which causes a massive over-reporting of the block cost compared to actual. This PR adds a field to track the number of transactions that are inflight, and adds a simple mechanism to try to allow that value to settle to zero before submitting the datapoint. The number of inflight tx's is submitted with the datapoint, so even if the value does not settle to zero, we can still detect this case and know the metric is tainted. Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com> (cherry picked from commit 9076348)
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
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
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
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