Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestoreSpec restoreFilter should also set --path filter #867

Open
dereulenspiegel opened this issue Jun 12, 2023 · 3 comments
Open

RestoreSpec restoreFilter should also set --path filter #867

dereulenspiegel opened this issue Jun 12, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@dereulenspiegel
Copy link

Description

When restoring from a repository in a namespace with multiple PVC it can happen the latest snapshot actually doesn't contain the necessary data. This happens because with multiple PVC multiple snapshots are taken in short succession during a backup operation.
Since restoring from the latest snapshot seems to be the default behavior of the Restore operation, imho the correct latest snapshot should be selected. The restoreFilter should therefore also set the --path option of restic, to let restic automatically select the correct snapshot.
Alternatively this could also be done based on the claimName in the folder restore method.

Additional Context

No response

Logs

No response

Expected Behavior

k8up selects the correct snapshot to restore previously saved data to a PVC instead of generally the latest snapshot, which might not contain the necessary data when multiple PVC are backed up within a single namespace.

Steps To Reproduce

No response

Version of K8up

v2.7.1

Version of Kubernetes

1.27.1

Distribution of Kubernetes

k3s

@dereulenspiegel dereulenspiegel added the bug Something isn't working label Jun 12, 2023
@RomanRomanenkov
Copy link

I have the same problem. I backed up multiple PVCs in a namespace.
And when I want to restore only one particular PVC it restores the latest wrong one

@nikolai5slo
Copy link

While setting up and testing recovery pipelines I have encountered the same issue. Is there any other workaround besides manually specifying snapshot ID?

@johbo
Copy link

johbo commented May 29, 2024

Did bump into this as well, think the code is here: https://github.com/k8up-io/k8up/blob/master/restic/cli/restore.go#L121

Looks to me as if there is currently no other way than specifying the snapshot ID to ensure that the right thing will be restored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants