You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/10/21 22:40:20 UTC

[GitHub] [incubator-gobblin] jack-moseley opened a new pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

jack-moseley opened a new pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135


   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
   - [x] 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-1297
   
   
   ### Description
   - [x] Here are some details about my PR, including screenshots (if applicable):
   To be able to kill a flow, the eventbus in GobblinServiceManager must be registered with the dagManager, but this currently only happens on startup. On leadership change, the eventbus of the new leader should be registered and the eventbus of the slave should be unregistered.
   
   ### Tests
   - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   Trivial
   
   ### Commits
   - [x] 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.

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



[GitHub] [incubator-gobblin] sv2000 commented on pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
sv2000 commented on pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#issuecomment-715490695


   @jack-moseley There is a travis failure. Can you take a look?


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

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



[GitHub] [incubator-gobblin] codecov-io commented on pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#issuecomment-713966243


   # [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3135?src=pr&el=h1) Report
   > Merging [#3135](https://codecov.io/gh/apache/incubator-gobblin/pull/3135?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/73a2a1c945918a6a606b1c467fcac099d40a0f7e?el=desc) will **decrease** coverage by `4.28%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/graphs/tree.svg?width=650&height=150&src=pr&token=4MgURJ0bGc)](https://codecov.io/gh/apache/incubator-gobblin/pull/3135?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3135      +/-   ##
   ============================================
   - Coverage     46.02%   41.73%   -4.29%     
   + Complexity     9583     8736     -847     
   ============================================
     Files          1986     1986              
     Lines         75808    75810       +2     
     Branches       8446     8446              
   ============================================
   - Hits          34890    31643    -3247     
   - Misses        37641    41149    +3508     
   + Partials       3277     3018     -259     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/3135?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...in/service/modules/core/GobblinServiceManager.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1zZXJ2aWNlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3NlcnZpY2UvbW9kdWxlcy9jb3JlL0dvYmJsaW5TZXJ2aWNlTWFuYWdlci5qYXZh) | `56.70% <0.00%> (-0.40%)` | `26.00 <0.00> (+1.00)` | :arrow_down: |
   | [.../org/apache/gobblin/util/filters/HiddenFilter.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi11dGlsaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3V0aWwvZmlsdGVycy9IaWRkZW5GaWx0ZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-5.00%)` | |
   | [...g/apache/gobblin/cluster/HelixMessageSubTypes.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvSGVsaXhNZXNzYWdlU3ViVHlwZXMuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [...gobblin/runtime/mapreduce/GobblinOutputFormat.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbWFwcmVkdWNlL0dvYmJsaW5PdXRwdXRGb3JtYXQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-2.00%)` | |
   | [.../gobblin/compaction/suite/CompactionSuiteBase.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb21wYWN0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbXBhY3Rpb24vc3VpdGUvQ29tcGFjdGlvblN1aXRlQmFzZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-10.00%)` | |
   | [...obblin/compaction/source/CompactionFailedTask.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb21wYWN0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbXBhY3Rpb24vc291cmNlL0NvbXBhY3Rpb25GYWlsZWRUYXNrLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-3.00%)` | |
   | [...n/cluster/event/ClusterManagerShutdownRequest.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvZXZlbnQvQ2x1c3Rlck1hbmFnZXJTaHV0ZG93blJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [...blin/compaction/mapreduce/RecordKeyMapperBase.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb21wYWN0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbXBhY3Rpb24vbWFwcmVkdWNlL1JlY29yZEtleU1hcHBlckJhc2UuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [...in/compaction/action/CompactionCompleteAction.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb21wYWN0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbXBhY3Rpb24vYWN0aW9uL0NvbXBhY3Rpb25Db21wbGV0ZUFjdGlvbi5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
   | [...n/compaction/mapreduce/orc/OrcKeyDedupReducer.java](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree#diff-Z29iYmxpbi1jb21wYWN0aW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NvbXBhY3Rpb24vbWFwcmVkdWNlL29yYy9PcmNLZXlEZWR1cFJlZHVjZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-10.00%)` | |
   | ... and [152 more](https://codecov.io/gh/apache/incubator-gobblin/pull/3135/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3135?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/3135?src=pr&el=footer). Last update [73a2a1c...fc5c150](https://codecov.io/gh/apache/incubator-gobblin/pull/3135?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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

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



[GitHub] [incubator-gobblin] jack-moseley commented on a change in pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on a change in pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#discussion_r510489268



##########
File path: gobblin-service/src/test/java/org/apache/gobblin/service/modules/core/GobblinServiceHATest.java
##########
@@ -546,6 +551,30 @@ public void testKillNode() throws Exception {
 
     Assert.assertTrue(assertSuccess, "New master should take over all old master jobs.");
 
+    // Check eventbus was registered with new leader
+    attempt = 0;
+    assertSuccess = false;
+    while (attempt < 10) {
+      try {
+        Mockito.verify(secondary.getEventBus(), Mockito.atLeastOnce()).register(secondary.getDagManager());
+        assertSuccess = true;
+      } catch (MockitoAssertionError e) {
+        logger.info("Verification failed", e);
+      }
+      Thread.sleep(5);

Review comment:
       Didn't notice it was ms, but changed to assertwithbackoff with 20 second timeout




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

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



[GitHub] [incubator-gobblin] jack-moseley commented on a change in pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on a change in pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#discussion_r510481739



##########
File path: gobblin-service/src/test/java/org/apache/gobblin/service/modules/core/GobblinServiceHATest.java
##########
@@ -546,6 +551,30 @@ public void testKillNode() throws Exception {
 
     Assert.assertTrue(assertSuccess, "New master should take over all old master jobs.");
 
+    // Check eventbus was registered with new leader
+    attempt = 0;
+    assertSuccess = false;
+    while (attempt < 10) {

Review comment:
       How would you use AssertWithBackoff for a method that is throwing an exception instead of returning true/false? I guess only way is to wrap it in another method.




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

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



[GitHub] [incubator-gobblin] asfgit closed pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135


   


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

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



[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#discussion_r509778219



##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java
##########
@@ -417,6 +417,7 @@ private void  handleLeadershipChange(NotificationContext changeContext) {
         //Activate DagManager only if TopologyCatalog is initialized. If not; skip activation.
         if (this.topologyCatalog.getInitComplete().getCount() == 0) {
           this.dagManager.setActive(true);
+          this.eventBus.register(this.dagManager);

Review comment:
       Any chance we can update GobblinServiceHATest to verify that on leadership change the dagManager has been registered with the eventbus? e.g. construct a mock DagManager and pass it to GobblinServiceManager for it to register the mock dag manager?




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

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



[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#discussion_r509866160



##########
File path: gobblin-service/src/test/java/org/apache/gobblin/service/modules/core/GobblinServiceHATest.java
##########
@@ -546,6 +551,30 @@ public void testKillNode() throws Exception {
 
     Assert.assertTrue(assertSuccess, "New master should take over all old master jobs.");
 
+    // Check eventbus was registered with new leader
+    attempt = 0;
+    assertSuccess = false;
+    while (attempt < 10) {

Review comment:
       AssertWithBackoff instead of while(..) {..sleep(..)}?

##########
File path: gobblin-service/src/test/java/org/apache/gobblin/service/modules/core/GobblinServiceHATest.java
##########
@@ -546,6 +551,30 @@ public void testKillNode() throws Exception {
 
     Assert.assertTrue(assertSuccess, "New master should take over all old master jobs.");
 
+    // Check eventbus was registered with new leader
+    attempt = 0;
+    assertSuccess = false;
+    while (attempt < 10) {
+      try {
+        Mockito.verify(secondary.getEventBus(), Mockito.atLeastOnce()).register(secondary.getDagManager());
+        assertSuccess = true;
+      } catch (MockitoAssertionError e) {
+        logger.info("Verification failed", e);
+      }
+      Thread.sleep(5);
+      attempt ++;
+    }
+    Assert.assertTrue(assertSuccess, "New master should take over all old master jobs.");

Review comment:
       The error message here does not look right. Maybe "New master should have registered the dagmanager with eventbus"?




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

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



[GitHub] [incubator-gobblin] jack-moseley commented on pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#issuecomment-715529159


   Looks unrelated to my change, I will try rebuilding since the gradle changes have been reverted.


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

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



[GitHub] [incubator-gobblin] jack-moseley commented on pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#issuecomment-713918844


   @sv2000 please review


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

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



[GitHub] [incubator-gobblin] aplex commented on a change in pull request #3135: [GOBBLIN-1297] Register/unregister eventbus with dagManager on leadership change

Posted by GitBox <gi...@apache.org>.
aplex commented on a change in pull request #3135:
URL: https://github.com/apache/incubator-gobblin/pull/3135#discussion_r510328028



##########
File path: gobblin-service/src/test/java/org/apache/gobblin/service/modules/core/GobblinServiceHATest.java
##########
@@ -546,6 +551,30 @@ public void testKillNode() throws Exception {
 
     Assert.assertTrue(assertSuccess, "New master should take over all old master jobs.");
 
+    // Check eventbus was registered with new leader
+    attempt = 0;
+    assertSuccess = false;
+    while (attempt < 10) {
+      try {
+        Mockito.verify(secondary.getEventBus(), Mockito.atLeastOnce()).register(secondary.getDagManager());
+        assertSuccess = true;
+      } catch (MockitoAssertionError e) {
+        logger.info("Verification failed", e);
+      }
+      Thread.sleep(5);

Review comment:
       The test makes 10 attempts with 5ms intervals. Is 50ms enough for the switch to happen on a busy test machine with high CPU usage? Looks like this can be a source of flakiness for the test.




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

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