[FIXED] Prevent duplicate JetStream ingestion subscriptions during concurrent stream updates - #8479
Draft
realMoonBoy wants to merge 1 commit into
Conversation
Signed-off-by: Tylor M Collins <tmc501@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7801.
The complete issue trace shows sequences 100-104 spanning two wire-level publishes, with each ingress multiplied independently. A controlled reproduction makes the boundary deterministic: one traced ingress produces eight PubAcks and eight durable stream records.
Concurrent equivalent stream updates could each calculate their subscription delta from the same stale stream configuration. Each update then installed the same internal ingestion subscription. A later protocol publish matched every duplicate subscription, so one ingress was independently accepted multiple times and produced multiple durable records, stream sequences, and PubAcks.
This change serializes
updateWithAdvisoryper stream, covering the configuration snapshot, delta calculation, and application. It does not add message deduplication or change publish retry, consumer acknowledgement, or redelivery semantics.The regression test performs eight concurrent equivalent public stream updates, then verifies that one traced ingress produces exactly one PubAck, one durable record/stream sequence, one first delivery, and zero redeliveries.
Validation:
maincontrol (8e54a59546b11dc62bf894b2360c12a01f465cf6): 1 ingress -> 8 PubAcks, 8 records/sequences, 8 first deliveries.TestJetStreamUpdateStreampassed.golangci-lintand Linux amd64/386 builds passed.TestLeafNodeSlowConsumertiming flake, andTestOCSPPeerMonitorfailing to restart its fixed8222monitoring port between subtests. The OCSP failure reproduces identically on the unmodified base; the remainder of thetestpackage passes with that baseline-broken case excluded.I certify that this contribution is my original work and that I license it to the project under the Apache License 2.0.