Skip to content

(2.14) [FIXED] Cross-domain/account consumer acks and flow control#7860

Open
MauriceVanVeen wants to merge 1 commit intomainfrom
maurice/domain-acc-aware
Open

(2.14) [FIXED] Cross-domain/account consumer acks and flow control#7860
MauriceVanVeen wants to merge 1 commit intomainfrom
maurice/domain-acc-aware

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

Implements token version 2 from ADR-15:

$JS.ACK.<domain>.<account hash>.<stream name>.<consumer name>.<num delivered>.<stream sequence>.<consumer sequence>.<timestamp>.<num pending>

Similarly also updating the $JS.FC.<stream>.<consumer>.<random> to contain the domain and account hash.

This PR supports reading tokens from both versions, but currently also updates to only send the new version.

We should add an opt-in flag separately such that this change does not temporarily break flow control or acks during upgrades or breaks user-set subject permissions. 2.14.0 should likely ship with understanding both formats but still defaulting to the old format, the opt-in can be used for several versions to change to the new format early, we'll change the default so it becomes opt-out in a future release, and could then eventually remove old version support altogether.

Given an account A and B on different domains but using the same stream and consumer names, it's possible to import:

  • $JS.ACK.domainA.*.mystream.myconsumer.>
  • $JS.ACK.domainB.*.mystream.myconsumer.>

The account part can be used to deconflict across multiple accounts, however, since this is a hash of the account this will not be known by the user beforehand. Have now opted to using getHash of the account name, which is also used for the Raft peer IDs. Would this be okay or do we need a separate hash? (We should also be aware that we can't change this anymore if the hash is explicitly used as part of subject permissions. But, even when using $JS.ACK.*.*.> as the import, given the new format, we'll always be able to deconflict properly).

Resolves #6547, #6440, #7326
Relates to #6431

Signed-off-by: Maurice van Veen github@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve cross-account and cross-domain consumer use

1 participant