[GitHub] [kafka] splett2 commented on a diff in pull request #13765: KAFKA-15021; Skip leader epoch bump on ISR shrink

2023-05-26 Thread via GitHub


splett2 commented on code in PR #13765:
URL: https://github.com/apache/kafka/pull/13765#discussion_r1207073563


##
core/src/main/scala/kafka/cluster/Partition.scala:
##
@@ -1087,12 +1087,14 @@ class Partition(val topicPartition: TopicPartition,
 // avoid unnecessary collection generation
 val leaderLogEndOffset = leaderLog.logEndOffsetMetadata
 var newHighWatermark = leaderLogEndOffset
-remoteReplicasMap.values.foreach { replica =>
+remoteReplicasMap.foreachEntry { (replicaId, replica) =>

Review Comment:
   Should we have a test in `PartitionTest` to assert that the HWM is 
incremented when there is a replica that is fenced but 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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [kafka] splett2 commented on a diff in pull request #13765: KAFKA-15021; Skip leader epoch bump on ISR shrink

2023-05-25 Thread via GitHub


splett2 commented on code in PR #13765:
URL: https://github.com/apache/kafka/pull/13765#discussion_r1205862927


##
core/src/main/scala/kafka/cluster/Partition.scala:
##
@@ -1087,12 +1087,14 @@ class Partition(val topicPartition: TopicPartition,
 // avoid unnecessary collection generation
 val leaderLogEndOffset = leaderLog.logEndOffsetMetadata
 var newHighWatermark = leaderLogEndOffset
-remoteReplicasMap.values.foreach { replica =>
+remoteReplicasMap.foreachEntry { (replicaId, replica) =>

Review Comment:
   can we use `remoteReplicasMap.values` here and use the replica.brokerId 
similar to the maximalIsr.contains call?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org