Skip to content
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

nsqd: there seems to be a possibility that the message may be lost #1386

Closed
383317916 opened this issue Oct 22, 2021 · 2 comments
Closed

nsqd: there seems to be a possibility that the message may be lost #1386

383317916 opened this issue Oct 22, 2021 · 2 comments
Labels

Comments

@383317916
Copy link

I did an experiment. The producer sent a message to nsqd, and the consumer did not finish after receiving the message. Then close the terminal where nsqd is located. Restart nsqd again and the message will not be sent to the consumer, that is, it is lost.

It seems that when nsqd exits abnormally and persistmetadata is not executed, messages in inflight state will be lost.

version: nsqd v1.2.1-alpha (built w/go1.13)
command: command: /nsqd --lookupd-tcp-address="0.0.0.0:4160" --max-req-timeout=168h0m0s --broadcast-address=0.0.0.0 --data-path=/data/ --mem-queue-size=0

@ploxiln
Copy link
Member

ploxiln commented Oct 22, 2021

Yup, that's true. Messages in-flight are only in memory. nsqd must exit gracefully for them to be saved to disk and then retried after nsqd starts up again.

@ploxiln
Copy link
Member

ploxiln commented Oct 22, 2021

A "fix" for this would be something like: #625 (although that effort has stalled and is unlikely to resume).

The NSQ system is resilient against some types of failures, but not others. For example, it is resilient against crashing consumers. Also, messages continue to flow, even if any nsqd or nsqlookupd node disappears, through other nodes. These were trade-offs that made sense for the original creator and user of NSQ (in exchange for relative simplicity).

There is at least one fork with a very different feature set, see #887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants