raft-sentinel-log-entry

Status: IN

The log is initialized with a sentinel `LogEntry(term=0, index=0)` at position 0 that is never removed, eliminating empty-log edge cases in `_last_log_index()` and `_last_log_term()`.

Source: entries/2026/05/29/raft-consensus-raft.md

Example

self._log = [LogEntry(term=0, index=0, command=None)]  # sentinel

JSON