Alexander-Aghili commented on PR #15055:
URL: https://github.com/apache/kafka/pull/15055#issuecomment-1868724094
Hi @philipnee, thank you for the feedback! I am a newbie so the guidance is
appreciated. I used a lot of the concepts from your refactor but edited some
components to make it more readable. However, I have a problem with the
testApplyPartialMetadataLeaderUpdate test. For some reason, the behavior is not
as expected and I'm not exactly sure why. To be specific, the test fails with
the following error:
`org.opentest4j.AssertionFailedError: expected:
<LeaderAndEpoch{leader=Optional[localhost:1971 (id: 2 rack: null)], epoch=200}>
but was: <LeaderAndEpoch{leader=Optional.empty, epoch=200}>
`
on the assertion:
[`assertEquals(expectedLeaderInfo, updatedMetadata.currentLeader(tp));
`](https://github.com/Alexander-Aghili/kafka/blob/Kafka-16027/clients/src/test/java/org/apache/kafka/clients/MetadataTest.java?plain=1#L1385)
It seems that partition 2 (of 2) in topic 1 is updating the metadata
information when it shouldn't. Everything else seems to work fine.
I have narrowed the undesired change down to this line:
[`Set<TopicPartition> updatedTps =
metadata.updatePartitionLeadership(updates, nodes);
`](https://github.com/Alexander-Aghili/kafka/blob/Kafka-16027/clients/src/test/java/org/apache/kafka/clients/MetadataTest.java?plain=1#L1222)
which is not entirely surprising because it is the function that enacts the
partition leadership update within the metadata. It is strange to me though
because the intended effect is "update to partition1's leadership are to be
applied, and no update to partition2(so remains at it is)." but the outcome
seems to be partition 2 is affected.
I'm not sure whether I'm configuring something incorrectly, making an
incorrect assumption in the setup, or if there is some other error.
Thanks for all the help!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]