Skip to content

KAFKA-13782; Ensure correct partition added to txn after abort on full batch#11995

Merged
hachikuji merged 1 commit intoapache:trunkfrom
hachikuji:KAFKA-13782
Apr 5, 2022
Merged

KAFKA-13782; Ensure correct partition added to txn after abort on full batch#11995
hachikuji merged 1 commit intoapache:trunkfrom
hachikuji:KAFKA-13782

Conversation

@hachikuji
Copy link
Copy Markdown
Contributor

Fixes a regression introduced in #11452. Following KIP-480, the Partitioner will receive a callback when a batch has been completed so that it can choose another partition. Because of this, we have to wait until the batch has been successfully appended to the accumulator before adding the partition in TransactionManager.maybeAddPartition. This is still safe because the Sender cannot dequeue a batch from the accumulator until it has been added to the transaction successfully.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Copy link
Copy Markdown
Contributor

@artemlivshits artemlivshits left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@dongjoon-hyun
Copy link
Copy Markdown
Member

Hi, @ijuma . According to your dev mailing list email, is this the last blocker issue before Apache Kafka 3.1.1 RC?

@ijuma
Copy link
Copy Markdown
Member

ijuma commented Apr 5, 2022

In addition to this, we will also include #11991. @hachikuji should be able to merge both this morning, I believe.

@hachikuji hachikuji merged commit 3ceedac into apache:trunk Apr 5, 2022
hachikuji added a commit that referenced this pull request Apr 5, 2022
…l batch (#11995)

Fixes a regression introduced in #11452. Following [KIP-480](https://cwiki.apache.org/confluence/display/KAFKA/KIP-480%3A+Sticky+Partitioner), the `Partitioner` will receive a callback when a batch has been completed so that it can choose another partition. Because of this, we have to wait until the batch has been successfully appended to the accumulator before adding the partition in `TransactionManager.maybeAddPartition`. This is still safe because the `Sender` cannot dequeue a batch from the accumulator until it has been added to the transaction successfully.

Reviewers: Artem Livshits <84364232+artemlivshits@users.noreply.github.com>, David Jacot <djacot@confluent.io>,  Tom Bentley <tbentley@redhat.com>
@hachikuji
Copy link
Copy Markdown
Contributor Author

@tombentley This is merged to 3.1 along with #11991. Thanks for managing the release by the way!

hachikuji added a commit that referenced this pull request Apr 5, 2022
…l batch (#11995)

Fixes a regression introduced in #11452. Following [KIP-480](https://cwiki.apache.org/confluence/display/KAFKA/KIP-480%3A+Sticky+Partitioner), the `Partitioner` will receive a callback when a batch has been completed so that it can choose another partition. Because of this, we have to wait until the batch has been successfully appended to the accumulator before adding the partition in `TransactionManager.maybeAddPartition`. This is still safe because the `Sender` cannot dequeue a batch from the accumulator until it has been added to the transaction successfully.

Reviewers: Artem Livshits <84364232+artemlivshits@users.noreply.github.com>, David Jacot <djacot@confluent.io>,  Tom Bentley <tbentley@redhat.com>
@dongjoon-hyun
Copy link
Copy Markdown
Member

Thank you so much all!

jeffkbkim pushed a commit to confluentinc/kafka that referenced this pull request May 12, 2022
…l batch (apache#11995)

Fixes a regression introduced in apache#11452. Following [KIP-480](https://cwiki.apache.org/confluence/display/KAFKA/KIP-480%3A+Sticky+Partitioner), the `Partitioner` will receive a callback when a batch has been completed so that it can choose another partition. Because of this, we have to wait until the batch has been successfully appended to the accumulator before adding the partition in `TransactionManager.maybeAddPartition`. This is still safe because the `Sender` cannot dequeue a batch from the accumulator until it has been added to the transaction successfully.

Reviewers: Artem Livshits <84364232+artemlivshits@users.noreply.github.com>, David Jacot <djacot@confluent.io>,  Tom Bentley <tbentley@redhat.com>
jeffkbkim added a commit to confluentinc/kafka that referenced this pull request May 12, 2022
…cs-11-may-2022

* apache-kafka/3.1: (51 commits)
  MINOR: reload4j build dependency fixes (apache#12144)
  KAFKA-13255: Use config.properties.exclude when mirroring topics (apache#11401)
  KAFKA-13794: Fix comparator of inflightBatchesBySequence in TransactionsManager (round 3) (apache#12096)
  KAFKA-13794: Follow up to fix producer batch comparator (apache#12006)
  fix: make sliding window works without grace period (#kafka-13739) (apache#11980)
  3.1.1 release notes (apache#12001)
  KAFKA-13794; Fix comparator of `inflightBatchesBySequence` in `TransactionManager` (apache#11991)
  KAFKA-13782; Ensure correct partition added to txn after abort on full batch (apache#11995)
  KAFKA-13748: Do not include file stream connectors in Connect's CLASSPATH and plugin.path by default (apache#11908)
  KAFKA-13775: CVE-2020-36518 - Upgrade jackson-databind to 2.12.6.1 (apache#11962)
  ...
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.

6 participants