KAFKA-16514: backdoor for modifying internal leave.group.on.close config #15819
+32
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
POC for one option to fix the issue described in KAFKA-16514
This is definitely a hacky approach to introduce a backdoor solely for Kafka Streams to implement its special close semantics. But to be fair, that is exactly the same thing that happens right now, except that instead of a backdoor internal method we have a backdoor internal ConsumerConfig (ie "leave.group.on.close"). This just adds a way to modify that config so Kafka Streams operators can decide at close time whether they want to leave the group or not.
For example, a Streams application may want to scale in by permanently stopping some nodes, in which case the consumers should all immediately leave the group. However it may also want to simply bounce the node, in which case it makes sense to not leave the group when closed. Both are valid scenarios but having to choose one up front when the consumer is first created due to the immutability of configs means that in practice, users are forced to guess which one they will want/need and can't decide at close time.