CalvinConfluent opened a new pull request, #17619:
URL: https://github.com/apache/kafka/pull/17619

   The replica manager append should not be called if there are no records to 
append.
   Consider the following case:
   
   We have 2 markers to append, one for producer-0, one for producer-1
   When we first process producer-0, it appends a marker to the 
__consumer_offset.
   The __consumer_offset append finishes very fast because the group 
coordinator is no longer the leader. So the coordinator directly returns 
NOT_LEADER_OR_FOLLOWER. In its callback, it calls the maybeComplete() for the 
first time, and because it has finished processing all its markers, it is able 
to go further to call maybeSendResponseCallback() and decrement numAppends.
   Then it calls the replica manager append for nothing, in the callback, it 
calls the maybeComplete() for the second time. This time, it also decrements 
numAppends.
   Remember, because we only have 2 markers, the initial value for numAppends 
is also 2. So in step 4, it is able to finish the request without even 
processing producer-1. This will cause the producer-1 missing from the 
WriteTxnMarkers response.
   
   Note: the problem only happens with KIP-848 coordinator enabled.
   
   https://issues.apache.org/jira/browse/KAFKA-17877


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