-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R1 memory stream configuration gets lost when nats-server is restarted [v2.10.20] #6207
Comments
the stream is stored in memory, restarting the server clears the memory so this is expected behaviour |
Would say this is at least inconsistent, so it might be classified as a bug still. If you run only one server and it's not clustered. Creating an in-memory stream and restarting the server also removes the stream. As indeed the stream is only in-memory. However, if you have a clustered setup. The in-memory stream is recreated on startup because the stream assignment was stored in the meta state. An in-memory stream staying for a clustered setup is more a side-effect of clustering. High-level this seems inconsistent though. Shouldn't we fix that? |
When clustered you would still lose all the data in the stream, to me it seems fine that clustered would retain the knowledge of the stream as we then get a reliable storage of the configuration which you simply dont have in 1 server mode. It's a sensible enhancement clustering brings. We have this in a fair few places of things that get persisted in raft that otherwise is never stored |
Meaning the R1 memory stream is the only stream that needs extra management code to detect its disappearance and re-create it as well as it's consumers. The downstream issue of a disappearing stream is that (at least the c pull consumer api) did not raise an error that would indicate loss of the backing stream. (I believe the consumer message won't be received without the stream being there.) An explicit not exist type error when consuming would have allowed the process creating the stream and consuming from it, to notice the issue and take action. I tried monitoring for the streams existence in another program and recreating it from there. Didn't go so well either. Probably because the consumer state in the app was from the previous incarnation and/or does not exist in the new stream. We now restart the consumer app whenever the nats server goes down. |
Observed behavior
R1 memory stream configuration gets lost when nats-server is restarted.
Expected behavior
My expectation would have been that the configuration of a memory stream is durable.
Meaning, that the data was in memory and ok to be lost, but instead the stream's config is gone too.
This now requires that loss of a memory stream is detected and needs recreating.
Server and client version
2.10.20
Host environment
No response
Steps to reproduce
The last stream info shows that the stream is not present anymore.
The text was updated successfully, but these errors were encountered: