You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/03/19 22:55:59 UTC

[GitHub] [kafka] lizthegrey commented on a change in pull request #10326: Avoid newly replicating brokers in RackAwareReplicaSelector

lizthegrey commented on a change in pull request #10326:
URL: https://github.com/apache/kafka/pull/10326#discussion_r598012870



##########
File path: core/src/main/scala/kafka/server/ReplicaManager.scala
##########
@@ -1263,7 +1263,7 @@ class ReplicaManager(val config: KafkaConfig,
             .map(replica => new DefaultReplicaView(
               replicaEndpoints.getOrElse(replica.brokerId, Node.noNode()),
               replica.logEndOffset,
-              currentTimeMs - replica.lastCaughtUpTimeMs))
+              if (replica.lastCaughtUpTimeMs == 0) Long.MaxValue else currentTimeMs - replica.lastCaughtUpTimeMs))

Review comment:
       the consideration here is: (1) that the caught up time should reflect a real value, rather than currentTimeMs which is clearly the wrong value for "time since last caught up), and (2) there may be other third-party ReplicaSelectors we don't know about floating out there, that are depending upon the time since last caught up (or want to have the option to access replicas that never caught up).




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