You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2026/02/26 02:23:11 UTC

(pinot) branch master updated: Make topic exists error silent in Kafka 3.0 createTopic (#17767)

This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new a95db2b9f4e Make topic exists error silent in Kafka 3.0 createTopic (#17767)
a95db2b9f4e is described below

commit a95db2b9f4ecc2367bae552a30a2c56743bff4be
Author: Xiang Fu <xi...@apache.org>
AuthorDate: Wed Feb 25 18:23:06 2026 -0800

    Make topic exists error silent in Kafka 3.0 createTopic (#17767)
    
    Handle TopicExistsException in KafkaServerStartable.createTopic by
    returning silently when the topic already exists, matching the behavior
    of kafka20 clients. This prevents quickstart from failing when topics
    like flights-realtime already exist.
    
    Co-authored-by: Cursor <cu...@cursor.com>
---
 .../pinot/plugin/stream/kafka30/server/KafkaServerStartable.java     | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pinot-plugins/pinot-stream-ingestion/pinot-kafka-3.0/src/main/java/org/apache/pinot/plugin/stream/kafka30/server/KafkaServerStartable.java b/pinot-plugins/pinot-stream-ingestion/pinot-kafka-3.0/src/main/java/org/apache/pinot/plugin/stream/kafka30/server/KafkaServerStartable.java
index 6d2a7b6f908..67c9c15befc 100644
--- a/pinot-plugins/pinot-stream-ingestion/pinot-kafka-3.0/src/main/java/org/apache/pinot/plugin/stream/kafka30/server/KafkaServerStartable.java
+++ b/pinot-plugins/pinot-stream-ingestion/pinot-kafka-3.0/src/main/java/org/apache/pinot/plugin/stream/kafka30/server/KafkaServerStartable.java
@@ -170,6 +170,11 @@ public class KafkaServerStartable implements StreamDataServerStartable {
       runAdminWithRetry(() -> adminClient.createTopics(Collections.singletonList(newTopic)).all().get(),
           "create topic: " + topic);
     } catch (Exception e) {
+      if (e instanceof ExecutionException
+          && e.getCause() instanceof org.apache.kafka.common.errors.TopicExistsException) {
+        // Topic already exists, skip creation silently
+        return;
+      }
       throw new RuntimeException("Failed to create topic: " + topic, e);
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org