zhangmeng916 commented on a change in pull request #1124:
URL: https://github.com/apache/helix/pull/1124#discussion_r456154161
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
##########
@@ -77,15 +84,19 @@ public void process(ClusterEvent event) throws Exception {
String instanceName = instance.getInstanceName();
String instanceSessionId = instance.getEphemeralOwner();
- // update pending messages
- Map<String, Message> messages = cache.getMessages(instanceName);
- Map<String, Message> relayMessages =
cache.getRelayMessages(instanceName);
- updatePendingMessages(instance, messages.values(), currentStateOutput,
relayMessages.values(), resourceMap);
-
// update current states.
Map<String, CurrentState> currentStateMap =
cache.getCurrentState(instanceName,
instanceSessionId);
updateCurrentStates(instance, currentStateMap.values(),
currentStateOutput, resourceMap);
+
+ Map<String, Map<String, Message>> existingStaleMessages =
cache.getStaleMessages();
+ currentStateOutput.setStaleMessageMap(existingStaleMessages);
+ // update pending messages
+ Map<String, Message> messages = cache.getMessages(instanceName);
+ Map<String, Message> relayMessages =
cache.getRelayMessages(instanceName);
+ updatePendingMessages(instance, messages.values(), currentStateOutput,
+ relayMessages.values(), resourceMap, existingStaleMessages);
+ cache.setStaleMessages(currentStateOutput.getStaleMessageMap());
Review comment:
The stale message is periodically cleaned up the same way as `pending
message`, and the logic is in message generation phase.
If controller switch happens, the in memory data is just lost right? Then
all stale messages are automatically cleaned up. Any concern?
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]