Skip to content

enhance: balance partition shards by disk usage - #50890

Open
sunby wants to merge 4 commits into
milvus-io:masterfrom
sunby:codex/querycoord-shard-disk-balance
Open

enhance: balance partition shards by disk usage#50890
sunby wants to merge 4 commits into
milvus-io:masterfrom
sunby:codex/querycoord-shard-disk-balance

Conversation

@sunby

@sunby sunby commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

related: #50733
depends on: #50835

What

  • Add ScoreBasedBalancer shard disk balance path for collections with namespace.mode=partition.
  • Use cache shard disk usage stats to move one improving shard per balance round, with in-flight shard move projection and busy-shard skipping.
  • Move the QueryCoord shard delegator first; once the delegator is on the target, move movable sealed segments for that shard to the same node.

@sre-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sunby
To complete the pull request process, please assign jiaoew1991 after the PR has been reviewed.
You can assign the PR to them by writing /assign @jiaoew1991 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot added size/XXL Denotes a PR that changes 1000+ lines. area/internal-api labels Jun 29, 2026
@mergify mergify Bot added dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement labels Jun 29, 2026
@sunby
sunby marked this pull request as draft June 29, 2026 09:23
@sre-ci-robot sre-ci-robot added the do-not-merge/work-in-progress Don't merge even CI passed. label Jun 29, 2026
@sre-ci-robot

Copy link
Copy Markdown
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-code-check-macos // for Code Checker MacOS (GitHub Actions)
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-build-all // for ci-v2/build-all (multi-arch builds)
  • /ci-rerun-buildenv // for ci-v2/build-env (build milvus-env builder images; update .env after the new tag is ready)
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-default // for ci-v2/e2e-default
  • /ci-rerun-e2e-amd // for ci-v2/e2e-amd (e2e pool dispatcher)
  • /ci-rerun-build-ut-cov // for ci-v2/build-ut-cov (build + unit tests in one pipeline)
  • /ci-rerun-gosdk // for ci-v2/go-sdk (Go SDK E2E tests, ARM)

If you have any questions or requests, please contact @zhikunyao.

@sre-ci-robot

Copy link
Copy Markdown
Contributor

❌ CI Loop Results e30c1dc

Stage Result Duration Tests
✅ Build SUCCESS 17.2min -
✅ Code-Check SUCCESS 11.1min -
❌ UT-GO FAILURE 22.1min 1071 total, 1071 passed, 0 failed
✅ UT-Integration SUCCESS 25.3min 46 total, 46 passed, 0 failed
❌ UT-CPP-Cov FAILURE 62.8min 6277 total, failed (process exit non-zero; failed cases unavailable)

Total: 83min | Pipeline | Artifacts
Diff Coverage: CPP 37.1% (43 hit, 73 miss, 116 measurable lines, 161 unmeasured)
Total Patch Coverage: 37.1% (43/116 measurable lines, 161 unmeasured)

Failed Test Logs:

@sre-ci-robot sre-ci-robot added the low-code-coverage add test-label from zhikun, diff coverage > 80% label Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.78%. Comparing base (ae1d566) to head (8073f5d).
⚠️ Report is 346 commits behind head on master.

Files with missing lines Patch % Lines
internal/core/src/monitor/monitor_c.cpp 0.00% 49 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #50890       +/-   ##
===========================================
+ Coverage   79.39%   85.78%    +6.38%     
===========================================
  Files        2290      690     -1600     
  Lines      418096   129540   -288556     
===========================================
- Hits       331961   111121   -220840     
+ Misses      75946    18367    -57579     
+ Partials    10189       52    -10137     
Components Coverage Δ
Client ∅ <ø> (∅)
Core 86.46% <57.26%> (+<0.01%) ⬆️
Go ∅ <ø> (∅)
Files with missing lines Coverage Δ
.../src/segcore/storagev1translator/ChunkTranslator.h 100.00% <ø> (ø)
internal/core/src/monitor/monitor_c.cpp 14.03% <0.00%> (-85.97%) ⬇️

... and 1603 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sunby
sunby marked this pull request as ready for review June 29, 2026 14:34
@sre-ci-robot sre-ci-robot removed the do-not-merge/work-in-progress Don't merge even CI passed. label Jun 29, 2026
@sunby

