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

Queue sub may not receive message in leafnode daisy-chain and gateway setups #6125

Closed kozlovic closed 1 week ago

kozlovic commented 1 week ago

Observed behavior

In the following setup:

Cluster A --leaf connection--> Cluster B --leaf connection--> Cluster C --gateway connection--> Cluster D

If there are queue subscribers on "foo" for queue "queue" attached to "Cluster A" and "Cluster D", and a message is published on "Cluster B", the message will be delivered to one of the queue subscriber on "Cluster A" but sometimes, none of the queue subscriber on "Cluster A" will receive it, and "Cluster D" queue subscribers never receive any message.

Expected behavior

Since there is a queue subscription interest in both "Cluster A" and "Cluster D", message should either go to "A" or "D" but not be dropped.

Server and client version

Latest versions.

Host environment

n/a

Steps to reproduce

Create the setup described above and publish message and notice that sometimes a message does not make it to the queue subs.