Repository navigation
fix(scheduler): tolerate partial cluster failures in replica estimation - #8083
Sidharth-Singh10 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @Sidharth-Singh10! It looks like this is your first PR to karmada-io/karmada 🎉 |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8083 +/- ##
==========================================
+ Coverage 42.47% 42.66% +0.19%
==========================================
Files 880 880
Lines 55481 55516 +35
==========================================
+ Hits 23566 23687 +121
+ Misses 30153 30064 -89
- Partials 1762 1765 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change preserving healthy clusters’ replica estimates when another cluster’s estimator fails.
No open issues 🎉
What changed in this PR
Addresses #6815 by preserving accurate replica estimates for healthy clusters when another cluster’s estimator fails, instead of falling back to the general estimator for every cluster.
Changes:
- Marks failed clusters with
UnauthenticReplicawhile retaining successful results and aggregate errors. - Preserves partial results through both scheduler adapters and merges per-cluster minimums, keeping zero authoritative and rejecting error results without a failure sentinel.
- Adds regression tests for partial failures, fallback behavior, and unchanged descheduler error handling.
| File | Description |
|---|---|
pkg/scheduler/core/util.go |
Accepts trustworthy partial estimates and merges per-cluster minimums. |
pkg/scheduler/core/util_test.go |
Tests partial-result merging, zero capacity, fallback, and real estimator integration. |
pkg/scheduler/core/estimation.go |
Preserves partial component-set estimates and failure sentinels. |
pkg/scheduler/core/estimation_test.go |
Covers partial errors, sentinel preservation, and duplicate cluster entries. |
pkg/estimator/client/interface.go |
Documents the per-cluster failure sentinel contract. |
pkg/estimator/client/accurate.go |
Marks failed concurrent estimates with sentinels and preserves wrapped errors. |
pkg/estimator/client/accurate_test.go |
Tests concurrent helpers and scheduler-estimator partial failures. |
pkg/descheduler/core/helper_test.go |
Verifies that the descheduler still discards the whole batch on error. |
Review effort: Balanced
When one candidate cluster has no reachable scheduler-estimator, the accurate estimator returns a batch error and both scheduler adapters discard the estimates of the clusters that succeeded, forcing every cluster onto the general estimator. Mark failed clusters with UnauthenticReplica in both concurrent helpers, preserve per-cluster results through the single-template and component-set adapters, and merge them in calAvailableReplicas while keeping the descheduler's all-or-nothing error handling unchanged. Tests cover helper-level partial results, the outer merge for both dispatch paths, minimum and zero semantics, and a real SchedulerEstimator with a missing cache entry. Refs: karmada-io#6815 Signed-off-by: Sidharth-Singh10 <sidharthsingh714@gmail.com>
53b5788 to
1fc6f77
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
When multiple replica estimators are configured and the accurate estimator cannot reach one candidate cluster,
getClusterReplicasConcurrentlyreturns a batch error. Both scheduler adapters discarded the whole batch, so estimates for healthy clusters were lost and every cluster fell back to the general estimator. This implements #6815.The change:
UnauthenticReplicain both concurrent helpers, keeping successful peers in the slice;runSingleTemplateEstimatorandcalculateMultiTemplateAvailableSets;calAvailableReplicas, taking the per-cluster minimum and keeping0authoritative;Which issue(s) this PR fixes:
Fixes #6815
Does this PR introduce a user-facing change?: