Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Conversation

@BewareMyPower
Copy link
Collaborator

Motivation

After #1107 was cherry-picked into branch-2.8.2, some tests of KafkaListenerNameTest are failed. Because that PR forgot to migrate the following code:

synchronized (allNodes) {
if (!allNodes.stream().anyMatch(node1 -> node1.equals(newNode))) {
allNodes.add(newNode);
}
}

After that when the advertised listener is different with the listener, the brokers field in MetadataResponse doesn't contain the advertised listener, while the leader and ISR in MetadataResponse.PartitionMetadata use the advertised listener. Then Kafka client won't be able to find the advertised listener in brokers field.

Modifications

Add the partition leader's node to the brokers field if the brokers field doesn't contain the node.

@BewareMyPower
Copy link
Collaborator Author

We should also investigate why the tests in master and branch-2.9.2 succeeded.

@BewareMyPower
Copy link
Collaborator Author

BewareMyPower commented Mar 7, 2022

It looks like in master branch, as well as branch-2.9.2 and branch-2.10.0, the leader and ISR fields both use the listener (0.0.0.0:15003) but not the advertised listener (localhost:15003). This behavior has already been introduced before #1107.

image

However, in branch-2.8.2, the leader and ISR fields use the advertised listener (localhost:15003).

image

@BewareMyPower BewareMyPower merged commit 09f1024 into branch-2.8.2 Mar 8, 2022
@BewareMyPower BewareMyPower deleted the bewaremypower/2.8.2-fix-all-nodes branch March 8, 2022 02:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants