Summary
SyncBackup and SyncRestore never populate BackupExecutionStatus.StartedAt / RestoreExecutionStatus.StartedAt, and they set CompletedAt to metav1.Now() instead of the operator's real completion timestamp. As a result, PSMDB Backup / Restore CRs show an empty status.startedAt and a status.completedAt that does not reflect when the operation actually finished.
Details
For ProviderManaged execution mode, the runtime populates these fields only from what the provider returns — there is no fallback:
https://github.com/openeverest/openeverest/blob/2f7662c55ebf/provider-runtime/reconciler/backup.go#L229-L234
if exec.StartedAt != nil && backup.Status.StartedAt == nil {
backup.Status.StartedAt = exec.StartedAt
}
if exec.CompletedAt != nil {
backup.Status.CompletedAt = exec.CompletedAt
}
(The in-tree Job-mode controller stamps StartedAt itself when it creates the Job, which is why this only affects provider-managed classes.)
In this provider:
Two consequences:
startedAt is always empty. The UI backups table sorts/renders a "Started" column from status.startedAt, and the restore-selection dropdown falls back to the backup name when startedAt is absent.
completedAt drifts. Because the runtime overwrites status.completedAt on every reconcile where exec.CompletedAt != nil, a long-finished backup gets its completion time rewritten to "now" each time the Backup is re-reconciled.
Expected
Map the timestamps the PSMDB operator already exposes on PerconaServerMongoDBBackupStatus and PerconaServerMongoDBRestoreStatus:
| OpenEverest field |
Source |
Backup.status.startedAt |
PerconaServerMongoDBBackup.status.start (Status.StartAt) |
Backup.status.completedAt |
PerconaServerMongoDBBackup.status.completed (Status.CompletedAt) |
Restore.status.startedAt |
PerconaServerMongoDBRestore.metadata.creationTimestamp (the restore CR has no start field) |
Restore.status.completedAt |
PerconaServerMongoDBRestore.status.completed (Status.CompletedAt) |
Reference implementation
provider-percona-xtradb-cluster already does exactly this and can be copied:
if !opBackup.CreationTimestamp.IsZero() {
t := opBackup.CreationTimestamp
exec.StartedAt = &t
}
...
case pxcv1.BackupSucceeded:
exec.State = backupv1alpha1.BackupStateSucceeded
exec.CompletedAt = opBackup.Status.CompletedAt
Notes
- The operator object's status is already available after
controllerutil.CreateOrUpdate (it performs a Get first), so no extra read is needed.
- Guard against zero-valued timestamps (
!t.IsZero() / nil checks) before assigning, as PXC does.
Summary
SyncBackupandSyncRestorenever populateBackupExecutionStatus.StartedAt/RestoreExecutionStatus.StartedAt, and they setCompletedAttometav1.Now()instead of the operator's real completion timestamp. As a result, PSMDBBackup/RestoreCRs show an emptystatus.startedAtand astatus.completedAtthat does not reflect when the operation actually finished.Details
For
ProviderManagedexecution mode, the runtime populates these fields only from what the provider returns — there is no fallback:https://github.com/openeverest/openeverest/blob/2f7662c55ebf/provider-runtime/reconciler/backup.go#L229-L234
(The in-tree
Job-mode controller stampsStartedAtitself when it creates the Job, which is why this only affects provider-managed classes.)In this provider:
SyncBackup—internal/provider/backup.go#L390-L394—StartedAtis never set;CompletedAt = metav1.Now().SyncRestore—internal/provider/backup.go#L517-L521— same.Two consequences:
startedAtis always empty. The UI backups table sorts/renders a "Started" column fromstatus.startedAt, and the restore-selection dropdown falls back to the backup name whenstartedAtis absent.completedAtdrifts. Because the runtime overwritesstatus.completedAton every reconcile whereexec.CompletedAt != nil, a long-finished backup gets its completion time rewritten to "now" each time theBackupis re-reconciled.Expected
Map the timestamps the PSMDB operator already exposes on
PerconaServerMongoDBBackupStatusandPerconaServerMongoDBRestoreStatus:Backup.status.startedAtPerconaServerMongoDBBackup.status.start(Status.StartAt)Backup.status.completedAtPerconaServerMongoDBBackup.status.completed(Status.CompletedAt)Restore.status.startedAtPerconaServerMongoDBRestore.metadata.creationTimestamp(the restore CR has nostartfield)Restore.status.completedAtPerconaServerMongoDBRestore.status.completed(Status.CompletedAt)Reference implementation
provider-percona-xtradb-clusteralready does exactly this and can be copied:SyncBackup—internal/provider/backup.go#L167-L181SyncRestore—internal/provider/backup.go#L307-L320Notes
controllerutil.CreateOrUpdate(it performs aGetfirst), so no extra read is needed.!t.IsZero()/ nil checks) before assigning, as PXC does.