Repository navigation
journal: name why a cached timeout vote was dropped - #267
Merged
Merged
Conversation
'stale or invalid' merged two cases with opposite meanings: a vote older than the round window (normal -- the journal keeps hours of history and is compacted only on replay) and a vote the caller rejected (a defect). A restart on a healthy chain therefore printed a number nobody could read; 09.11.2026 the four production nodes restored 215 of 1862 votes and the single total could not say which case that was. replay() now counts the window drops separately (replay_result::aged) and the start-up line splits the total. Tests cover both halves: a rejected vote leaves aged at 0, a window drop sets it to 1. Syntax-checked as a single TU on host; image build follows on the PR.
A line cut short by a crash mid-write is also unparsable, and counting it as 'rejected' would point an incident reader at a key mismatch that does not exist. Say 'rejected or unparsable' and spell the crash case out in the comment.
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 start-up line
Timeout vote journal: restored N of M cached votes (<k> stale or invalid)merged two cases with opposite meanings:MAX_VOTE_ROUND_BEHIND = 3600 / block_interval()= 1 h on a 1-second block). Normal: the journal is compacted only on replay, so the file keeps hours of history.Measured 09.11.2026 on the four production nodes after the 08.11 redeploy: 215 of 1862 votes restored (11.5 %), spread 180× between nodes (0.2 %…36.5 %). That spread is a function of how long the file had been accumulating, and the single total could not say whether a node was ageing votes or rejecting them.
Change
timeout_vote_journal::replay_resultgainsaged(subset ofdropped, cut bymin_roundbefore the signature check), and the start-up line splits the total:Tests:
test_timeout_vote_journal.pyassertsaged == 0for a rejected vote andaged == 1for a window drop, so the split is measured in both directions.tools/qc-bench/tc-stale-replay.py(viz-tools423d830) now tolerates the longer tail; without it the acceptance harness would have gone blind on every new log.Verification
tests/chain/test_timeout_vote_journal.py— green, incl.--selftest.-fsyntax-onlyoflibraries/chain/database.cppon host (nice/ionice), 0 errors.Live proof of the split appears in the first restart line after this change is deployed; until then "this is the window, not a defect" rests on the code plus the consistency of the numbers.
🤖 Generated with Claude Code