sunby commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

/ci-rerun-build-ut-cov

@sre-ci-robot

Copy link
Copy Markdown
Contributor

✅ CI Loop Results af5dc7c

Stage Result Duration Tests
✅ Build SUCCESS 16.7min -
✅ Code-Check SUCCESS 10.9min -
✅ UT-GO SUCCESS 21.9min 1071 total, 1071 passed, 0 failed
✅ UT-Integration SUCCESS 25.2min 46 total, 46 passed, 0 failed
✅ UT-CPP-Cov SUCCESS 63.7min 8029 total, 8029 passed, 0 failed

Total: 87min | Pipeline | Artifacts

Overall Coverage: 72.1%
Diff Coverage: CPP 37.1% (43 hit, 73 miss, 116 measurable lines, 161 unmeasured) | Go 84.3% (327 hit, 61 miss, 388 measurable lines, 2346 unmeasured)
Diff Coverage HTML: view changed lines
Go Patch Warning: WARNING: Go patch coverage is partial; 2346 changed lines were unmeasured.
Total Patch Coverage: 73.4% (370/504 measurable lines, 2507 unmeasured)

@sre-ci-robot

Copy link
Copy Markdown
Contributor

✅ CI Loop Results 076558b

Stage Result Duration Tests
✅ Build SUCCESS 14.0min -
✅ Code-Check SUCCESS 6.8min -
✅ UT-Integration SUCCESS 25.1min 46 total, 46 passed, 0 failed
✅ UT-GO SUCCESS 21.2min 1071 total, 1071 passed, 0 failed
✅ UT-CPP-Cov SUCCESS 58.3min 8047 total, 8047 passed, 0 failed

Total: 125min | Pipeline | Artifacts

Overall Coverage: 72.2%
Diff Coverage: CPP 0.0% (0 hit, 51 miss, 51 measurable lines, 57 unmeasured) | Go 84.2% (314 hit, 59 miss, 373 measurable lines, 2342 unmeasured)
Diff Coverage HTML: view changed lines
Go Patch Warning: WARNING: Go patch coverage is partial; 2342 changed lines were unmeasured.
Total Patch Coverage: 74.1% (314/424 measurable lines, 2399 unmeasured)

@sre-ci-robot sre-ci-robot removed the low-code-coverage add test-label from zhikun, diff coverage > 80% label Jun 30, 2026
@sunby

sunby commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/ci-rerun-gosdk
/ci-rerun-e2e-default

@sunby

sunby commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/ci-rerun-gosdk

@sunby

sunby commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/ci-rerun-e2e-default

@sunby
sunby force-pushed the codex/querycoord-shard-disk-balance branch from 076558b to 6b3c8d9 Compare July 1, 2026 09:54
@sre-ci-robot

Copy link
Copy Markdown
Contributor

❌ CI Loop Results 6b3c8d9

Stage Result Duration Tests
✅ Build SUCCESS 14.9min -
❌ Code-Check FAILURE 2.0min -
❌ UT-Integration SKIPPED - -
❌ UT-GO SKIPPED - -
✅ UT-CPP-Cov SUCCESS 58.3min 8049 total, 8049 passed, 0 failed

Total: 76min | Pipeline | Artifacts
Diff Coverage: CPP 0.0% (0 hit, 51 miss, 51 measurable lines, 58 unmeasured)
Total Patch Coverage: 0.0% (0/51 measurable lines, 58 unmeasured)

Failed Test Logs:

@sre-ci-robot sre-ci-robot added the low-code-coverage add test-label from zhikun, diff coverage > 80% label Jul 1, 2026
@sre-ci-robot

Copy link
Copy Markdown
Contributor

❌ CI Loop Results 648edc8

Stage Result Duration Tests
✅ Build SUCCESS 14.7min -
❌ Code-Check FAILURE 6.2min -
❌ UT-Integration SKIPPED - -
❌ UT-GO SKIPPED - -
✅ UT-CPP-Cov SUCCESS 58.5min 8049 total, 8049 passed, 0 failed

