You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "Will-Lo (via GitHub)" <gi...@apache.org> on 2023/05/09 19:13:22 UTC

[GitHub] [gobblin] Will-Lo opened a new pull request, #3694: [GOBBLIN-1831] Use flowexecutionid in monitor jobnames

Will-Lo opened a new pull request, #3694:
URL: https://github.com/apache/gobblin/pull/3694

   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [ ] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1831
   
   
   ### Description
   - [ ] Here are some details about my PR, including screenshots (if applicable):
   This PR handles the scenario where concurrent jobs can run on Gobblin cluster from GaaS and handles the cancellation logic properly.
   
   When executing jobs from GaaS to Gobblin cluster, there can be a mismatch of flowexecution ids to jobs running on Gobblin cluster. The old behavior was that the current job will be deleted regardless of the execution ID, but this could mean that a state mismatch could lead to current jobs being deleted when they should still continue to run.
   
   To address this, we tried adding the FlowExecutionId to the jobSpec, but that meant that jobs could run concurrently on Gobblin cluster when they should have been deduped.
   
   So instead, during cancellation, we want to check if the incoming spec has a flow execution ID. If so, then it will cancel the existing job only if the flow execution IDs match. Otherwise, it will know that the current job does not match the incoming request and should not be deleted.
   
   This PR also uses flow execution ID if applicable as the planningjob ID and job_actualJob ID, as there should only be one of these per flow.
   
   ### Tests
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   
   ### Commits
   - [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   


-- 
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: dev-unsubscribe@gobblin.apache.org

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


[GitHub] [gobblin] Will-Lo merged pull request #3694: [GOBBLIN-1831] Use flowexecutionid in kafka monitor and jobnames

Posted by "Will-Lo (via GitHub)" <gi...@apache.org>.
Will-Lo merged PR #3694:
URL: https://github.com/apache/gobblin/pull/3694


-- 
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: dev-unsubscribe@gobblin.apache.org

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


[GitHub] [gobblin] codecov-commenter commented on pull request #3694: [GOBBLIN-1831] Use flowexecutionid in kafka monitor and jobnames

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3694:
URL: https://github.com/apache/gobblin/pull/3694#issuecomment-1540774373

   ## [Codecov](https://app.codecov.io/gh/apache/gobblin/pull/3694?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3694](https://app.codecov.io/gh/apache/gobblin/pull/3694?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6597a5c) into [master](https://app.codecov.io/gh/apache/gobblin/commit/e47aef7f8eeba3b6d52901cab299048a467eaf24?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e47aef7) will **decrease** coverage by `2.22%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3694      +/-   ##
   ============================================
   - Coverage     46.99%   44.78%   -2.22%     
   + Complexity    10788     2094    -8694     
   ============================================
     Files          2138      411    -1727     
     Lines         84040    17725   -66315     
     Branches       9340     2160    -7180     
   ============================================
   - Hits          39497     7938   -31559     
   + Misses        40955     8929   -32026     
   + Partials       3588      858    -2730     
   ```
   
   
   | [Impacted Files](https://app.codecov.io/gh/apache/gobblin/pull/3694?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...a/org/apache/gobblin/cluster/HelixJobsMapping.java](https://app.codecov.io/gh/apache/gobblin/pull/3694?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvSGVsaXhKb2JzTWFwcGluZy5qYXZh) | `80.95% <100.00%> (+0.62%)` | :arrow_up: |
   
   ... and [1731 files with indirect coverage changes](https://app.codecov.io/gh/apache/gobblin/pull/3694/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: dev-unsubscribe@gobblin.apache.org

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


[GitHub] [gobblin] phet commented on a diff in pull request #3694: [GOBBLIN-1831] Use flowexecutionid in kafka monitor and jobnames

Posted by "phet (via GitHub)" <gi...@apache.org>.
phet commented on code in PR #3694:
URL: https://github.com/apache/gobblin/pull/3694#discussion_r1189465710


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/job_monitor/KafkaJobMonitor.java:
##########
@@ -136,14 +138,30 @@ protected void processMessage(DecodeableKafkaRecord<byte[],byte[]> message) {
             break;
           case DELETE:
             this.removedSpecs.mark();
-            URI jobSpecUri = parsedMessage.getUri();
-            this.jobCatalog.remove(jobSpecUri);
+            this.jobCatalog.remove(parsedMessage.getUri());
             // Delete the job state if it is a delete spec request
-            deleteStateStore(jobSpecUri);
+            deleteStateStore(parsedMessage.getUri());
             break;
           case CANCEL:
-            this.cancelledSpecs.mark();
-            this.jobCatalog.remove(parsedMessage.getUri(), true);
+            // Validate that the flow execution ID of the running flow matches the one in the incoming job spec
+            URI specUri = parsedMessage.getUri();
+            if (!parsedMessage.getConfig().hasPath(ConfigurationKeys.FLOW_EXECUTION_ID_KEY)) {
+              this.cancelledSpecs.mark();
+              this.jobCatalog.remove(specUri, true);
+            } else {
+              try {
+                JobSpec spec = this.jobCatalog.getJobSpec(specUri);
+                String flowIdToCancel = parsedMessage.getConfig().getString(ConfigurationKeys.FLOW_EXECUTION_ID_KEY);
+                if (spec.getConfig().getString(ConfigurationKeys.FLOW_EXECUTION_ID_KEY).equals(flowIdToCancel)) {
+                  this.cancelledSpecs.mark();
+                  this.jobCatalog.remove(specUri, true);
+                } else {
+                  log.warn("Could not find job spec {} with flow execution ID {} to cancel", specUri, flowIdToCancel);

Review Comment:
   let's log what the value of `spec.getConfig().getString(ConfigurationKeys.FLOW_EXECUTION_ID_KEY)` actually is.
   
   also, could this ever be `null`?



-- 
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: dev-unsubscribe@gobblin.apache.org

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