Skip to content

Commit

Permalink
add the autoupdate-spec annotation as workaround for medusa restores
Browse files Browse the repository at this point in the history
  • Loading branch information
adejanovski committed Jun 5, 2024
1 parent 34e35d9 commit 325dda4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/medusa/medusarestorejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ func updateMedusaRestoreInitContainer(req *medusa.RestoreRequest) error {
if err := setRestoreMappingInRestoreContainer(req.RestoreJob.Status.RestoreMapping, req.Datacenter); err != nil {
return err
}
// Temp workaround until this is fixed in cass-operator
setAutoUpdateSpecAnnotation(req.Datacenter)
return setRestoreKeyInRestoreContainer(req.RestoreJob.Status.RestoreKey, req.Datacenter)
}

Expand Down Expand Up @@ -474,3 +476,8 @@ func getRestoreInitContainerIndex(dc *cassdcapi.CassandraDatacenter) (int, error

return 0, fmt.Errorf("restore initContainer (%s) not found", restoreContainerName)
}

// There's a race condition that blocks restore job from completing after the DC is stopped. This is a temp workaround to fix it.
func setAutoUpdateSpecAnnotation(cassdc *cassdcapi.CassandraDatacenter) {
cassdc.ObjectMeta.Annotations["cassandra.datastax.com/autoupdate-spec"] = "once"
}

0 comments on commit 325dda4

Please sign in to comment.