Skip to content

Count lane blocks and CommitQCs asked for append and made durable (CON-468) - #4422

Merged
wen-coding merged 2 commits into
mainfrom
wen/add-persist-metrics
Oct 2, 2026
Merged

wen-coding merged 2 commits into
mainfrom
wen/add-persist-metrics

Conversation

@wen-coding

Copy link
Copy Markdown
Contributor

Summary

  • Count lane-block and CommitQC records on tendermint_internal_autobahn_consensus_persist_records, labeled by wal (blocks or commitqcs) and stage (asked or persisted).
  • asked moves when a record is submitted for append, after a duplicate or gap is rejected. persisted moves only after the flush that covers those records succeeds, so a failed flush stays visible as asked − persisted.
  • Truncation is not a separate counter. A prune failure already stops the persist loop, and PruneBefore only reports that the request was queued.

Test plan

  • TestPersistRecordCounters writes a two-record batch for each WAL, then checks that an out-of-sequence block, a CommitQC gap, and a duplicate leave both counters unchanged.
  • scripts/ramtest.sh ./sei-tendermint/internal/autobahn/consensus/persist/ -count=1 -run TestPersistRecordCounters

Made with Cursor

A failed flush leaves those records on the asked side. Prune failures already stop the persist loop, so truncation is not a separate counter.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedOct 2, 2026, 12:44 AM

@seidroid seidroid Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Adds a tendermint_internal_autobahn_consensus_persist_records{wal,stage} counter. It counts lane blocks and CommitQCs when they are submitted for append (asked) and again once a successful flush makes them durable (persisted). I approve: the counters sit after the sequence and duplicate checks and before the flush, which is the behaviour described, any persist error stops runPersist, so a leftover appended count never leaks into a later flush, and nothing feeds consensus state; the reviewed tree was the PR merge ref at 6a8e3a2, Go was not available so nothing was built or run, and the one other reading (codex, no findings) contributed nothing to keep or drop, though it matches my verdict.

Non-blocking

  • TestPersistRecordCounters only covers the rejected-before-append and happy paths. Nothing tests the case the metric exists to expose: an Append or Flush failure that leaves persisted behind asked. A fault-injecting WAL test would stop a later change from moving addRecords(..., stagePersisted, ...) ahead of the flush-error check without anyone noticing.

seidroid review · decision approve · session 40cce95f155440b3a971966a0e7c7274 · turn resp_claude_ccc51c663e31054d75a0cee8ec3f7757 · item e66997cb6b8053aeb2a3bdac3d5a9c5d

Findings: 0 blocking | 1 non-blocking | 0 posted inline

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 55.69%. Comparing base (4c4d935) to head (62dd667).

Files with missing lines Patch % Lines
...int/internal/autobahn/consensus/persist/metrics.go 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4422      +/-   ##
==========================================
+ Coverage   55.68%   55.69%   +0.01%     
==========================================
  Files        2177     2179       +2     
  Lines      169048   169070      +22     
==========================================
+ Hits        94130    94170      +40     
+ Misses      74913    74895      -18     
  Partials        5        5              
Flag Coverage Δ
sei-chain 53.85% <95.45%> (+0.01%) ⬆️
sei-db 74.81% <ø> (ø)
sei-db-state-db 78.59% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...mint/internal/autobahn/consensus/persist/blocks.go 79.45% <100.00%> (+0.57%) ⬆️
...t/internal/autobahn/consensus/persist/commitqcs.go 83.11% <100.00%> (+0.92%) ⬆️
...internal/autobahn/consensus/persist/metrics.gen.go 100.00% <100.00%> (ø)
...int/internal/autobahn/consensus/persist/metrics.go 66.66% <66.66%> (ø)

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

records prometheus.CounterIntVec `metrics_labels:"wal,stage"`
}

func addRecords(wal, stage string, n uint64) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit - would it make sense to say addMetricsRecords just b/c it can be confused with some sort of consensus records

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, done

…cord.

Co-authored-by: Cursor <cursoragent@cursor.com>
@wen-coding
wen-coding enabled auto-merge October 2, 2026 00:43
@wen-coding
wen-coding added this pull request to the merge queue Oct 2, 2026
Merged via the queue into main with commit 7e5857e Oct 2, 2026
57 checks passed
@wen-coding
wen-coding deleted the wen/add-persist-metrics branch October 2, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants