[ https://issues.apache.org/jira/browse/KAFKA-7680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733561#comment-16733561 ]
Guozhang Wang commented on KAFKA-7680: -------------------------------------- [~NIzhikov] To emulate a leader change, the easiest way is to simply shutdown the current leader: more specifically, say you setup with 3 brokers, and a topic with one partition and three replicas, broker0 is the leader and broker1/2 are the followers. By shutting down broker0 the new leader will be auto migrated to broker1 or broker2. However, to reproduce this issue it needs a bit more on that, since it requires a replica fetch response in the middle of such event to cause the log divergence. So to consistently reproduce this issue you may need to consider controlling the sequence of different function calls at lower level as well. > fetching a refilled chunk of log can cause log divergence > --------------------------------------------------------- > > Key: KAFKA-7680 > URL: https://issues.apache.org/jira/browse/KAFKA-7680 > Project: Kafka > Issue Type: Bug > Reporter: Jun Rao > Assignee: Nikolay Izhikov > Priority: Major > > We use FileRecords.writeTo to send a fetch response for a follower. A log > could be truncated and refilled in the middle of the send process (due to > leader change). Then it's possible for the follower to append some > uncommitted messages followed by committed messages. Those uncommitted > messages may never be removed, causing log divergence. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)