You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2023/01/17 07:06:01 UTC

[GitHub] [inlong] vernedeng opened a new pull request, #7255: [INLONG-7254][Manager] Fix config error when InlongGroupId is in the process of switching

vernedeng opened a new pull request, #7255:
URL: https://github.com/apache/inlong/pull/7255

   ### Prepare a Pull Request
   
   - Fixes #7254 
   
   ### Motivation
   
   When a InlongGroupId is in the process of switching, the config of source cluster and target cluster will be mixed up.
   Which doubles the data consuming from MQ.
   
   The solution is to check if the target sort cluster is tagged. If so, fiter the MQs under this tag; otherwise, get all MQs of both source and target MQs.
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change added tests and can be verified as follows: Swiching in tagged/untagged cluster.
   
   
   ### Documentation
   
     - Does this pull request introduce a new feature? yes 
   


-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] vernedeng commented on a diff in pull request #7255: [INLONG-7254][Manager] Fix config error when InlongGroupId is in the process of switching

Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #7255:
URL: https://github.com/apache/inlong/pull/7255#discussion_r1090119986


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/SortSourceServiceImpl.java:
##########
@@ -296,14 +305,26 @@ private Map<String, CacheZone> parseCacheZones(
 
         // group them by cluster tag.
         Map<String, List<SortSourceStreamSinkInfo>> tag2SinkInfos = sinkInfoList.stream()
+                .filter(sink -> {
+                    if (StringUtils.isBlank(sortClusterTag)) {
+                        return true;
+                    }
+                    return groupInfos.get(sink.getGroupId()).getClusterTag().equals(sortClusterTag);

Review Comment:
   The NPE will be thrown when there is a stream sink of a groupId  but this groupId does not exist in inlong_group table. I will add one more filter condition to avoid this case.



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #7255: [INLONG-7254][Manager] Fix config error when InlongGroupId is in the process of switching

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #7255:
URL: https://github.com/apache/inlong/pull/7255#discussion_r1090111945


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/SortSourceServiceImpl.java:
##########
@@ -296,14 +305,26 @@ private Map<String, CacheZone> parseCacheZones(
 
         // group them by cluster tag.
         Map<String, List<SortSourceStreamSinkInfo>> tag2SinkInfos = sinkInfoList.stream()
+                .filter(sink -> {
+                    if (StringUtils.isBlank(sortClusterTag)) {
+                        return true;
+                    }
+                    return groupInfos.get(sink.getGroupId()).getClusterTag().equals(sortClusterTag);

Review Comment:
   Maybe there will be NPE?



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] vernedeng commented on a diff in pull request #7255: [INLONG-7254][Manager] Fix config error when InlongGroupId is in the process of switching

Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #7255:
URL: https://github.com/apache/inlong/pull/7255#discussion_r1089853164


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/SortSourceServiceImpl.java:
##########
@@ -285,8 +290,12 @@ private void parseAll() {
     }
 
     private Map<String, CacheZone> parseCacheZones(
+            String clusterName,
             List<SortSourceStreamSinkInfo> sinkList) {
 
+        Preconditions.checkNotNull(sortClusters.get(clusterName));

Review Comment:
   Fixed, thx



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] dockerzhang merged pull request #7255: [INLONG-7254][Manager] Fix config error when InlongGroupId is in the process of switching

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #7255:
URL: https://github.com/apache/inlong/pull/7255


-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] healchow commented on a diff in pull request #7255: [INLONG-7254][Manager] Fix config error when InlongGroupId is in the process of switching

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #7255:
URL: https://github.com/apache/inlong/pull/7255#discussion_r1072087581


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/SortSourceServiceImpl.java:
##########
@@ -285,8 +290,12 @@ private void parseAll() {
     }
 
     private Map<String, CacheZone> parseCacheZones(
+            String clusterName,
             List<SortSourceStreamSinkInfo> sinkList) {
 
+        Preconditions.checkNotNull(sortClusters.get(clusterName));

Review Comment:
   Suggest use the `Preconditions` in manager-common module.



-- 
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-unsubscribe@inlong.apache.org

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