Skip to content

KAFKA-19752: Move UnifiedLogTest to storage module#21844

Open
TaiJuWu wants to merge 8 commits intoapache:trunkfrom
TaiJuWu:KAFKA-19752-2
Open

KAFKA-19752: Move UnifiedLogTest to storage module#21844
TaiJuWu wants to merge 8 commits intoapache:trunkfrom
TaiJuWu:KAFKA-19752-2

Conversation

@TaiJuWu
Copy link
Collaborator

@TaiJuWu TaiJuWu commented Mar 21, 2026

testTransactionIndexUpdatedThroughReplication ~
testRenamingDirWithoutReinitialization

@github-actions github-actions bot added the triage PRs from the community label Mar 21, 2026
@TaiJuWu TaiJuWu changed the title KAFKA-19752: Move UnifiedLogTest to storage module (WIP) KAFKA-19752: Move UnifiedLogTest to storage module Mar 21, 2026
@github-actions github-actions bot added core Kafka Broker tests Test fixes (including flaky tests) storage Pull requests that target the storage module labels Mar 21, 2026
@TaiJuWu TaiJuWu changed the title (WIP) KAFKA-19752: Move UnifiedLogTest to storage module KAFKA-19752: Move UnifiedLogTest to storage module Mar 21, 2026
Copy link
Contributor

@clolov clolov left a comment

Choose a reason for hiding this comment

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

Thank you for this, made an initial pass

Comment on lines +4447 to +4448
LogTestUtils.appendEndTxnMarkerAsLeader(log, pid, epoch, ControlRecordType.ABORT, mockTime.milliseconds(),
2, 1, TransactionVersion.TV_0.featureLevel());
Copy link
Contributor

Choose a reason for hiding this comment

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

In Scala-world we invoke this code twice

    LogTestUtils.appendEndTxnMarkerAsLeader(log, pid, epoch, ControlRecordType.ABORT, mockTime.milliseconds(),
      coordinatorEpoch = 2, leaderEpoch = 1, transactionVersion = TransactionVersion.TV_0.featureLevel())
    LogTestUtils.appendEndTxnMarkerAsLeader(log, pid, epoch, ControlRecordType.ABORT, mockTime.milliseconds(),
      coordinatorEpoch = 2, leaderEpoch = 1, transactionVersion = TransactionVersion.TV_0.featureLevel())
    assertThrows(classOf[TransactionCoordinatorFencedException],
      () => LogTestUtils.appendEndTxnMarkerAsLeader(log, pid, epoch, ControlRecordType.ABORT, mockTime.milliseconds(),
        coordinatorEpoch = 1, leaderEpoch = 1, transactionVersion = TransactionVersion.TV_0.featureLevel()))

Was this an oversight or it served some function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Miss this, thanks for catch it.

}

@ParameterizedTest(name = "testEndTxnWithFencedProducerEpoch with transactionVersion={0}")
@ValueSource(shorts = {0, 1, 2})
Copy link
Contributor

Choose a reason for hiding this comment

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

In Scala-world we only tested this with 1 and 2

  @ParameterizedTest(name = "testEndTxnWithFencedProducerEpoch with transactionVersion={0}")
  @ValueSource(shorts = Array(1, 2))

Is there a reason you decided to include 0 as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

from comment Test 1: Old epoch (epoch - 1) should be rejected for both TV0/TV1 and TV2 so I think it should include 0, we just miss it.

@github-actions github-actions bot removed the triage PRs from the community label Mar 24, 2026
Copy link
Contributor

@clolov clolov left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you for the effort 😊!

Comment on lines 83 to 85
/**
* test renaming a log's dir without reinitialization, which is the case during topic deletion
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible for you to move the comment as well or get rid of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker storage Pull requests that target the storage module tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants