yiguolei commented on code in PR #38486:
URL: https://github.com/apache/doris/pull/38486#discussion_r1696275286


##########
fe/fe-core/src/main/java/org/apache/doris/common/publish/TopicPublisherThread.java:
##########
@@ -120,7 +122,30 @@ public void run() {
             try {
                 address = new TNetworkAddress(be.getHost(), be.getBePort());
                 client = ClientPool.backendPool.borrowObject(address);
-                client.publishTopicInfo(request);
+
+                // check whether workload group tag math current be
+                String locationTag = be.getLocationTag().value;
+                TPublishTopicRequest copiedRequest = new 
TPublishTopicRequest(request);
+                if (copiedRequest.isSetTopicMap()) {
+                    Map<TTopicInfoType, List<TopicInfo>> topicMap = 
copiedRequest.getTopicMap();
+                    List<TopicInfo> topicInfoList = 
topicMap.get(TTopicInfoType.WORKLOAD_GROUP);
+                    if (topicInfoList != null) {
+                        Iterator<TopicInfo> topicIter = 
topicInfoList.iterator();
+                        while (topicIter.hasNext()) {
+                            TopicInfo topicInfo = topicIter.next();
+                            if (topicInfo.isSetWorkloadGroupInfo()) {
+                                TWorkloadGroupInfo tWgInfo = 
topicInfo.getWorkloadGroupInfo();
+                                if (tWgInfo != null && tWgInfo.isSetTag() && 
!locationTag.equals(tWgInfo.getTag())) {
+                                    // currently TopicInfo could not contain 
both policy and workload group,

Review Comment:
   应该不是equals,是两个tag 之间有交叉
   比如wg的tag是   a,b
   backend的tag是  b,c
   此时workload group 就需要publish 到backend上



-- 
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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to