dajac commented on code in PR #22512:
URL: https://github.com/apache/kafka/pull/22512#discussion_r3421610572
##########
clients/src/main/java/org/apache/kafka/clients/NetworkClient.java:
##########
@@ -1140,8 +1140,11 @@ private void handleInitiateApiVersionRequests(long now) {
int nodeId = Integer.parseInt(node);
// In order to allow separate connections to coordinators,
the client uses large positive node ID values
// (Integer.MAX_VALUE - nodeId) for these connections
which do not match the target broker's actual node ID.
- // To avoid those, only check if the node ID is less than
half of Integer.MAX_VALUE.
- if (clusterId != null && nodeId >= 0 && nodeId <
Integer.MAX_VALUE / 2) {
+ // We can get the real node ID by subtracting from
Integer.MAX_VALUE.
+ if (nodeId > Integer.MAX_VALUE / 2) {
Review Comment:
Could we override `idString` in `Node` to be `coordinator-{id}` to force the
creating of a new connection without hacking the id?
--
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]