Skip to content

fix(pd): avoid duplicate drain migration submission - #3426

Merged
imbajin merged 13 commits into
apache:masterfrom
hugegraph:codex/pr343-duplicate-drain-fix-20261028
Oct 28, 2026
Merged

imbajin merged 13 commits into
apache:masterfrom
hugegraph:codex/pr343-duplicate-drain-fix-20261028

Conversation

@imbajin

@imbajin imbajin commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Before → After

Removing an online Store could submit two independent migration commands for the same shard group: capacity-aware planning accepted one destination, then the Exiting-state transition planned the group again.

Carry accepted groups into the state transition so their chosen destinations remain authoritative. Keep the existing turnoff path as a fallback for groups not submitted after validation, and use a set for membership checks. Add regressions for both the fallback and the management-entry flow, registering the latter in the normal core suite. This suppresses duplicate planning within one management request; it does not provide durable task admission or deduplication across independent requests.

Keep PD service classes available to reactor dependencies by attaching the executable Boot jar with an exec classifier; distributions continue to use the established launcher filename.

Author-reported focused tests cover the drain submission paths; full validation and live migration/RC acceptance are not claimed.

Source PR: 🔗 org Server #347

Visual overview

Single-request Store drain migration planning

Visual overview of the single-request drain plan: reuse accepted migration groups and fall back only for unsubmitted groups. This does not establish cross-request durable deduplication or cluster-level acceptance.

orion and others added 13 commits October 27, 2026 07:52
- Separate live Stores from Up placement destinations using current metadata.
- Keep Exiting leases alive until local engines and PD references are empty.
- Serialize heartbeat, registration and state changes and preserve drain on restart.
- Cover drain, stale leases, shared groups and concurrent updates in regressions.
Retry explicit Exiting requests after eligible capacity is restored.
Dispatch management state notifications after releasing the Store lock.
Preserve Tombstone as terminal across management state updates.
Cover capacity recovery and concurrent placement with regressions.
Remove the two branch-specific patch and staging workflows.\nKeep regression tests and production changes in their normal modules.\nRetain validation evidence outside the source tree.
Merge the current master while retaining accepted migration groups.

Use a set to avoid quadratic duplicate checks during drain.

Register the management-entry regression in the normal core suite.
Attach the executable Boot jar with the exec classifier.

Use that jar for distributions while preserving the launcher filename.

Keep service classes available to later reactor dependencies.
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.87%. Comparing base (608cb1d) to head (a5b4934).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3426      +/-   ##
============================================
+ Coverage     57.27%   57.87%   +0.60%     
+ Complexity     6577     2946    -3631     
============================================
  Files           776      777       +1     
  Lines         68881    69099     +218     
  Branches       9431     9484      +53     
============================================
+ Hits          39449    39990     +541     
+ Misses        25804    25443     -361     
- Partials       3628     3666      +38     
Flag Coverage Δ *Carryforward flag
commons 96.37% <ø> (ø) Carriedforward from 476e80d
hstore 36.09% <ø> (+<0.01%) ⬆️
pd 55.80% <100.00%> (+3.64%) ⬆️
server_hbase 42.18% <ø> (-0.01%) ⬇️ Carriedforward from 476e80d
server_memory 55.95% <ø> (-0.03%) ⬇️ Carriedforward from 476e80d
server_rocksdb 42.67% <ø> (+0.01%) ⬆️ Carriedforward from 476e80d
store 35.21% <ø> (+2.07%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@bitflicker64 bitflicker64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: no. Score: 9/10. Summary: Passing the groups accepted by movePartitions into storeTurnoff stops the second reallocShards change for the same shard group while rejected destinations keep the fallback, and the drain tests and all checks pass at a5b4934.

@imbajin
imbajin merged commit 881e42c into apache:master Oct 28, 2026
17 checks passed
@imbajin
imbajin deleted the codex/pr343-duplicate-drain-fix-20261028 branch October 28, 2026 11:20
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.

3 participants