Skip to content

Implements the second part of sourcing deduplication#7975

Open
jnmoyne wants to merge 2 commits intonats-io:mainfrom
jnmoyne:jnm/sourcing-dedup-new-per-subject
Open

Implements the second part of sourcing deduplication#7975
jnmoyne wants to merge 2 commits intonats-io:mainfrom
jnmoyne:jnm/sourcing-dedup-new-per-subject

Conversation

@jnmoyne
Copy link
Copy Markdown
Contributor

@jnmoyne jnmoyne commented Mar 21, 2026

Implements the second part of sourcing deduplication, extending #7896 to discard new per subject.

Signed-off-by: Jean-Noël Moyne jnmoyne@gmail.com

… discard new per subject.

Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
@jnmoyne jnmoyne requested a review from a team as a code owner March 21, 2026 17:26
@derekcollison
Copy link
Copy Markdown
Member

@claude please review.

@synadia-claude-reviewer
Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

@neilalexander
Copy link
Copy Markdown
Member

@codex please review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d39d149c29

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

… kicking in the SourcingDeduplication tests.

Signed-off-by: Jean-Noel Moyne <jnmoyne@gmail.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92a687d64d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// Retry in all type of errors we do not want to skip if we are still leader.
if mset.isLeader() {
if !errors.Is(err, errMsgIdDuplicate) {
if !errors.Is(err, errMsgIdDuplicate) && !errors.Is(err, ErrMaxMsgsPerSubject) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retry ErrMaxMsgsPerSubject instead of advancing the source

When a sourced stream with DiscardNewPer temporarily rejects a message because the subject is full, this new branch treats ErrMaxMsgsPerSubject like a duplicate and returns true after si.sseq has already been advanced. That permanently drops the blocked source sequence: if the destination later frees that subject slot (for example via purge, delete, or MaxAge expiration), sourcing resumes from the newer sequence and the missed update is never replayed. The previous retrySourceConsumerAtSeq(iName, si.sseq) path was what allowed these temporary per-subject overflows to recover.

Useful? React with 👍 / 👎.

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.

3 participants