Skip to content

Commit c6d1c22

Browse files
authored
refactor(alluxio): remove redundant CacheStates update from UpdateDatasetStatus (#5806)
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>
1 parent 82e490e commit c6d1c22

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

pkg/ddc/alluxio/dataset.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ func (e *AlluxioEngine) UpdateCacheOfDataset() (err error) {
7575

7676
// UpdateDatasetStatus updates the status of the dataset
7777
func (e *AlluxioEngine) UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (err error) {
78-
// 1. update the runtime status
79-
runtime, err := e.getRuntime()
80-
if err != nil {
81-
return err
82-
}
83-
84-
// 2.update the dataset status
8578
err = retry.RetryOnConflict(retry.DefaultBackoff, func() error {
8679
dataset, err := utils.GetDataset(e.Client, e.name, e.namespace)
8780
if err != nil {
@@ -127,10 +120,6 @@ func (e *AlluxioEngine) UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (er
127120
cond)
128121
}
129122

130-
// TODO: Do we have to update cachestates here? It is updated in AlluxioEngine.UpdateCacheOfDataset()
131-
datasetToUpdate.Status.CacheStates = runtime.Status.CacheStates
132-
// datasetToUpdate.Status.CacheStates =
133-
134123
if datasetToUpdate.Status.HCFSStatus == nil {
135124
datasetToUpdate.Status.HCFSStatus, err = e.GetHCFSStatus()
136125
if err != nil {

0 commit comments

Comments
 (0)