What's wrong
CacheEngine.CheckAndUpdateRuntimeStatus() in pkg/ddc/cache/engine/status.go has an unresolved TODO:
// TODO(cache runtime): set the CacheRuntime Status left fields: Selector
runtimeToUpdate.Status.ValueFile = common.GetCacheRuntimeConfigConfigMapName(e.name)
And in pkg/ddc/cache/engine/master.go, the line that would set it is commented out:
// TODO(cache runtime): figure out how to use this selector
// runtimeToUpdate.Status.Selector = e.getWorkerSelectors()
Status.Selector is a label selector string used for worker pod discovery and HPA (Horizontal Pod Autoscaler) integration. Every other runtime populates it — AlluxioEngine, JindoCacheEngine, JuiceFSEngine, VineyardEngine, EFCEngine all call e.getWorkerSelectors() during master setup. CacheRuntime never sets it, so status.selector is always empty.
Impact
Any tooling or controller that reads CacheRuntime.Status.Selector to discover worker pods — including HPA and the Fluid scheduler plugin — will see an empty string and fail to match any pods.
Proposed fix
- Add
getWorkerSelectors() to CacheEngine using the labels set by getCommonLabelsFromComponent() — specifically common.LabelCacheRuntimeName and common.LabelCacheRuntimeComponentName with component type worker
- Call it during master setup in
SetupMaster() to set runtimeToUpdate.Status.Selector
- Remove the two TODO comments
I'd like to work on this.
What's wrong
CacheEngine.CheckAndUpdateRuntimeStatus()inpkg/ddc/cache/engine/status.gohas an unresolved TODO:And in
pkg/ddc/cache/engine/master.go, the line that would set it is commented out:Status.Selectoris a label selector string used for worker pod discovery and HPA (Horizontal Pod Autoscaler) integration. Every other runtime populates it — AlluxioEngine, JindoCacheEngine, JuiceFSEngine, VineyardEngine, EFCEngine all calle.getWorkerSelectors()during master setup. CacheRuntime never sets it, sostatus.selectoris always empty.Impact
Any tooling or controller that reads
CacheRuntime.Status.Selectorto discover worker pods — including HPA and the Fluid scheduler plugin — will see an empty string and fail to match any pods.Proposed fix
getWorkerSelectors()toCacheEngineusing the labels set bygetCommonLabelsFromComponent()— specificallycommon.LabelCacheRuntimeNameandcommon.LabelCacheRuntimeComponentNamewith component typeworkerSetupMaster()to setruntimeToUpdate.Status.SelectorI'd like to work on this.