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 replace leader's snapshot during shutdown #6053

Closed MauriceVanVeen closed 3 weeks ago

MauriceVanVeen commented 3 weeks ago

When a follower received a snapshot from the leader and then restarts (before it can complete the catchup), it overwrites the leader's snapshot with its own. Resulting in a desynced stream, since it doesn't retry catchup.

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

derekcollison commented 3 weeks ago

Let me know when you move off of draft.

MauriceVanVeen commented 3 weeks ago

@derekcollison, marked ready for review.

As a heads up, TestJetStreamClusterDeleteConsumerWhileServerDown was failing and changing n.observer to n.paused in the condition fixed it. Not sure if it's still LGTM under that change?