Send client state to cluster in reconnections [API-1564] #613
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.
In split-brain scenarios, the cluster id stays the same for different halves of the split.
When the client disconnects from the first half it was connected to and reconnects to the other half, from the point of view of the client, it connects to the same cluster.
However, it might very well be the case that, the client has sent some state to the first half of the cluster, and that state must be replicated to the other half when the client reconnects to it.
This is especially needed for Compact schemas.
In this PR, we are sending the client state to the cluster after reconnections, regardless it is connected back to possibly the same cluster with the same id or not.
We couldn't add proper split brain tests, as the remote controller does not have that ability yet. However, I have added a simple test that verifies the current behavior.
closes #575