You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/06/05 21:27:11 UTC

[GitHub] [helix] dasahcc commented on a change in pull request #1066: [WIP] Prevent parallel controller pipelines run causing two master replicas

dasahcc commented on a change in pull request #1066:
URL: https://github.com/apache/helix/pull/1066#discussion_r436170779



##########
File path: helix-core/src/main/java/org/apache/helix/controller/stages/MessageDispatchStage.java
##########
@@ -78,7 +78,13 @@ protected void processEvent(ClusterEvent event, MessageOutput messageOutput) thr
         batchMessage(dataAccessor.keyBuilder(), messagesToSend, resourceMap, liveInstanceMap,
             manager.getProperties());
 
-    List<Message> messagesSent = sendMessages(dataAccessor, outputMessages);
+    String expectedSession = event.getAttribute(AttributeName.CONTROLLER_LEADER_SESSION.name());
+    // An early check for expected leader session. If the sessions don't match, it means the
+    // controller lost leadership, then messages should not be sent. This potentially avoid
+    // double masters for a single partition.
+    List<Message> messagesSent = manager.getSessionId().equals(expectedSession)

Review comment:
       Shall we throw an exception to break the pipeline? If we know session is not matched. Then there is no reason to keep following pipeline based on stale data.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org