soarez commented on code in PR #14977: URL: https://github.com/apache/kafka/pull/14977#discussion_r1424698314
########## core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala: ########## @@ -191,12 +204,27 @@ class LogDirFailureTest extends IntegrationTestHarness { TestUtils.pollUntilAtLeastNumRecords(consumer, 1) // There should be no remaining LogDirEventNotification znode - assertTrue(zkClient.getAllLogDirEventNotifications.isEmpty) + if (quorum == "zk") { + assertTrue(zkClient.getAllLogDirEventNotifications.isEmpty) + } - // The controller should have marked the replica on the original leader as offline - val controllerServer = servers.find(_.kafkaController.isActive).get - val offlineReplicas = controllerServer.kafkaController.controllerContext.replicasInState(topic, OfflineReplica) - assertTrue(offlineReplicas.contains(PartitionAndReplica(new TopicPartition(topic, 0), leaderServerId))) + if (quorum == "kraft") { + waitUntilTrue(() => { + brokers.exists(broker => { + val hasOfflineDir = broker.asInstanceOf[BrokerServer].logDirFailureChannel.hasOfflineLogDir(failedLogDir.toPath.toString) + hasOfflineDir && broker.asInstanceOf[BrokerServer] + .replicaManager + .metadataCache + .getClusterMetadata(broker.clusterId, broker.config.interBrokerListenerName) + .partition(new TopicPartition(topic, 0)).offlineReplicas().map(_.id()).contains(originalLeaderServerId) Review Comment: Hey @viktorsomogyi, at least one of the issues here was this -> #14998 -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org