Skip to content

Commit

Permalink
KAFKA-15410: Reassign replica expand, move and shrink integration tes…
Browse files Browse the repository at this point in the history
…ts (2/4) (apache#14328)

- Updated the log-start-offset to the correct value while building the replica state in ReplicaFetcherTierStateMachine#buildRemoteLogAuxState

Integration tests added:
1. ReassignReplicaExpandTest
2. ReassignReplicaMoveTest and
3. ReassignReplicaShrinkTest

Reviewers: Satish Duggana <[email protected]>, Luke Chen <[email protected]>
  • Loading branch information
kamalcph authored and AnatolyPopov committed Dec 21, 2023
1 parent 552fd11 commit 3ae44a9
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ protected void writeTestSpecifications(TieredStorageTestBuilder builder) {
final String topicA = "topicA";
final String topicB = "topicB";
final Integer p0 = 0;
final Integer partitionCount = 1;
final Integer replicationFactor = 1;
final Integer partitionCount = 5;
final Integer replicationFactor = 2;
final Integer maxBatchCountPerSegment = 1;
final Map<Integer, List<Integer>> replicaAssignment = null;
final boolean enableRemoteLogStorage = true;
Expand All @@ -66,15 +66,13 @@ protected void writeTestSpecifications(TieredStorageTestBuilder builder) {
}

builder
// create topicA with 50 partitions and 2 RF. Using 50 partitions to ensure that the user-partitions
// are mapped to all the __remote_log_metadata partitions. This is required to ensure that
// TBRLMM able to handle the assignment of the newly created replica to one of the already assigned
// metadata partition
.createTopic(topicA, 50, 2, maxBatchCountPerSegment,
// create topicA with 5 partitions, 2 RF and ensure that the user-topic-partitions are mapped to
// metadata partitions
.createTopic(topicA, partitionCount, replicationFactor, maxBatchCountPerSegment,
replicaAssignment, enableRemoteLogStorage)
.expectUserTopicMappedToMetadataPartitions(topicA, metadataPartitions)
// create topicB with 1 partition and 1 RF
.createTopic(topicB, partitionCount, replicationFactor, maxBatchCountPerSegment,
.createTopic(topicB, 1, 1, maxBatchCountPerSegment,
mkMap(mkEntry(p0, Collections.singletonList(broker0))), enableRemoteLogStorage)
// send records to partition 0
.expectSegmentToBeOffloaded(broker0, topicB, p0, 0, new KeyValueSpec("k0", "v0"))
Expand Down

0 comments on commit 3ae44a9

Please sign in to comment.