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


##########
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:
   backend的locationTag标签是唯一的,是个字符串,不是个集合, workload 
group目前的tag也只是个字符串。你说的这种场景可以等到支持更灵活的资源划分的时候再支持也行。



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