Anti-Affinity Placement Strategy for Oxia Cluster #658
mattisonchao
started this conversation in
Proposal
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Anti-Affinity Placement Strategy for Oxia Cluster
Backgound
In the current implementation, we can only distribute shards to different oxia servers (nodes), which can not satisfy multi-AZ requirements.
Goals
This PR supports a label-based anti-affinity shards placement policy. Which can set the constraints for shard distribution by customized labels.
In the diagram above, we introduced three shards as examples. Two of them have an anti-affinity policy, and one of them does not.
the shard placement is as follows:
Implementation
Metadata
This proposal defines a metadata and labels and policies structure to carry more information for server.
Selector
This proposal defines a concept that can select an ensemble by different policies and implementations.
Merged Selector
This is the wrapper selector. It will go through the whole selector chain to choose satisfied candidates. And will ensure the selected replica quantity is expected.
Anti-Affinity Selector
The Anti-Affinity Selector uses policy-defined labels to identify and select suitable candidates for scheduling.
ServerIdx Selector
In scenarios where the number of satisfied candidates exceeds the expected number, the
ServerIdxSelector
utilises incremental seeds to select the desired quantity of ensembles.Observeralbility
oxia_coordinator_node_running
metric.leaderElectionLatency
andleaderElectionsFailed
metrics.Backward & Forward Compatibility
No anti-affinity policy
There's no side effect if the existing cluster didn't configure the anti-affinity policy.
Configured anti-affinity policy
The new policy only applies to load balancing when moving shards to other nodes. Therefore, it does not affect leader election, but only the shard moving itself for the existing shards.
Beta Was this translation helpful? Give feedback.
All reactions