longhorn-manager
longhorn-manager copied to clipboard
fix(replica-scheduling): power off replica node should not rebuild new replica on same node (backport #2918)
Which issue(s) this PR fixes:
Issue longhorn/longhorn#1992
What this PR does / why we need it:
- Before creating a new Replica CR, verify the availability of suitable nodes with sufficient disk to accommodate the replica. This prevents creating Replicas that cannot be scheduled.
- During node disk candidate selection, exclude nodes where the InstanceManager is not in a running state. This prevents creating redundant Replica CRs on nodes that haven't fully recovered after a power down.
Special notes for your reviewer:
None
Additional documentation or context
None
This is an automatic backport of pull request #2918 done by [Mergify](https://mergify.com).
Cherry-pick of 71c3d11d2866e37f9d3ca8a918f7ee1d298de439 has failed:
On branch mergify/bp/v1.5.x/pr-2918
Your branch is up to date with 'origin/v1.5.x'.
You are currently cherry-picking commit 71c3d11d.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: controller/volume_controller.go
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: scheduler/replica_scheduler.go
Cherry-pick of ce53ab12b56448e3dbadf37bd92fd0f5e2ad11e7 has failed:
On branch mergify/bp/v1.5.x/pr-2918
Your branch is ahead of 'origin/v1.5.x' by 3 commits.
(use "git push" to publish your local commits)
You are currently cherry-picking commit ce53ab12.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: controller/volume_controller_test.go
no changes added to commit (use "git add" and/or "git commit -a")
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Ref https://github.com/longhorn/longhorn/issues/8860
TODO:
- [ ] Backport https://github.com/longhorn/longhorn-manager/pull/2939
- [ ] Backport https://github.com/longhorn/longhorn-manager/pull/2941
- [ ] Backport https://github.com/longhorn/longhorn-manager/pull/2942
- [ ] Backport https://github.com/longhorn/longhorn-manager/pull/2950