Total: 76min | Pipeline | Artifacts
Diff Coverage: CPP 0.0% (0 hit, 51 miss, 51 measurable lines, 57 unmeasured)
Total Patch Coverage: 0.0% (0/51 measurable lines, 57 unmeasured)

Failed Test Logs:

@sre-ci-robot sre-ci-robot added low-code-coverage add test-label from zhikun, diff coverage > 80% and removed low-code-coverage add test-label from zhikun, diff coverage > 80% labels Jul 1, 2026
@sre-ci-robot

Copy link
Copy Markdown
Contributor

✅ CI Loop Results 54c24f1

Stage Result Duration Tests
✅ Build SUCCESS 14.7min -
✅ Code-Check SUCCESS 7.1min -
✅ UT-Integration SUCCESS 25.4min 46 total, 46 passed, 0 failed
✅ UT-GO SUCCESS 21.4min 1081 total, 1081 passed, 0 failed
✅ UT-CPP-Cov SUCCESS 60.7min 8049 total, 8049 passed, 0 failed

Total: 83min | Pipeline | Artifacts

Overall Coverage: 72.2%
Diff Coverage: CPP 0.0% (0 hit, 51 miss, 51 measurable lines, 57 unmeasured) | Go 84.2% (314 hit, 59 miss, 373 measurable lines, 2342 unmeasured)
Diff Coverage HTML: view changed lines
Go Patch Warning: WARNING: Go patch coverage is partial; 2342 changed lines were unmeasured.
Total Patch Coverage: 74.1% (314/424 measurable lines, 2399 unmeasured)

Signed-off-by: sunby <sunbingyi1992@gmail.com>
sunby added 3 commits July 2, 2026 15:55
Signed-off-by: sunby <sunbingyi1992@gmail.com>
Signed-off-by: sunby <sunbingyi1992@gmail.com>
Signed-off-by: sunby <sunbingyi1992@gmail.com>
@sunby
sunby force-pushed the codex/querycoord-shard-disk-balance branch from 54c24f1 to 8073f5d Compare July 2, 2026 07:55
@sre-ci-robot

Copy link
Copy Markdown
Contributor

✅ CI Loop Results 8073f5d

Stage Result Duration Tests
✅ Build SUCCESS 11.3min -
✅ Code-Check SUCCESS 8.7min -
✅ UT-Integration SUCCESS 25.2min 46 total, 46 passed, 0 failed
✅ UT-GO SUCCESS 21.5min 1087 total, 1087 passed, 0 failed
✅ UT-CPP-Cov SUCCESS 47.1min 8053 total, 8053 passed, 0 failed

Total: 78min | Pipeline | Artifacts

Overall Coverage: 72.3%
Diff Coverage: CPP 0.0% (0 hit, 51 miss, 51 measurable lines, 57 unmeasured) | Go 84.2% (314 hit, 59 miss, 373 measurable lines, 2342 unmeasured)
Diff Coverage HTML: view changed lines
Go Patch Warning: WARNING: Go patch coverage is partial; 2342 changed lines were unmeasured.
Total Patch Coverage: 74.1% (314/424 measurable lines, 2399 unmeasured)

@sunby

sunby commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/ci-rerun-ut-go

@mergify mergify Bot added the ci-passed label Jul 2, 2026
@stale

stale Bot commented Aug 2, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.

@stale stale Bot added the stale indicates no udpates for 30 days label Aug 2, 2026
@sre-ci-robot sre-ci-robot added the do-not-merge/need-milestone generate by v2-label-manager label Aug 13, 2026
@sre-ci-robot

Copy link
Copy Markdown
Contributor

[INFO] PR Label Summary by Default
[INFO] Dependent PR check skipped - not required for branch 'master'

[WARNING] Milestone not set

You can set milestone by commenting:
/set-milestone
Example:
/set-milestone 2.5.0

Use /refresh-label to update related check and label manually

@zhikunyao zhikunyao removed the do-not-merge/need-milestone generate by v2-label-manager label Aug 14, 2026
@stale stale Bot removed the stale indicates no udpates for 30 days label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/internal-api ci-passed dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement low-code-coverage add test-label from zhikun, diff coverage > 80% size/XXL Denotes a PR that changes 1000+ lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants