Skip to content

fix(dataset): report NotBound before recreating the ThinRuntime of a reference dataset - #6141

Closed
cheyang wants to merge 1 commit into
fluid-cloudnative:masterfrom
cheyang:fix/refdataset-notbound-before-runtime
Closed

fix(dataset): report NotBound before recreating the ThinRuntime of a reference dataset#6141
cheyang wants to merge 1 commit into
fluid-cloudnative:masterfrom
cheyang:fix/refdataset-notbound-before-runtime

Conversation

@cheyang

@cheyang cheyang commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it

Follow-up to #6138.

#6138 made CreateRuntimeForReferenceDatasetIfNotExist refuse to adopt or recreate a ThinRuntime that is still terminating, and return an error so the reconcile is retried once the object is really gone. That guard is correct, but it sits before the phase update in reconcileDataset, and it returns through utils.RequeueIfError. The consequence is that a reference dataset in NoneDatasetPhase stays in the empty phase for as long as the recreation keeps failing — which is the state #6138 set out to get away from.

This moves the phase update ahead of the runtime creation:

3. validate the dataset          (unchanged, still first)
4. update the phase to NotBound  (moved up)
5. create the runtime            (moved down, still returns RequeueIfError)
6. check needRequeue             (renumbered)

The spec validation deliberately stays first, so a dataset with an invalid dataset:// mount is still rejected without its status being touched. Only a dataset that has passed validation reports NotBound while its runtime recreation is pending — which is the honest state, since it is genuinely not bound to any runtime yet.

The creation error is still returned, so the retry behaviour introduced by #6138 is unchanged.

Which issue(s) this PR fixes

Addresses the phase-update ordering raised in review on #6138.

Does this PR introduce a user-facing change?

A reference dataset now reports the NotBound phase while its ThinRuntime is being recreated, instead of staying in an empty phase until the recreation succeeds.

Verification

pkg/controllers/v1alpha1/dataset passes with the change. The new spec was checked to actually discriminate: reverting only dataset_controller.go to f7067fd6 and keeping the new test makes it fail with the observed phase "" against the expected NotBound, so it is not green for an unrelated reason.

pkg/controllers/v1alpha1/{alluxio,dataprocess} fail on this machine with a Ginkgo Unknown Decorator: '60' error in BeforeSuite, but they fail identically on unmodified f7067fd6, so that is pre-existing and unrelated.

…reference dataset

The phase update to NotBound sat after the runtime creation of a reference
dataset, and that creation returns an error - and therefore requeues - while a
previously deleted ThinRuntime is still terminating. A reference dataset in the
empty phase was consequently kept there for as long as the recreation kept
failing, which is the very state fluid-cloudnative#6138 set out to get away from.

Move the phase update ahead of the runtime creation. The spec validation stays
first, so an invalid dataset is still rejected without its status being touched,
and the creation error is still returned, so the reconcile keeps being retried
until the leftover runtime is really gone.

Signed-off-by: cheyang <cheyang.cy@alibaba-inc.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.09%. Comparing base (f7067fd) to head (bd9923c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6141   +/-   ##
=======================================
  Coverage   65.09%   65.09%           
=======================================
  Files         485      485           
  Lines       34000    34000           
=======================================
  Hits        22132    22132           
  Misses      10127    10127           
  Partials     1741     1741           

☔ 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.

@cheyang cheyang closed this Jul 29, 2026
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.

1 participant