[ 
https://issues.apache.org/jira/browse/GOBBLIN-1743?focusedWorklogId=827317&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-827317
 ]

ASF GitHub Bot logged work on GOBBLIN-1743:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Nov/22 00:53
            Start Date: 19/Nov/22 00:53
    Worklog Time Spent: 10m 
      Work Description: homatthew commented on code in PR #3602:
URL: https://github.com/apache/gobblin/pull/3602#discussion_r1026996560


##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java:
##########
@@ -544,23 +544,25 @@ void connectHelixManagerWithRetry() {
   private void addInstanceTags() {
     HelixManager receiverManager = getReceiverManager();
     if (receiverManager.isConnected()) {
-      // The helix instance associated with this container should be 
consistent on helix tag
-      List<String> existedTags = receiverManager.getClusterManagmentTool()
-          .getInstanceConfig(this.clusterName, 
this.helixInstanceName).getTags();
-      Set<String> desiredTags = new HashSet<>(
-          ConfigUtils.getStringList(this.clusterConfig, 
GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY));
-      if (!desiredTags.isEmpty()) {
-        // Remove tag assignments for the current Helix instance from a 
previous run
-        for (String tag : existedTags) {
-          if (!desiredTags.contains(tag))
-            
receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, 
this.helixInstanceName, tag);
-          logger.info("Removed unrelated helix tag {} for instance {}", tag, 
this.helixInstanceName);
+      try {
+        Set<String> desiredTags = new 
HashSet<>(ConfigUtils.getStringList(this.clusterConfig, 
GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY));
+        if (!desiredTags.isEmpty()) {
+          // The helix instance associated with this container should be 
consistent on helix tag
+          List<String> existedTags =
+              
receiverManager.getClusterManagmentTool().getInstanceConfig(this.clusterName, 
this.helixInstanceName).getTags();

Review Comment:
   Correct. The current implementation doesn't affect streaming logic and 
should work. I am pointing out that a missing instance config is an indication 
of a larger problem. i.e. I don't think this change addresses the core issue 
which is that we are missing an instance config which causes the exception. 
   
   ```
   instance [instance] does not exist in cluster [cluster]
   ```



##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java:
##########
@@ -544,23 +544,25 @@ void connectHelixManagerWithRetry() {
   private void addInstanceTags() {
     HelixManager receiverManager = getReceiverManager();
     if (receiverManager.isConnected()) {
-      // The helix instance associated with this container should be 
consistent on helix tag
-      List<String> existedTags = receiverManager.getClusterManagmentTool()
-          .getInstanceConfig(this.clusterName, 
this.helixInstanceName).getTags();
-      Set<String> desiredTags = new HashSet<>(
-          ConfigUtils.getStringList(this.clusterConfig, 
GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY));
-      if (!desiredTags.isEmpty()) {
-        // Remove tag assignments for the current Helix instance from a 
previous run
-        for (String tag : existedTags) {
-          if (!desiredTags.contains(tag))
-            
receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, 
this.helixInstanceName, tag);
-          logger.info("Removed unrelated helix tag {} for instance {}", tag, 
this.helixInstanceName);
+      try {
+        Set<String> desiredTags = new 
HashSet<>(ConfigUtils.getStringList(this.clusterConfig, 
GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY));
+        if (!desiredTags.isEmpty()) {

Review Comment:
   Does non standalone gobblin mean yarn? Does that mean all usages of yarn 
don't use the GobblinYarnTaskRunner?



##########
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinTaskRunner.java:
##########
@@ -544,23 +544,27 @@ void connectHelixManagerWithRetry() {
   private void addInstanceTags() {
     HelixManager receiverManager = getReceiverManager();
     if (receiverManager.isConnected()) {
-      // The helix instance associated with this container should be 
consistent on helix tag
-      List<String> existedTags = receiverManager.getClusterManagmentTool()
-          .getInstanceConfig(this.clusterName, 
this.helixInstanceName).getTags();
-      Set<String> desiredTags = new HashSet<>(
-          ConfigUtils.getStringList(this.clusterConfig, 
GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY));
-      if (!desiredTags.isEmpty()) {
-        // Remove tag assignments for the current Helix instance from a 
previous run
-        for (String tag : existedTags) {
-          if (!desiredTags.contains(tag))
-            
receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, 
this.helixInstanceName, tag);
-          logger.info("Removed unrelated helix tag {} for instance {}", tag, 
this.helixInstanceName);
+      try {
+        Set<String> desiredTags = new HashSet<>(
+            ConfigUtils.getStringList(this.clusterConfig, 
GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY));
+        if (!desiredTags.isEmpty()) {
+          // The helix instance associated with this container should be 
consistent on helix tag
+          List<String> existedTags = receiverManager.getClusterManagmentTool()
+              .getInstanceConfig(this.clusterName, 
this.helixInstanceName).getTags();
+          // Remove tag assignments for the current Helix instance from a 
previous run
+          for (String tag : existedTags) {
+            if (!desiredTags.contains(tag)) {
+              
receiverManager.getClusterManagmentTool().removeInstanceTag(this.clusterName, 
this.helixInstanceName, tag);
+              logger.info("Removed unrelated helix tag {} for instance {}", 
tag, this.helixInstanceName);
+            }
+          }
+          desiredTags.forEach(desiredTag -> 
receiverManager.getClusterManagmentTool().addInstanceTag(this.clusterName, 
this.helixInstanceName, desiredTag));

Review Comment:
   Forgot to change this white space back





Issue Time Tracking
-------------------

    Worklog Id:     (was: 827317)
    Time Spent: 2.5h  (was: 2h 20m)

> Ensure GobblinTaskRunner works when used without Yarn
> -----------------------------------------------------
>
>                 Key: GOBBLIN-1743
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1743
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-core
>            Reporter: Urmi Mustafi
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> this PR [https://github.com/apache/gobblin/pull/3519/files]  has a call to 
> Helix cluster contained outside of a conditional that was previously never 
> encountered for Fliptop use case. I moved the call back inside the 
> conditional to ensure we don't attempt to retrieve an instanceConfig that is 
> not registered with Helix as we don't have Yarn mode enabled. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to