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 2022/01/26 19:06:39 UTC

[GitHub] [helix] NealSun96 commented on a change in pull request #1944: Fix for - Stale message redundant logs #1940

NealSun96 commented on a change in pull request #1944:
URL: https://github.com/apache/helix/pull/1944#discussion_r792954535



##########
File path: helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
##########
@@ -200,9 +200,10 @@ private void generateMessage(final Resource resource, final BaseControllerDataPr
         }
 
         for (Message staleMessage : staleMessages) {
-          if (System.currentTimeMillis() - currentStateOutput
+          if ((System.currentTimeMillis() - currentStateOutput
               .getEndTime(resourceName, partition, instanceName)
-              > DEFAULT_OBSELETE_MSG_PURGE_DELAY) {
+              > DEFAULT_OBSELETE_MSG_PURGE_DELAY)
+              && staleMessage.getResourceName().equals(resourceName)) {

Review comment:
       Since this logic is under per-resource, per-partition and per-instance condition, we should also check whether the staleMessage's corresponding partition matches the current `partition`, on top of checking resource. Otherwise, if the instance has multiple partitions of this resource, this log will still be duplicate. 




-- 
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: reviews-unsubscribe@helix.apache.org

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