Skip to content

[Feature] DataBackup does not inject NodeAffinity into status after successful backup, unlike other data operations #6107

Description

@adityaupasani2

What's wrong

DataBackup.OnceHandler.GetOperationStatus() in pkg/controllers/v1alpha1/databackup/status_handler.go has an unresolved TODO:

// TODO: inject nodeaffinity like other data operations when using job instead of pod

DataLoad, DataMigrate, and DataProcess all call dataflow.GenerateNodeAffinity(job) after a successful operation to populate status.nodeAffinity. This allows downstream runAfter operations to be scheduled on the same node where the data was cached, improving cache hit rates.

DataBackup uses a Pod instead of a Job, so dataflow.GenerateNodeAffinity(*batchv1.Job) cannot be called directly. As a result, DataBackup.Status.NodeAffinity is never set, breaking the dataflow affinity chain for any operation that depends on a DataBackup via runAfter.

Proposed fix

  1. Add GenerateNodeAffinityFromPod(pod *corev1.Pod) to pkg/dataflow/helper.go, applying the same annotation-based logic as the existing GenerateNodeAffinity(job *batchv1.Job)
  2. Call it in DataBackup.OnceHandler.GetOperationStatus() after the pod succeeds, same as other handlers do for jobs

I'd like to work on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions