Repository navigation
Environment
ProblemWhen calling the admin API to get replicated subscription status on a partitioned topic, the broker logs spurious The 307 is expected behavior — it means the broker doesn't own the topic partition and is redirecting the client to the correct broker. The operation succeeds after the redirect. However, it is logged at ERROR level, creating significant log noise in environments with many partitions spread across multiple brokers and frequent monitoring/admin calls. Root causeIn private void internalGetReplicatedSubscriptionStatusForNonPartitionedTopic(...) {
validateTopicOwnershipAsync(topicName, authoritative)
.thenCompose(__ -> getReplicatedSubscriptionStatusFromLocalBroker(topicName, subName))
.whenComplete((res, e) -> {
if (e != null) {
Throwable cause = FutureUtil.unwrapCompletionException(e);
log.error("[{}] Failed to get replicated subscription status on {} {}", clientAppId(),
topicName, subName, cause); // <-- missing isNot307And404Exception check
resumeAsyncResponseExceptionally(asyncResponse, e);
}
});
}Compare with the outer handler at line 5178 which correctly filters out 307 and 404: resultFuture.exceptionally(ex -> {
if (isNot307And404Exception(ex)) {
log.error("[{}] Failed to get replicated subscription status on {} {}", clientAppId(),
topicName, subName, ex);
}
resumeAsyncResponseExceptionally(asyncResponse, ex);
return null;
});The How to triggerThis method is called in two scenarios:
In a setup with a proxy, the proxy forwards the initial request to an arbitrary broker. That broker then fans out per-partition requests directly to other brokers (bypassing the proxy). If the target broker doesn't own the partition (stale metadata, concurrent rebalance), the 307 is thrown and incorrectly logged as ERROR. Suggested fixAdd the .whenComplete((res, e) -> {
if (e != null) {
Throwable cause = FutureUtil.unwrapCompletionException(e);
if (isNot307And404Exception(cause)) {
log.error("[{}] Failed to get replicated subscription status on {} {}", clientAppId(),
topicName, subName, cause);
}
resumeAsyncResponseExceptionally(asyncResponse, e);
} else {
asyncResponse.resume(res);
}
});Impact
|
Thanks for the clear issue report. I've created #26699 to track this.