lucasbru opened a new pull request, #24166: URL: https://github.com/apache/kafka/pull/24166
After a coordinator failover, the coordinator knows neither the heartbeat version nor the task offsets of any member until the member heartbeats again, and the two arrive together. Reading an unknown member as a version 0 member would turn every pending migration of the group into a cold grant, so every failover of a group of new clients would move tasks cold. The refiner therefore keeps the assignment stable while any member has not been heard from since the coordinator loaded the group. In that window, every member that holds a task as an active task keeps it. No task is granted away from its owner: not to a target owner that reports a caught-up copy, not between two members of one process, not to a version 0 target owner, and not away from an owner that is still restoring the task. The move happens in the first refinement step after every member has been heard from, which is a new epoch. This part is needed independently of client versions, and stays needed once every client speaks version 1. The intermediate assignment is kept only in memory and is fixed for its epoch, so whenever the coordinator loads a group in the middle of a refinement step, after a failover, a broker restart or a moved coordinator partition, it derives the intermediate assignment of that epoch again on the first heartbeat. Some members may already have reconciled to the epoch under the old intermediate assignment, and the reconciler sends them nothing new within the epoch. If the rebuilt intermediate assignment moved a task away from such a member, for example because the first heartbeat reports the target owner's warm-up task caught up, that member would never release the task, the target owner would wait for it forever, and the group would not become stable again until a member joins or leaves. Likewise, no new warm-up task is funded in that window: no fresh plant, and no move of a sibling's standby task onto the target owner. This is decided for the whole group rather than per member, since a warm-up task stays once it is planted, so planting on the first members to heartbeat would choose the plants in the order of the heartbeats and not in the order of the load. Warm-up tasks that a member already holds are kept, borrowing a standby task the target owner holds goes on, and tasks that no member holds as an active task are placed as before. Once the last member has been heard from, the derivation is the one the previous coordinator would have made. Only balance migrations wait, for about a heartbeat interval, or for the session timeout if a member is dead. -- 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]
