horizonzy commented on code in PR #21797:
URL: https://github.com/apache/pulsar/pull/21797#discussion_r1436278822
##########
managed-ledger/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java:
##########
@@ -288,6 +288,7 @@ protected void stopBKCluster() throws Exception {
for (ServerTester t : servers) {
t.shutdown();
+ t.stopAutoRecovery();
Review Comment:
Ok, I found the problem. In the test, it may kill the follower auditor, the
follower auditor can't be aware of the close behavior, because the follower
auditor is blocked due to waiting leader shutdown.
### The reproduce code:
```
public TestAutoRecoveryAlongWithBookieServers() throws Exception {
super(2);
setAutoRecoveryEnabled(true);
Class.forName("org.apache.pulsar.metadata.bookkeeper.PulsarMetadataClientDriver");
Class.forName("org.apache.pulsar.metadata.bookkeeper.PulsarMetadataBookieDriver");
}
@Test
public void testAutoRecoveryAlongWithBookieServers() throws Exception {
BookieId firstBookie = getBookie(0);
BookieId secondBookie = getBookie(1);
// killBookie(firstBookie);
Auditor auditor = getAuditor(10000, TimeUnit.MILLISECONDS);
Field bookieIdentifier =
auditor.getClass().getDeclaredField("bookieIdentifier");
bookieIdentifier.setAccessible(true);
String auditorId = (String) bookieIdentifier.get(auditor);
System.out.println("kill:" + auditorId);
if (firstBookie.toString().equals(auditorId)) {
killBookie(secondBookie);
} else {
killBookie(firstBookie);
}
Thread.sleep(10000);
if (firstBookie.toString().equals(auditorId)) {
killBookie(firstBookie);
} else {
killBookie(secondBookie);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]