Skip to content

restore with latest #445

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

restore with latest #445

wants to merge 1 commit into from

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Jun 8, 2025

Fixes #436

I am not 100% sure that this will work. The logic is mostly right, but getting tests in place is complex. If you want to try it @ZetaMap and see if it does it, that would be good enough for now.

CI should check that there are no regressions, although restore tests have always been thin.

@ZetaMap
Copy link

ZetaMap commented Jun 10, 2025

mmm i'm not sure if the ?latest url parameter. a cli parameter is not good? or you want to let the server choose the latest backup, or it's not possible to list the files and choose the latest according to the file format?

@deitch
Copy link
Collaborator Author

deitch commented Jun 15, 2025

I am not sure myself. I originally went down a different path, and had another parameter. It then got messy with extra parameter and config. Not terrible, but messy. There is something nice about the URL being self-contained to say "here is what you should take", and it either being a path to an actual file, or to a root that might contain multiple files - could be a directory, or prefix in S3, or even file glob (although globs are not supported right now) - and it indicates what to take.

It also makes it a bit easier to implement, but that is a secondary concern.

@ZetaMap
Copy link

ZetaMap commented Jun 16, 2025

Mmm ok, but the server will need to have some additional configuration to be able to understand the parameter in the URL and decide what to do.
it's not really practical.

@deitch
Copy link
Collaborator Author

deitch commented Jun 17, 2025

the server will need to have some additional configuration to be able to understand the parameter in the URL and decide what to do.

What do you mean? Which server will need additional configuration? Not the database, and not the target (smb, s3, file), because those all are parsed internal to mysql-backup anyways.

@ZetaMap
Copy link

ZetaMap commented Jun 17, 2025

Mmmm but if it's parsed, why using an url option instead of a command option? I don't understand.

@deitch
Copy link
Collaborator Author

deitch commented Jun 19, 2025

Mainly because --target <target> encapsulates the target as a single URL. It is simpler to still have a single URL:

  • https://example.com/foo/bar/file1.tgz = restore this exact file /foo/bar/file1.tgz
  • https://example.com/foo/bar?latest = look in /foo/bar for the most recent file and restore it

Single URL captures it all.

Is there a particular reason to object to it? What is the advantage of any other approach?

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch deitch force-pushed the restore-most-recent-file branch from c193d0c to f092eb7 Compare June 20, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: When restore target file is not specified, restore the latest backup by timestamp
2 participants