mirror of https://github.com/apache/kafka.git
KAFKA-17772 Remove inControlledShutdownBrokers(Set<Integer>) and unfenceBrokers(Set<Integer>) from ReplicationControlManagerTest (#17466)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
edd3860433
commit
b2380d7bf6
|
@ -447,10 +447,6 @@ public class ReplicationControlManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
void unfenceBrokers(Integer... brokerIds) {
|
void unfenceBrokers(Integer... brokerIds) {
|
||||||
unfenceBrokers(Utils.mkSet(brokerIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
void unfenceBrokers(Set<Integer> brokerIds) {
|
|
||||||
for (int brokerId : brokerIds) {
|
for (int brokerId : brokerIds) {
|
||||||
ControllerResult<BrokerHeartbeatReply> result = replicationControl.
|
ControllerResult<BrokerHeartbeatReply> result = replicationControl.
|
||||||
processBrokerHeartbeat(new BrokerHeartbeatRequestData().
|
processBrokerHeartbeat(new BrokerHeartbeatRequestData().
|
||||||
|
@ -464,10 +460,6 @@ public class ReplicationControlManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
void inControlledShutdownBrokers(Integer... brokerIds) {
|
void inControlledShutdownBrokers(Integer... brokerIds) {
|
||||||
inControlledShutdownBrokers(Utils.mkSet(brokerIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
void inControlledShutdownBrokers(Set<Integer> brokerIds) {
|
|
||||||
for (int brokerId : brokerIds) {
|
for (int brokerId : brokerIds) {
|
||||||
BrokerRegistrationChangeRecord record = new BrokerRegistrationChangeRecord()
|
BrokerRegistrationChangeRecord record = new BrokerRegistrationChangeRecord()
|
||||||
.setBrokerId(brokerId)
|
.setBrokerId(brokerId)
|
||||||
|
@ -2311,7 +2303,7 @@ public class ReplicationControlManagerTest {
|
||||||
assertElectLeadersResponse(expectedResponse1, result1.response());
|
assertElectLeadersResponse(expectedResponse1, result1.response());
|
||||||
|
|
||||||
// Now we bring 2 back online which should allow the unclean election of partition 0
|
// 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
|
// 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.
|
// preferred election does not occur as a result of the unclean election request.
|
||||||
|
@ -2362,7 +2354,7 @@ public class ReplicationControlManagerTest {
|
||||||
|
|
||||||
ctx.fenceBrokers(Utils.mkSet(2, 3));
|
ctx.fenceBrokers(Utils.mkSet(2, 3));
|
||||||
ctx.fenceBrokers(Utils.mkSet(1, 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});
|
assertLeaderAndIsr(replication, partition, NO_LEADER, new int[]{1});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue