ableegoldman opened a new pull request #8596: URL: https://github.com/apache/kafka/pull/8596
This patch fixes KAFKA-9821 for Streams by persisting the required rebalance in the assignment. If a member fails and restarts it will receive its last assignment and notify the thread to trigger a new rebalance, even with static membership. Note: in the consumer client, the member who has to _revoke_ some partitions is responsible for triggering the followup rebalance. Here we are actually encoding the required rebalance for the member who was supposed to _receive_ these partitions. Since this only signals to the client to request a rebalance upon the next poll in both cases, and the rebalance schedule is reset in `onAssignment`, this should not result in extra (unnecessary) rebalances even if one member lags the other in requesting this. This patch also consolidates the two rebalancing triggering mechanisms currently used by the Streams partition assignor: the `AssignorError` and the newly introduced `nextScheduleRebalanceMs`. Since the latter encompasses the former, we can remove the `REBALANCE_NEEDED` assignor error and just schedule the next rebalance for `0L` ms to trigger it immediately. This has the nice side effect of removing the only recoverable AssignorError, so we no longer have to worry about handling this error and can just assume it to be fatal and shut down. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org