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

[Backport 1.x] Prioritize primary shard movement during shard allocation #2079

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 6eb8f6f from #1445

When some node or set of nodes is excluded (based on some cluster setting)
BalancedShardsAllocator iterates over them in breadth first order picking 1 shard from
each node and repeating the process until all shards are balanced. Since shards from
each node are picked randomly it's possible the p and r of shard1 is relocated first
leaving behind both p and r of shard2. If the excluded nodes were to go down the
cluster becomes red.

This commit introduces a new setting  "cluster.routing.allocation.move.primary_first"
that prioritizes the p of both shard1 and shard2 first so the cluster does not become
red if the excluded nodes were to go down before relocating other shards. Note that
with this setting enabled performance of this change is a direct function of number
of indices, shards, replicas, and nodes. The larger the indices, replicas, and
distribution scale, the slower the allocation becomes. This should be used with care.

Signed-off-by: Ankit Jain <[email protected]>
(cherry picked from commit 6eb8f6f)
@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 2c65566
Log 2314

Reports 2314

@VachaShah
Copy link
Collaborator

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 2c65566
Log 2319

Reports 2319

@VachaShah VachaShah requested a review from a team February 10, 2022 18:44
@dblock dblock merged commit a9ad1d9 into 1.x Feb 10, 2022
@dblock dblock deleted the backport/backport-1445-to-1.x branch February 10, 2022 18:48
@VachaShah
Copy link
Collaborator

Hi @dblock, we now have the auto-delete workflow to clean up the backport branches after the backport PR is merged so we don't have to do it manually anymore.

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.

4 participants