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

[FIXED] Don't SendSnapshot on becoming consumer leader #6151

Closed MauriceVanVeen closed 1 day ago

MauriceVanVeen commented 1 day ago

We could have an empty apply queue length, but have stored uncommitted entries. If we then call SendSnapshot when becoming consumer leader we would be reverting back to previous state.

This was also an issue for meta leader changes, which was fixed in https://github.com/nats-io/nats-server/pull/5700. This PR fixes it for consumer leader changes.

Signed-off-by: Maurice van Veen github@mauricevanveen.com