nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16k stars 1.41k forks source link

NRG: Do not set `pterm`/`pindex` if no snapshots and/or log entries #6060

Closed neilalexander closed 3 weeks ago

neilalexander commented 3 weeks ago

If we haven't recovered the pterm/pindex from a snapshot, and the WAL is empty, then we shouldn't tell other nodes that we have a log that we don't have (i.e. by vote request). Instead leave both pterm and pindex as zero to correctly signal that we don't know anything about the state of the log.

Signed-off-by: Neil Twigg neil@nats.io