KAFKA-20118: Improve the error message caused by normally moving replica#21470
Open
Parkerhiphop wants to merge 1 commit intoapache:trunkfrom
Open
KAFKA-20118: Improve the error message caused by normally moving replica#21470Parkerhiphop wants to merge 1 commit intoapache:trunkfrom
Parkerhiphop wants to merge 1 commit intoapache:trunkfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Currently, when a broker receives a
LeaderAndIsrRequestfor apartition it does not yet host—most commonly during a partition
reassignment or new topic creation—it logs a high-severity ERROR
message:
ERROR [Broker id=$brokerId] Expected partition $tp with topic id $topicId to exist, but it was missing. Creating...This message is misleading to operators as it implies a state of
inconsistency or data loss ("missing," "expected to exist"), when in
fact the behavior is a normal part of the partition lifecycle. During a
move, the destination broker is expected not to have the partition
locally until the transition begins.
Changes:
rather than the "missing" state.
partition reassignment and initial topic creation scenarios.
Impact:
Reduces "log noise" and prevents false-positive alerts in monitoring
systems that trigger on ERROR strings in the state.change.logger.
How to Reproduce
This scenario simulates a standard Cluster Expansion or Partition
Reassignment.
share the same controller quorum.
bin/kafka-topics.sh --create --topic reproduction-test --bootstrap-server localhost:9092 --replica-assignment 1Run a command to create a topic explicitly assigned to Broker 1. At
this point, Broker 2 knows nothing about this partition.
./bin/kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --reassignment-json-file move.json --executecat /tmp/kafka-logs-2-logs/state-change.log❌ BEFORE (Current Misleading ERROR)
The ERROR level and the word "missing" falsely imply a system failure
during a routine move.
✅ AFTER (This PR)
The log is now a neutral INFO and accurately describes the
initialization of a new replica, consistent with the surrounding
lifecycle logs.