From 6fb362210cdd54703ce89078fa87457c4f133996 Mon Sep 17 00:00:00 2001 From: xinque <231098078@smail.nju.edu.cn> Date: Mon, 29 Jun 2026 22:31:37 +0800 Subject: [PATCH 1/2] Add comments to checkIfRemountRequired in ufs.go Signed-off-by: xinque <231098078@smail.nju.edu.cn> --- pkg/ddc/alluxio/ufs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/ddc/alluxio/ufs.go b/pkg/ddc/alluxio/ufs.go index 9d466880443..c494647f79b 100644 --- a/pkg/ddc/alluxio/ufs.go +++ b/pkg/ddc/alluxio/ufs.go @@ -163,6 +163,10 @@ func (e *AlluxioEngine) UpdateOnUFSChange(ufsToUpdate *utils.UFSToUpdate) (updat return } +// checkIfRemountRequired checks whether a remount operation is needed for the given UFS. +// It compares the runtime's MountTime with the Alluxio master container's start time. +// If the master container started after the last mount, it means the mount data was lost +// due to container restart, so it finds unmounted UFS paths and schedules a remount. func (e *AlluxioEngine) checkIfRemountRequired(ufsToUpdate *utils.UFSToUpdate) { runtime, err := e.getRuntime() if err != nil { From d0bb7bf7a0ca88572bf177aa9d8ddf993334e307 Mon Sep 17 00:00:00 2001 From: xinque <231098078@smail.nju.edu.cn> Date: Tue, 30 Jun 2026 10:50:10 +0800 Subject: [PATCH 2/2] Update comments to checkIfRemountRequired per review feedback Signed-off-by: xinque <231098078@smail.nju.edu.cn> --- pkg/ddc/alluxio/ufs.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/ddc/alluxio/ufs.go b/pkg/ddc/alluxio/ufs.go index c494647f79b..dd66355d319 100644 --- a/pkg/ddc/alluxio/ufs.go +++ b/pkg/ddc/alluxio/ufs.go @@ -165,8 +165,14 @@ func (e *AlluxioEngine) UpdateOnUFSChange(ufsToUpdate *utils.UFSToUpdate) (updat // checkIfRemountRequired checks whether a remount operation is needed for the given UFS. // It compares the runtime's MountTime with the Alluxio master container's start time. -// If the master container started after the last mount, it means the mount data was lost -// due to container restart, so it finds unmounted UFS paths and schedules a remount. +// If the master container started after the last mount, the in-memory mount state may not +// have survived the restart, so it finds unmounted UFS paths and adds them to ufsToUpdate +// for remount scheduling. If no paths need remounting, it refreshes the runtime's MountTime +// to prevent the check from re-firing on every reconcile. +// +// Parameters: +// - ufsToUpdate (*utils.UFSToUpdate): An in/out parameter that may be mutated via +// AddMountPaths to carry unmounted paths back to the caller for remount scheduling. func (e *AlluxioEngine) checkIfRemountRequired(ufsToUpdate *utils.UFSToUpdate) { runtime, err := e.getRuntime() if err != nil {