From 0da0235155ba7835536420b2d9518798baf47544 Mon Sep 17 00:00:00 2001 From: lin121291 <4jp33f9e@gmail.com> Date: Fri, 24 Apr 2026 16:44:03 +0800 Subject: [PATCH] refactor(alluxio): remove redundant CacheStates update from UpdateDatasetStatus CacheStates is already managed by UpdateCacheOfDataset() at Sync step 5. The duplicate assignment in UpdateDatasetStatus() has no effect and adds an unnecessary getRuntime() call. Signed-off-by: lin121291 <4jp33f9e@gmail.com> --- pkg/ddc/alluxio/dataset.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/ddc/alluxio/dataset.go b/pkg/ddc/alluxio/dataset.go index 3c21a13f2cd..6bed893112a 100644 --- a/pkg/ddc/alluxio/dataset.go +++ b/pkg/ddc/alluxio/dataset.go @@ -75,13 +75,6 @@ func (e *AlluxioEngine) UpdateCacheOfDataset() (err error) { // UpdateDatasetStatus updates the status of the dataset func (e *AlluxioEngine) UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (err error) { - // 1. update the runtime status - runtime, err := e.getRuntime() - if err != nil { - return err - } - - // 2.update the dataset status err = retry.RetryOnConflict(retry.DefaultBackoff, func() error { dataset, err := utils.GetDataset(e.Client, e.name, e.namespace) if err != nil { @@ -127,10 +120,6 @@ func (e *AlluxioEngine) UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (er cond) } - // TODO: Do we have to update cachestates here? It is updated in AlluxioEngine.UpdateCacheOfDataset() - datasetToUpdate.Status.CacheStates = runtime.Status.CacheStates - // datasetToUpdate.Status.CacheStates = - if datasetToUpdate.Status.HCFSStatus == nil { datasetToUpdate.Status.HCFSStatus, err = e.GetHCFSStatus() if err != nil {