Skip to content

[BUG] CacheEngine does not populate Status.Selector, breaking HPA and worker pod discovery #6063

Description

@adityaupasani2

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

  1. Add getWorkerSelectors() to CacheEngine using the labels set by getCommonLabelsFromComponent() — specifically common.LabelCacheRuntimeName and common.LabelCacheRuntimeComponentName with component type worker
  2. Call it during master setup in SetupMaster() to set runtimeToUpdate.Status.Selector
  3. Remove the two TODO comments

I'd like to work on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions