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 refactoring #4541

Open
BorysTheDev opened this issue Jan 31, 2025 · 0 comments
Open

Cluster refactoring #4541

BorysTheDev opened this issue Jan 31, 2025 · 0 comments
Assignees

Comments

@BorysTheDev
Copy link
Contributor

Problem: we have a lot of methods that use a vector of migrations and because migrations can be removed we need to lock mutex in all these methods
Solution: make the vector of migrations unchangeable. We already consider the slot migration process as part of the config, so we can use absolutely the same approach, as we use for config, for the vector of migrations and store it in the config or create a thread_local ptr for it. In this case, we don't need any synchronization to operate with migrations and use mutex only in the case when the config is updated (during DFLYCLUSTER CONFIG command and migration finalization).

Other improvements:

  1. make the interface of incoming and outgoing migration more similar or even make an ancestor
  2. make flush slots in one place for all migrations and config, during DFLYCLUSTER CONFIG command
  3. instead of migration_mu_ we can use set_config_mu_ without any issues.
  4. update streamer
  5. refactor DflyClusterGetSlotInfo do simple atomic::add(relaxed) instead of a mutex
  6. remove unused code:
  • auto host_ip = cntx->conn()->RemoteEndpointAddress();
  • #include
  1. need to rewrite SlotRanges::Merge() because it is slow and call under mutex
  2. move tl_cluster_config out of cluster_family into cluster_config
@BorysTheDev BorysTheDev self-assigned this Jan 31, 2025
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

No branches or pull requests

1 participant