AndrewJSchofield commented on code in PR #14916: URL: https://github.com/apache/kafka/pull/14916#discussion_r1415479462
########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java: ########## @@ -3496,53 +3501,52 @@ public void testWhenFetchResponseReturnsWithALeaderShipChangeErrorButNoNewLeader FetchResponse.INVALID_LAST_STABLE_OFFSET, 0, Optional.of(nodeId0.id())), tp1Leader); consumerClient.poll(time.timer(0)); assertTrue(fetcher.hasCompletedFetches()); - Map<TopicPartition, List<ConsumerRecord<byte[], byte[]>>> partitionRecords = fetchRecords(); assertTrue(partitionRecords.containsKey(tp0)); assertTrue(partitionRecords.containsKey(tp1)); - - // Verify that preferred read replica is set for both tp0 & tp1. + // Validate setup of preferred read replica for tp0 & tp1 is done correctly. Node selected = fetcher.selectReadReplica(tp0, Node.noNode(), time.milliseconds()); assertEquals(nodeId0.id(), selected.id()); selected = fetcher.selectReadReplica(tp1, Node.noNode(), time.milliseconds()); assertEquals(nodeId0.id(), selected.id()); - // Next fetch returns an error(due to leadership change) but new leader info is missing, for tp0. - // For tp1 fetch returns with no error. + // Send next fetch request. assertEquals(1, sendFetches()); assertFalse(fetcher.hasCompletedFetches()); - // Verify that metadata-update isn't requested + // Verify that metadata-update isn't requested as metadata is considered upto-date. Review Comment: "up to date" -- 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