fix: correct cache client status reporting#5793
fix: correct cache client status reporting#5793CAICAIIs wants to merge 5 commits intofluid-cloudnative:masterfrom
Conversation
Signed-off-by: CAICAIIs <3360776475@qq.com>
Signed-off-by: CAICAIIs <3360776475@qq.com>
|
[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 |
|
Hi @CAICAIIs. Thanks for your PR. I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Code Review
This pull request updates the runtime status logic to incorporate the client component's readiness into the overall runtime state. Specifically, setClientComponentStatus now returns a boolean indicating readiness, and CheckAndUpdateRuntimeStatus has been updated to aggregate this value. New unit tests were also introduced to cover various readiness scenarios. Feedback suggests improving the robustness of the replica comparison by using >= instead of == and simplifying the conditional logic for determining the component phase.
Signed-off-by: CAICAIIs <3360776475@qq.com>
|
@Syspretor @cheyang does fuse client affect the dataset binding? |
There was a problem hiding this comment.
Pull request overview
This PR tightens cache runtime readiness evaluation so that datasets are only bound once the client component is fully ready, and adds unit tests covering the corrected behavior.
Changes:
- Update cache runtime readiness logic to include client readiness (and require all client replicas ready) before considering the runtime ready.
- Adjust client component status calculation to explicitly set NotReady/PartialReady/Ready phases based on desired vs ready replicas.
- Add unit tests validating runtime readiness and setup duration behavior across client not-ready/partial-ready/ready transitions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/ddc/cache/engine/status.go | Includes client readiness in overall runtime readiness gating; updates client status phase/ready computation. |
| pkg/ddc/cache/engine/status_test.go | Adds unit tests ensuring runtime isn’t marked ready (and setup duration not set) until client is fully ready. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if masterReady && workerReady && clientReady { | ||
| runtimeReady = true | ||
| } else { |
There was a problem hiding this comment.
runtimeReady is mutated inside the RetryOnConflict closure but never reset to false when the readiness condition is not met. If the first attempt sets runtimeReady=true and a subsequent retry observes not-ready components, runtimeReady will remain true, which can incorrectly record SetupDuration and cause callers to treat the runtime as ready. Compute runtimeReady from the current masterReady/workerReady/clientReady on every retry attempt (e.g., assign runtimeReady = masterReady && workerReady && clientReady unconditionally, or reset it at the top of each closure invocation).
| if masterReady && workerReady && clientReady { | |
| runtimeReady = true | |
| } else { | |
| runtimeReady = masterReady && workerReady && clientReady | |
| if !runtimeReady { |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5793 +/- ##
==========================================
+ Coverage 58.46% 58.67% +0.20%
==========================================
Files 473 473
Lines 32222 32224 +2
==========================================
+ Hits 18839 18906 +67
+ Misses 11836 11757 -79
- Partials 1547 1561 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Replying to @xliuqq's question: Fuse client should NOT affect dataset binding. The dataset should become Bound once master and worker are ready, regardless of client readiness. This means the current PR direction — gating The PR does fix real bugs in Suggested approach:
@CAICAIIs — would you like to adjust the PR accordingly? |
Thanks, this clarifies the intended semantics. I agree the current gating is wrong: client/fuse readiness must not block runtime ready or dataset binding. I’ll revise the PR so it only fixes client status reporting and test coverage, and I’ll remove |
Signed-off-by: CAICAIIs <3360776475@qq.com>
bfc0875 to
50327b6
Compare
Signed-off-by: CAICAIIs <3360776475@qq.com>
|



Ⅰ. Describe what this PR does
This PR corrects cache runtime client status reporting.
It updates client phase handling so the client is reported as
Ready,PartialReady, orNotReadymore accurately, including the zero-desired-replica case.It also keeps runtime readiness and dataset binding based on master and worker readiness, and adds unit tests to cover the related status transitions and retry behavior.
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Added unit tests for:
Ⅳ. Describe how to verify it
Run:
go test ./pkg/ddc/cache/engineⅤ. Special notes for reviews
This PR only updates cache client status handling and related test coverage.