fix(thin): propagate the transformFuseConfig error in updateFuseConfigOnChange - #6187
Conversation
…gOnChange `updateFuseConfigOnChange` returned `(update, nil)` when `transformFuseConfig` failed, so the error was discarded. Its caller `ShouldUpdateUFS` only reacts to a non-nil error, which means a fuse config transform failure (for example an unbound or missing PVC behind a `pvc://` mount) was completely silent: `t.Log.Error(err, "Failed to update fuse config")` never fired. Return `err` instead, matching the two sibling error paths in the very same function (`kubeclient.GetConfigmapByName` and `kubeclient.UpdateConfigMap`). Add a table case to `TestThinEngine_updateFuseConfigOnChange` covering a Dataset with a `pvc://missing-pvc` mount, so `extractVolumeInfo` fails and the propagated error is asserted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: cnYui <xiaobianfuai@gmail.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 @cnYui. 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. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6187 +/- ##
==========================================
+ Coverage 65.24% 65.25% +0.01%
==========================================
Files 486 486
Lines 34194 34194
==========================================
+ Hits 22309 22315 +6
+ Misses 10135 10131 -4
+ Partials 1750 1748 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Ⅰ. Describe what this PR does
ThinEngine.updateFuseConfigOnChange(pkg/ddc/thin/ufs.go) discards the error returned bytransformFuseConfig:Both sibling error paths in the very same function return the error (
kubeclient.GetConfigmapByNameat line 98-100,kubeclient.UpdateConfigMapat line 118-120), so this looks like an oversight rather than an intentional choice —git blameshows the line was introduced in the same hunk as its correct neighbours by #3432.The consequence is a lost error signal. The only caller,
ShouldUpdateUFS, reacts to a non-nil error:Because
nilis returned, thatLog.Errornever fires and the transform failure is completely silent.transformFuseConfigis genuinely able to fail here: apvc://mount whose PersistentVolumeClaim is missing or not yetBoundmakesextractVolumeInforeturn an error, which is wrapped asfailed to extract volume info from PersistentVolumeClaim "%s"(pkg/ddc/thin/transform_config.go:61-64).Scope, stated honestly: this is an error-swallowing / observability fix, not a behavioural one.
updateis stillfalseat that point, soupdateFusePod()was skipped before this change and is still skipped after it, andShouldUpdateUFSreturns a nilufsToUpdateeither way. What changes is that the failure is now logged instead of vanishing, and the function no longer holds a latent trap for any future caller that propagates the error.The fix is one token:
Ⅱ. 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 one table case,
"transform fuse config failed", to the existingTestThinEngine_updateFuseConfigOnChangeinpkg/ddc/thin/ufs_test.go. It uses a Dataset whose mount ispvc://missing-pvc(no such PVC exists in the fake client), sotransformFuseConfig->extractVolumeInfo->kubeclient.GetPersistentVolumeClaimfails, and assertswantUpdate: false, wantErr: true. The three existing cases are untouched and still pass.This case fails on
masterand passes with the fix, so it pins the behaviour.Ⅳ. Describe how to verify it
All commands run locally on
master@54a41cdwith Go 1.25.7.1. The new test fails without the
ufs.gochange (test case applied alone):(
error <nil>is exactly the symptom: the transform failed, but the function reported success.)2. With the fix applied, it passes:
3. Build, vet and gofmt are clean:
4. Out-of-band
nilerrrun (this linter is not enabled in the repo's.golangci.yml, so CI does not flag it today):Ⅴ. Special notes for reviews
+23 / -1across two files; the production change is a single token onpkg/ddc/thin/ufs.go:110.go test ./pkg/ddc/thin/... -count=1shows 5 failures on my machine (TestThinEngine_getMountPoint,Test_getMountRoot, and 3 Ginkgo specs intransform_fuse_test.go). I verified these are pre-existing on unmodifiedmaster— I stashed my change and got the identical set (120 Passed | 3 Failedin the Ginkgo suite both times). They are Windows path-handling artefacts (getMountRoot() = /thin, want /tmp/thin) from my local environment, unrelated to this patch. This change adds no new failures.ufs_test.gouses gomonkeyApplyFunc, hence the-gcflags="all=-N -l"in the commands above.🤖 Generated with Claude Code