Count lane blocks and CommitQCs asked for append and made durable (CON-468) - #4422
Conversation
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>
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
There was a problem hiding this comment.
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
TestPersistRecordCountersonly covers the rejected-before-append and happy paths. Nothing tests the case the metric exists to expose: an Append or Flush failure that leavespersistedbehindasked. A fault-injecting WAL test would stop a later change from movingaddRecords(..., 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 Report❌ Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| records prometheus.CounterIntVec `metrics_labels:"wal,stage"` | ||
| } | ||
|
|
||
| func addRecords(wal, stage string, n uint64) { |
There was a problem hiding this comment.
nit - would it make sense to say addMetricsRecords just b/c it can be confused with some sort of consensus records
…cord. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
tendermint_internal_autobahn_consensus_persist_records, labeled bywal(blocksorcommitqcs) andstage(askedorpersisted).askedmoves when a record is submitted for append, after a duplicate or gap is rejected.persistedmoves only after the flush that covers those records succeeds, so a failed flush stays visible asasked − persisted.PruneBeforeonly reports that the request was queued.Test plan
TestPersistRecordCounterswrites 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 TestPersistRecordCountersMade with Cursor