storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [storm] agresch commented on a change in pull request #3133: STORM-3516 Kill or Rebalance Topology not processed on Nimbus restart
Date Wed, 02 Oct 2019 19:53:35 GMT
agresch commented on a change in pull request #3133: STORM-3516 Kill or Rebalance Topology
not processed on Nimbus restart
URL: https://github.com/apache/storm/pull/3133#discussion_r330740194
 
 

 ##########
 File path: storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java
 ##########
 @@ -1328,12 +1329,24 @@ public void launchServer() throws Exception {
                 exec.prepare();
             }
 
-            if (isLeader()) {
-                for (String topoId : state.activeStorms()) {
-                    transition(topoId, TopologyActions.STARTUP, null);
-                }
-                clusterMetricSet.setActive(true);
-            }
+            // Leadership coordination may be incomplete when launchServer is called. Previous
behavior did a one time check
+            // which could cause Nimbus to not process TopologyActions.STARTUP transitions.
Similar problem exists for
+            // HA Nimbus on being newly elected as leader. Change to a recurring pattern
addresses these problems.
+            timer.scheduleRecurring(3, 5,
+                () -> {
+                    try {
+                        boolean isLeader = isLeader();
+                        if (isLeader && !wasLeader) {
+                            for (String topoId : state.activeStorms()) {
 
 Review comment:
   I'm sorry.  I misread this while looking at the old code separately.  

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


With regards,
Apache Git Services

Mime
View raw message