Skip to content

Commit 1bdf161

Browse files
committed
docs: clarify GetCommitIndex behavior in CommitTrackingLogStore interface
- Specify that GetCommitIndex should not return a value higher than the last index in the log - Clarify that if a higher value is returned, the last index in the log will be used instead - Add instruction to return (0, nil) when no commit index is found in the log store
1 parent 8d11a28 commit 1bdf161

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

log.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ type CommitTrackingLogStore interface {
212212

213213
// GetCommitIndex returns the latest persisted commit index from the latest log entry
214214
// in the store at startup.
215-
// It is ok to return a value higher than the last index in the log (But it should never happen).
215+
//
216+
// GetCommitIndex should not return a value higher than the last index in the log.
217+
// If that happens, the last index in the log will be used.
218+
//
219+
// When no commit index is found in the log store, return (0, nil).
216220
GetCommitIndex() (uint64, error)
217221
}

0 commit comments

Comments
 (0)