ADR-60: JetStream reliable stream sourcing/mirroring on WQ/Interest streams#389
ADR-60: JetStream reliable stream sourcing/mirroring on WQ/Interest streams#389MauriceVanVeen wants to merge 1 commit intomainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@roeschter Please add comments inline using the review function, otherwise it's extremely difficult to thread and track replies to individual comments. |
roeschter
left a comment
There was a problem hiding this comment.
Missing specifications?
-Will the sourcing side verify that the consumer has the right AckPolicy of AckFlowControl?
-What will happen to sourcing from a workqueue is NOT consumer is set? WE shouldn't fail (compatibility), but should we at least print a warning
|
LGTM |
|
Opened a draft PR on the server with a working version for this. I'll update this ADR with some refinements soon. |
|
This ADR is now also updated to reflect the initial implemention. Requiring to specify |
f741e0a to
ed4847e
Compare
c381cc7 to
06e8ab3
Compare
ripienaar
left a comment
There was a problem hiding this comment.
LGTM, feels like we need a proper ok from @derekcollison also maybe?
06e8ab3 to
00aef99
Compare
00aef99 to
e7c3980
Compare
adr/ADR-58.md
Outdated
| and delivery sequence (`Nats-Last-Consumer`) as headers to signal which messages have been successfully stored. | ||
| - The server receiving the flow control response will ack messages based on these stream/delivery sequences. For | ||
| WorkQueue and Interest streams this may result in messages deletion. | ||
| - Acknowledgements happen based on flow control limits, usually a data window size. But if the stream is idle the |
There was a problem hiding this comment.
I vaguely remember there is a reasons for moving the ack floor. In the next section we talk about flow control ack being done according to window size. So this one is for very slow moevign streams?
But if the source/mirror is idle (low message rate) the Heartbeat will also trigger a flow control message to move the acknowledgement floor up even if the window size has not been reached.
There was a problem hiding this comment.
Indeed, if a stream receives small messages very slowly, it will not trigger the flow control messages often. So, if the stream hasn't received messages for Heartbeat amount of time, then a flow control message will also be sent. This ensures that a WorkQueue/Interest stream can remove messages after ack in such a slow/idle stream case.
|
Updated the ADR to include a "hybrid option" between ephemeral consumer and a pre-created durable consumer that needs to be fully managed by the user. This hybrid is a "server-managed" durable consumer. The server creates a durable instead of ephemeral consumer, but otherwise functions in exactly the same way. Importantly, it allows for easy migration from ephemeral to durable sourcing, as well as not requiring too much additional work from the user when not necessary. |
…treams Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
8a72c01 to
b12edc3
Compare
|
Updated the ADR and server PR to automatically "upgrade" the ephemeral sourcing consumer to be durable if sourcing from a WQ/Interest stream. This ensures this type of sourcing will work reliably after performing the server upgrade. The "bring your own consumer" approach is also kept, but is an opt-in still. |
Stream sourcing/mirroring on WorkQueue or Interest streams is not reliable due to the use of an ephemeral
AckNoneconsumer. This ADR proposes a design for durable stream sourcing/mirroring that works reliably on all stream retention types.Signed-off-by: Maurice van Veen github@mauricevanveen.com