jiafu1115 commented on code in PR #19899: URL: https://github.com/apache/kafka/pull/19899#discussion_r2126663768
########## storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManager.java: ########## @@ -477,13 +478,15 @@ boolean doesTopicExist(Admin adminClient, String topic) { if (description != null) { log.info("Topic {} exists. TopicId: {}, numPartitions: {}, ", topic, description.topicId(), description.partitions().size()); - } else { - log.info("Topic {} does not exist.", topic); } - return description != null; + return true; } catch (ExecutionException | InterruptedException ex) { - log.info("Topic {} does not exist. Error: {}", topic, ex.getCause().getMessage()); - return false; + if (ex.getCause() instanceof UnknownTopicOrPartitionException) { + log.info("Topic {} does not exist", topic); Review Comment: let me give some detailed information: when topic doesn't existed. the exception will be throw with cause: UnknownTopicOrPartitionException I test it both on 3.9.0 and 4.0.0. The normal "exception" throwed on restarting process don't give the conclusion that the topic isn't existed. most of the cases are the connection fail to connect due to the server isn't ready. -- 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