KafkaSinkCluster split DeleteGroups request #1785
Merged
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.
Testing
The integration test demonstrates an issue without the code changes, but only in the java driver and the test still passes, you have to inspect the messages to see there is in issue.
The java driver will actually retry failed portions of the request, leading to the following exchange:
While the operation succeeds eventually and the integration test still passes, this is still an issue since all the retries:
The cpp driver on the other hand does not reproduce the issue at all.
Instead it just sends each group id to delete in its own unique request, avoiding the need for shotover to split it at all.
Implementation
Since the DeleteGroups message is very simple, the split/combine implementation is much simpler than for message types like fetch and produce.
We just split the list of group ids to delete across different requests by their destination broker.
And then recombine all the responses into a single response
Misc fix in connection/kafka/cpp.rs
A bug slipped through in #1784 where the cpp delete_groups method had a hardcoded list of groups to delete. The fix was to simply use the to_delete list argument instead.