KENGINE-219: Fix AlterPartition idempotency (#7045)
This PR fixed an AlterPartition idempotency regression introduced in apache/kafka#12032.
When an AlterPartition request succeeds, the partition epoch gets bumped. The sender also relies on the AlterPartition response to be informed of the new partition epoch.
If the sender times out the request before a response is sent, the sender will have a stale partition epoch compared to the controller state and will be fenced on subsequent AlterPartition request attempts.
We work around this by only fencing a leader’s AlterPartition request if the requested leader and ISR is different from the current leader and ISR - making AlterPartition requests idempotent so that the leader can eventually learn the new partition epoch. This check was reordered causing AlterPartition to no longer be idempotent.
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
加载中
想要评论请 注册 或 登录