VGalaxies commented on code in PR #17780:
URL: https://github.com/apache/iotdb/pull/17780#discussion_r3340236791
##########
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:
Done. I merged the contains/get path into a single getTopicMeta(...) call
and handle the missing-topic case with a null check before owner-fencing
validation.
--
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]