You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "jt2594838 (via GitHub)" <gi...@apache.org> on 2026/06/02 07:52:18 UTC

Re: [PR] Subscription: add topic owner epoch fencing [iotdb]

jt2594838 commented on code in PR #17780:
URL: https://github.com/apache/iotdb/pull/17780#discussion_r3339464993


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/agent/SubscriptionTopicAgent.java:
##########
@@ -188,4 +195,73 @@ public Map<String, TopicConfig> getTopicConfigs(final Set<String> topicNames) {
       releaseReadLock();
     }
   }
+
+  public TSStatus checkTopicOwner(final ConsumerConfig consumerConfig, final String topicName) {
+    acquireReadLock();
+    try {
+      if (!topicMetaKeeper.containsTopicMeta(topicName)) {
+        return RpcUtils.SUCCESS_STATUS;
+      }
+
+      final TopicMeta topicMeta = topicMetaKeeper.getTopicMeta(topicName);
+      if (!topicMeta.isOwnerFencingEnabled()) {
+        return RpcUtils.SUCCESS_STATUS;
+      }

Review Comment:
   Is it possible to merge contains and get?



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org