kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

Add BACKUP new command with options

Open aleksraiden opened this issue 2 years ago • 2 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Motivation

At now we have only BGSAVE command (for compatibility with original Redis semantic), and need a separate SET config options for backup_path. And, as I see, not supporting sync/async mode of backup.

Solution

Command BGSAVE hasn't clear semantic, so I propose a new command: BACKUP <backup_path> SYNC|ASYNC

  • <backup_path> are optional path to store current backup (e.g. /tmp/backup etc.) If backup are exists, it will be destroy before perform a new.
  • SYNC|ASYNC is an option flag (default are ASYNC) for creating backup using sync/async method (see BackupableDBOptions::sync

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

aleksraiden avatar Mar 22 '23 09:03 aleksraiden

A some internal discussion are here - https://github.com/apache/incubator-kvrocks/discussions/483

aleksraiden avatar Mar 22 '23 22:03 aleksraiden

Hi @aleksraiden

I think it's a good proposal, I even think if possible to backup and restore from the remote storage directly. https://github.com/orgs/apache/projects/199?pane=issue&itemId=23218575

git-hulk avatar Mar 24 '23 05:03 git-hulk