nats-io / nats-streaming-server

NATS Streaming System Server
https://nats.io
Apache License 2.0
2.51k stars 284 forks source link

[FIXED] Recover channels even if server information not recovered #1267

Closed kozlovic closed 2 years ago

kozlovic commented 2 years ago

A user reported that the server.dat was missing, which means that the server did not recover channels (assuming that this was a fresh start, without any state). This caused issues later on since if an app publishes a message to an existing (non recovered) channel, then messages would be added to the channel but with a reset of the sequence.

The server will now warn of the situation, initialize the server state and then recover the rest of the state (channels, etc..)

Resolves #1263

Signed-off-by: Ivan Kozlovic ivan@synadia.com

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.03%) to 91.513% when pulling 10ef65d021b49338eaa9a8ef8dcb6ea67d717093 on fix_1263 into 7ceff6cb96eafd6eb1e474d098aa67d6e0cf108a on main.