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

Ignore off-by-one differences when optimizing sharded placement #3532

Merged
merged 5 commits into from
Jun 3, 2021

Conversation

MantasMiksys
Copy link
Contributor

What this PR does / why we need it:

Previously, sharded placement optimization (optimize()) which is performed during instance removal, replica addition and instance replacement (if AllowPartialReplace config is enabled), would cause unnecessary shard movement.
For example, if there were 3 instances A, B, C with 2, 2, 1 shards respectively, then replacement of node A with a new instance D would also trigger a movement of 1 shard from B to C.

To fix this, the way underloaded instance is determined was changed. In addition to checking if any instance has less than its target load of shards, a check for any instance having more than its target load of shards was added. The second check will fail and no optimization will be performed in scenarios like the one described above.

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@codecov
Copy link

codecov bot commented Jun 2, 2021

Codecov Report

Merging #3532 (d051ea4) into master (d051ea4) will not change coverage.
The diff coverage is n/a.

❗ Current head d051ea4 differs from pull request most recent head 79dd9d0. Consider uploading reports for the commit 79dd9d0 to get more accurate results

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3532   +/-   ##
======================================
  Coverage    55.9%   55.9%           
======================================
  Files         549     549           
  Lines       61434   61434           
======================================
  Hits        34366   34366           
  Misses      23966   23966           
  Partials     3102    3102           
Flag Coverage Δ
aggregator 57.1% <0.0%> (ø)
cluster ∅ <0.0%> (∅)
collector 54.3% <0.0%> (ø)
dbnode 60.3% <0.0%> (ø)
m3em 46.4% <0.0%> (ø)
metrics 19.8% <0.0%> (ø)
msg 74.6% <0.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d051ea4...79dd9d0. Read the comment docs.

@MantasMiksys MantasMiksys merged commit e54033f into master Jun 3, 2021
@MantasMiksys MantasMiksys deleted the mmiksys/optimize branch June 3, 2021 06:18
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