Leaf-node JetStream retention policy for hub-sourced streams #4694
-
It is not very clear from documentation how retention works for leaf-node JetStreams. We have a leaf-node with JetStream S1 used for reliably replicate messages to a hub-node JetStream SS1, where the latter is sourced from the former leaf-node JetStream S1. However, once a message is replicated from the leaf-node JS S1 to to the hub-node JS SS1, we do not need to store the message on the leaf node (whether in memory or in a file). So the questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The consumer connection that exists between sources and mirrors is ephemeral, and so could lead to inconsistent results if the leafnode stream would be interest based policy. We do have a few folks who use WQ semantics, but there have been reports during long network outages of messages not being properly cleaned up. We plan to do some more work here for 2.11 and beyond. For now I would recommend using age limits for the stream on the leafnode that encompasses the longest outage you could expect for a network event. Note you can use multiple limits, so setting max bytes is recommended as well such that the leafnode stream does not run away with disk and or memory usage. |
Beta Was this translation helpful? Give feedback.
The age limit should be your maximum outage window allowance.