showuon commented on code in PR #19899:
URL: https://github.com/apache/kafka/pull/19899#discussion_r2178768756


##########
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);
+                return false;
+            }
+            log.warn("Fail to check if topic {} exist. Error: {}", topic, 
ex.getCause().getMessage());

Review Comment:
   If we will rethrow the exception and log error in L550, could we remove this 
duplicated log here?



-- 
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]

Reply via email to