From 8d4570866fc4e89e09243191aa7bcba8070e3c91 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 15 Oct 2024 18:06:00 -0400 Subject: [PATCH] Track LogNoop commit index --- raft.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/raft.go b/raft.go index cbc9a59a..e6183928 100644 --- a/raft.go +++ b/raft.go @@ -813,6 +813,12 @@ func (r *Raft) leaderLoop() { break } + // Update the Noop commit index so clients know the index + // at which leadership was conclusively established. + if commitLog.log.Type == LogNoop { + r.setNoopCommitindex(commitLog.log.Index) + } + // Measure the commit time metrics.MeasureSince([]string{"raft", "commitTime"}, commitLog.dispatch) groupReady = append(groupReady, e)