Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster configuration merge protection #698

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

vazois
Copy link
Contributor

@vazois vazois commented Oct 2, 2024

This PR improves the merge config implementation to make it more robust in the presence of multiple back-to-back migration operations. It contains the following.

  • Updated merge config implementation which separates merging of the worker metadata and the slotMap information. Currently, the slotMap at the receive node will only consider the slots owned by the sender node and update the ownership information only if the slot is in STABLE state, and the previous owner of the slot has a lower config epoch.
  • Added a test case that stresses config merge implementation.
  • Improved MIGRATE SLOTS option by ensuring that the target node safely (under lock) receives the most updated config information while the slot exchange occurs. This way we avoid configuration divergence in the presence of config epoch collisions.

Description:
When a node receives a gossip message from a remote node it attempts to merge the incoming configuration to that of the local copy. This happens in two steps as follows:

  1. The local node first updates the workers data structure (within the configuration object) which contains metadata for all known workers. This happens by either creating new worker information if that worker did not exist or updating the existing worker information if the configEpoch for that worker (from the perspective of the sender) is greater than the config epoch of the existing entry in its local copy.

  2. The second step is to merge the slot-map information of the sender config. It does this by considering only those slots which according to the sender are in stable state, are claimed by the sender itself and for which the previous owner’s epoch (if there was a previous owner) is lesser than the sender’s (claimant’s) epoch.

The second step is very important because we don't want some node updating the slot map ownership for another node, especially during migration where slot exchange needs to be coordinated between the source and target nodes.

@vazois vazois force-pushed the vazois/migrate-stress branch 5 times, most recently from 925ede8 to b8fd6d2 Compare October 17, 2024 23:47
@vazois vazois force-pushed the vazois/migrate-stress branch 11 times, most recently from a71ffad to f9a21c4 Compare October 28, 2024 17:20
@vazois vazois marked this pull request as ready for review October 28, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants