kafka
kafka copied to clipboard
KAFKA-19331: Fix misleading log messages when follower's leader is not in metadata image
Problem
When a partition transitions to a follower role but its leader broker is not present in the MetadataImage, the broker logs a misleading message stating it "Started fetchers for N partitions" even though no fetcher was actually started for partitions whose leader is unavailable.
Change
Only log "Started fetchers" when partitionAndOffsets is non-empty, avoiding misleading success messages when no fetchers were started.