lucasbru commented on code in PR #22493:
URL: https://github.com/apache/kafka/pull/22493#discussion_r3374910494


##########
clients/src/main/java/org/apache/kafka/clients/admin/internals/AdminApiDriver.java:
##########
@@ -188,6 +188,19 @@ private void retryLookup(Collection<K> keys) {
         keys.forEach(this::unmap);
     }
 
+    /**
+     * Send the keys of a fulfillment request back to the Lookup stage. This 
is invoked when a
+     * fulfillment request cannot be routed because its target broker is no 
longer present in the
+     * cluster metadata, for example when a stale entry in the partition 
leader cache pointed at a
+     * broker that has since left the cluster. Re-running the lookup gives us 
a chance to discover
+     * the current leader. Without this, such a request would remain 
unassignable until the request
+     * deadline expires.
+     */
+    public void retryLookup(long currentTimeMs, RequestSpec<K> spec) {
+        clearInflightRequest(currentTimeMs, spec);
+        retryLookup(spec.keys);
+    }

Review Comment:
   Done — retryLookup now returns a boolean and is a no-op for fixed-broker 
lookup strategies, so the caller only takes corrective action when the keys 
actually moved back to the lookup stage.



-- 
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]

Reply via email to