Skip to content

Commit

Permalink
KAFKA-17772 Remove inControlledShutdownBrokers(Set<Integer>) and unfe…
Browse files Browse the repository at this point in the history
…nceBrokers(Set<Integer>) from ReplicationControlManagerTest (apache#17466)

Reviewers: Chia-Ping Tsai <[email protected]>
  • Loading branch information
chiacyu authored Oct 11, 2024
1 parent edd3860 commit b2380d7
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,6 @@ void alterPartition(
}

void unfenceBrokers(Integer... brokerIds) {
unfenceBrokers(Utils.mkSet(brokerIds));
}

void unfenceBrokers(Set<Integer> brokerIds) {
for (int brokerId : brokerIds) {
ControllerResult<BrokerHeartbeatReply> result = replicationControl.
processBrokerHeartbeat(new BrokerHeartbeatRequestData().
Expand All @@ -464,10 +460,6 @@ void unfenceBrokers(Set<Integer> brokerIds) {
}

void inControlledShutdownBrokers(Integer... brokerIds) {
inControlledShutdownBrokers(Utils.mkSet(brokerIds));
}

void inControlledShutdownBrokers(Set<Integer> brokerIds) {
for (int brokerId : brokerIds) {
BrokerRegistrationChangeRecord record = new BrokerRegistrationChangeRecord()
.setBrokerId(brokerId)
Expand Down Expand Up @@ -2311,7 +2303,7 @@ public void testElectUncleanLeaders_WithoutElr(boolean electAllPartitions) {
assertElectLeadersResponse(expectedResponse1, result1.response());

// Now we bring 2 back online which should allow the unclean election of partition 0
ctx.unfenceBrokers(Utils.mkSet(2));
ctx.unfenceBrokers(2);

// Bring 2 back into the ISR for partition 1. This allows us to verify that
// preferred election does not occur as a result of the unclean election request.
Expand Down Expand Up @@ -2362,7 +2354,7 @@ public void testPreferredElectionDoesNotTriggerUncleanElection() {

ctx.fenceBrokers(Utils.mkSet(2, 3));
ctx.fenceBrokers(Utils.mkSet(1, 2, 3));
ctx.unfenceBrokers(Utils.mkSet(2));
ctx.unfenceBrokers(2);

assertLeaderAndIsr(replication, partition, NO_LEADER, new int[]{1});

Expand Down

0 comments on commit b2380d7

Please sign in to comment.