Skip to content

fix(producer): keep flushing batch ahead on retry - #3801

Merged
dnwe merged 1 commit into
mainfrom
fix/producer-flushing-batch-order
Nov 13, 2026
Merged

dnwe merged 1 commit into
mainfrom
fix/producer-flushing-batch-order

Conversation

@dnwe

@dnwe dnwe commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

After a connection error, handleError sent the accumulating batch back through the partition producer but left the flushing batch to be sent later. If that batch then got a retriable error from a reconnected broker, it was retried behind the newer messages, so a non-idempotent producer wrote them out of order.

Mark the flushing batch as resent so a retriable error resends it with the partition still muted, as retryBatch does.

After a connection error, handleError sent the accumulating batch back
through the partition producer but left the flushing batch to be sent
later. If that batch then got a retriable error from a reconnected
broker, it was retried behind the newer messages, so a non-idempotent
producer wrote them out of order.

Mark the flushing batch as resent so a retriable error resends it with
the partition still muted, as retryBatch does.

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
@dnwe dnwe added the fix label Sep 28, 2026

@prestona prestona left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@dnwe
dnwe merged commit bcfca7b into main Nov 13, 2026
22 checks passed
@dnwe
dnwe deleted the fix/producer-flushing-batch-order branch November 13, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants