Fully automated to backupSource restores with filesystem backups

Description

In K8SPSMDB-1109, we implemented backupSource support for filesystem backups but user needs to perform some manual steps beforehand: Volume that holds the backup needs to be added to .spec.replsets[].sidecarVolumes and it needs to be mounted to backup-agent container by adding it to .spec.backups.volumeMounts. After these steps, user can restore a backup on the volume using backupSource. We need to think about if we can fully automate this.

Environment

None

Activity

ege.gunes 
4 days ago

the idea is to allow user to set all the volumes required for restore in backup source for filesystem type backups. like this:

this means, operator should check if all statefulsets are configured to have required sidecarVolumes and if pbm-agent containers correctly mount them. so operator should update statefulsets if required. this means we'll have rolling restart before starting the restore. (we already have a rolling restart physical restores and we don't need to do anything about it. this only applies to logical restores.) the problem is the behavior after restore: operator should revert changes in statefulsets after restore finishes. this means we'll have another rolling restart after restore finishes.

i think we have 2 options:

  1. we can say that rolling restart after restore is OK. users can prevent the restart by configuring the required volumes in cr.yaml prior to restore.

  2. we can update cr.yaml in k8s for not requiring another restart. problems with this approach:

    1. we usually don't mutate CR applied by user.

    2. what if CR already has some sidecarVolumes or volumeMounts for backups?

to best option seems to be p.1. we can recommend users to mount these volumes before hand in our docs.

however, current uses cases i see doesn’t indicate that users want to run restores with backups in different volumes. so i don’t think it’s worth adding code to automate this. i will move this ticket to on hold. we can reconsider if someone shows interest into this feature.

Details

Assignee

Reporter

Labels

Needs QA

Needs Doc

Story Points

Fix versions

Priority

Created November 6, 2024 at 8:33 AM
Updated 4 days ago