Open bjurr opened 2 years ago
Currently we use R1 ephemerals which default to an idle cleanup of 5s IIRC.
My thought here would be to allow this to be configurable for downstream streams when configuring a mirror or source.
has this been reolved
No extended outages of the leafnode connection could cause issues since the message may be deleted locally if interest policy based.
This appears to be an issue I am facing as well. Please investigate with network latency and jitter.
Facing the same issue here
Is there a way to keep messages in the stream of a leafnode even when lost connection with remote nats-server?
Is there a way to keep messages in the stream of a leafnode even when lost connection with remote nats-server?
Yes: use a limit (rather than work queue or interest) stream to source from, e.g. set a 'max age' limit that is as long as the longest network outage that you want to be able to recover from.
Defect
When a leaf node has a stream configured with work queue policy and this stream is aggregated on a remote stream, there is a chance messages will be silently dropped if a network outage occurs between the leaf node and the cluster (especially obvious using wifi).
Versions of
nats-server
and affected client libraries used:nats-server
: 2.8.4natscli
: 0.0.33OS/Container environment:
Server:
Client/Leaf node:
Steps or code to reproduce the issue:
Testing this is a somewhat lengthy manual process.
On a separate computer, launch a leaf node with JetStream enabled using the following sample configuration (save as nats-leaf.config):
From the same computer running the leaf node, publish a test message and confirm that the message has been synchronized on the remote stream:
Simulate network outage. This is best done using a wifi enabled computer. Assuming the computer running the leaf node and publisher is connected on wifi, shut off wifi, and quickly publish a new message and confirm message is NOT persisted in the stream:
After some time (up to about 30 seconds), the leaf node will start printing error messages ([ERR] Error trying to connect as leafnode to remote server). At that point, publish a new message and confirm that the message has been persisted in the stream:
Reconnect wifi, wait for connectivity, verify that the persisted message is synchronized on the remote stream but notice the total message count=2 (when it should be 3):
Expected result:
Messages should be persisted on the leaf node stream when the remote stream is not reachable.
Actual result:
Messages destined for the leaf node stream are dropped until the leaf node realize it is disconnected from the cluster. Only at that point will messages start being persisted in the stream.