Skip to content

KAFKA-19562: Replace hand-written AbortedTxn with generated protocol#21577

Merged
chia7712 merged 12 commits intoapache:trunkfrom
mingyen066:KAFKA-19562-rewrite-aborted-txn-by-generated-protocol
Mar 23, 2026
Merged

KAFKA-19562: Replace hand-written AbortedTxn with generated protocol#21577
chia7712 merged 12 commits intoapache:trunkfrom
mingyen066:KAFKA-19562-rewrite-aborted-txn-by-generated-protocol

Conversation

@mingyen066
Copy link
Collaborator

@mingyen066 mingyen066 commented Feb 25, 2026

Replace the manually maintained AbortedTxn class with a generated
protocol message defined in AbortedTxn.json.

Also simplifies TransactionIndex buffer management since the generated
class copies field values at construction time instead of holding a
buffer reference.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tools storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature clients labels Feb 25, 2026
@mingyen066 mingyen066 force-pushed the KAFKA-19562-rewrite-aborted-txn-by-generated-protocol branch from 4d49f23 to 078353e Compare February 25, 2026 15:38
Replace the manually maintained AbortedTxn class with a generated
protocol message defined in AbortedTxn.json. The generated class
provides the same wire format (2-byte version prefix + 4 int64 fields)
ensuring binary compatibility with existing transaction index files.
@mingyen066 mingyen066 force-pushed the KAFKA-19562-rewrite-aborted-txn-by-generated-protocol branch from 078353e to 25a1108 Compare February 26, 2026 06:11
@github-actions github-actions bot removed the triage PRs from the community label Mar 4, 2026
Move buffer and position allocation inside the iterator() lambda so
each call to iterator() gets its own independent state, properly
satisfying the Iterable contract. Add a test to verify this behavior.
- Remove blank line between MessageUtil and Utils imports in TransactionIndex.java to satisfy spotless
- Add missing AbortedTxn import in UnifiedLogTest.scala
@chia7712
Copy link
Member

@mingyen066 please handle the conflicts

@chia7712
Copy link
Member

Execution failed for task ':tools:compileTestJava'.
> Compilation failed; see the compiler output below.
  /home/chia7712/project/kafka/tools/src/test/java/org/apache/kafka/tools/DumpLogSegmentsTest.java:88: error: cannot find symbol
  import org.apache.kafka.storage.internals.log.AbortedTxn;
                                               ^
    symbol:   class AbortedTxn
    location: package org.apache.kafka.storage.internals.log
  /home/chia7712/project/kafka/tools/src/test/java/org/apache/kafka/tools/DumpLogSegmentsTest.java:1489: error: cannot find symbol
              index.append(new AbortedTxn(1L, 0, 10, 11));
                               ^
    symbol:   class AbortedTxn
    location: class DumpLogSegmentsTest
  /home/chia7712/project/kafka/tools/src/test/java/org/apache/kafka/tools/DumpLogSegmentsTest.java:1490: error: cannot find symbol
              index.append(new AbortedTxn(2L, 15, 25, 26));
                               ^
    symbol:   class AbortedTxn
    location: class DumpLogSegmentsTest
  3 errors

* Try:
> Check your code and dependencies to fix the compilation error(s)

@chia7712 chia7712 merged commit 70dfc42 into apache:trunk Mar 23, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients core Kafka Broker storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants