fix(dataset): report NotBound before recreating the ThinRuntime of a reference dataset - #6141
Closed
cheyang wants to merge 1 commit into
Closed
Conversation
…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>
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What this PR does / why we need it
Follow-up to #6138.
#6138 made
CreateRuntimeForReferenceDatasetIfNotExistrefuse 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 inreconcileDataset, and it returns throughutils.RequeueIfError. The consequence is that a reference dataset inNoneDatasetPhasestays 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:
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 reportsNotBoundwhile 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?
Verification
pkg/controllers/v1alpha1/datasetpasses with the change. The new spec was checked to actually discriminate: reverting onlydataset_controller.gotof7067fd6and keeping the new test makes it fail with the observed phase""against the expectedNotBound, so it is not green for an unrelated reason.pkg/controllers/v1alpha1/{alluxio,dataprocess}fail on this machine with a GinkgoUnknown Decorator: '60'error inBeforeSuite, but they fail identically on unmodifiedf7067fd6, so that is pre-existing and unrelated.