cmccabe commented on PR #13643:
URL: https://github.com/apache/kafka/pull/13643#issuecomment-1636107554

   > Regarding the failure case where the end offset of a batch is not equal to 
what the controller expected, will this only happen if a raft election occurred 
that was not initiated by a resignation? What are the circumstances when this 
can happen? Raft timeouts?
   >
   > IIUC, when an election happens in the middle of an atomic batch, the batch 
will be lost anyways. The node will finish writing the batch to the local log 
at epoch N, then process the new leader at N+1, and then it will truncate its 
own log once it fetches from the new leader at N+1 and sees the start offset 
for the epoch is less than its own end offset. Is that about right?
   
   There's been some discussion of adding more Raft internal control records. 
One example is if we wanted to implement a dynamic change-of-quorum mechanism. 
There would probably be internal Raft records associated with that. It's not 
clear whether change-of-quorum events would also always involve a leader change 
-- I think in some cases they would not.
   
   Like I said earlier, if we end up adding more background raft messages, we 
might introduce some mechanism for the active controller to get an "offset 
lock" so it can get an offset, replay the records, and then try to commit them 
under that lock. That would minimize failovers caused by these background 
messages. But since they don't exist today, we can avoid that for today.


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to