hubcio commented on code in PR #4194:
URL: https://github.com/apache/iggy/pull/4194#discussion_r4018081070
##########
core/consensus/src/impls.rs:
##########
@@ -1198,9 +1198,9 @@ where
timeouts: RefCell<TimeoutManager>,
- /// Monotonic timestamp from the most recent accepted commit heartbeat.
- /// Old/replayed commit messages with a lower timestamp are ignored.
- heartbeat_timestamp: Cell<u64>,
+ /// View and counter of the last emitted or accepted heartbeat. A new
+ /// primary's counter can be lower, so freshness is scoped to its view.
Review Comment:
max() on a lower counter either keeps the timer stale (bug stays) or
refreshes it on any heartbeat (replay guard gone)
we compare (view, counter), so a new view's first heartbeat always wins and
a lower counter inside one view is still a replay. Same as TigerBeetle, which
zeroes heartbeat_timestamp on every view transition and keeps the strict
compare in on_commit.
i'd leave it as is
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]