This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
issue-1423: cluster-osc-slaves API may not return all required slaves #1428
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.
#1423
The new algorithm implemented:
Stage 1: 1st tier servers.
Get up to two 1st tier servers from each DC in the following order:
Most busiest IMs
Most lagging leaf nodes
Examples:
If there are N > 1 IMs in the DC, we will use the 2 busiest ones
(having the highest number of replicas)
If there is only 1 IM in the DC, but there are some leaf nodes,
we will use IM + most lagging leaf node
If there are no IMs in the DC, but there are leaf nodes, we will use
up to two most lagging leaf nodes
So this stage will collect at most 2 servers per DC
Stage 2: 2nd tier servers
Examine all collected 1st tier servers (from Stage 1),
and if they are IMs, get at most two busiest replicas for each server
(2nd tier servers).
So this stage will collect at most 2 replicas per IM.
If we collected 2 IMs per DC in Stage 1, here we will get 4 servers
per DC.
Stage 3: 3rd tier servers
Get 2 busiest 3rd tier replicas per DC.
If replicas are leaves we get the replica with a larger lag.
So this stage will collect at most 2 servers per DC
Added new tests 'get-heuristic-lag-multi-dc' and
'which-cluster-ocs-replicas'