-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29505 [DOC] Document Enhanced Options for Backup Delete Command #7200
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -578,33 +578,60 @@ $ hbase backup describe backupId_1467823988425 | |
| // hbase backup delete | ||
|
|
||
| [[br.delete.backup]] | ||
| === Deleting a Backup Image | ||
| === Deleting Backup Images | ||
|
|
||
| This command can be used to delete a backup image which is no longer needed. | ||
| The `hbase backup delete` command deletes backup images that are no longer needed. | ||
|
|
||
| [[br.delete.backup.syntax]] | ||
| ==== Syntax | ||
|
|
||
| [source] | ||
| ---- | ||
| $ hbase backup delete <backup_id> | ||
| $ hbase backup delete -l <backup_id1,backup_id2,...> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it does not work.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cool thanks for confirming. we are good to merge this and #7199?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also please analyse that this is not a backward incompat change. i am not sure in which version the delete command was added, but if it worked before in say hbase 2, it should still work unless we had a deprecation cycle. this may break user scripts with upgrade otherwise.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
can we wait for one more review, just to be on the safer side. :)
this is just a documentation update, right? But I will still check that. maybe mention a note regarding that?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not as part of this ticket, please create a new JIRA for this. |
||
| $ hbase backup delete -k <days> | ||
| ---- | ||
|
|
||
| [[br.delete.backup.positional.cli.arguments]] | ||
| ==== Positional Command-Line Arguments | ||
|
|
||
| _backup_id_:: | ||
| The ID to the backup image which should be deleted. | ||
|
|
||
| [[br.delete.backup.named.cli.arguments]] | ||
| ==== Named Command-Line Arguments | ||
|
|
||
| None. | ||
| _-l <backup_id1,backup_id2,...>_:: | ||
| Comma-separated list of backup IDs to delete. | ||
|
|
||
| _-k <days>_:: | ||
| Deletes all backup images completed more than the specified number of days ago. | ||
|
|
||
| NOTE: These options are **mutually exclusive**. Only one of `-l` or `-k` may be used at a time. | ||
|
|
||
| [[br.delete.backup.example]] | ||
| ==== Example usage | ||
| ==== Example Usage | ||
|
|
||
| Delete specific backup images by ID: | ||
|
|
||
| [source] | ||
| ---- | ||
| $ hbase backup delete backupId_1467823988425 | ||
| $ hbase backup delete -l backupId_1467823988425,backupId_1467824989999 | ||
| ---- | ||
|
|
||
| Delete all backup images older than 30 days: | ||
|
|
||
| [source] | ||
| ---- | ||
| $ hbase backup delete -k 30 | ||
| ---- | ||
|
|
||
| [CAUTION] | ||
| ==== | ||
| * Deleting a backup may affect all following incremental backups (in the same backup root) up to | ||
| the next full backup. For example, if you take a full backup every 2 weeks and | ||
| daily incremental backups, running `hbase backup delete -k 7` when the full backup is older than | ||
| 7 days will effectively remove the data for all subsequent incremental backups. | ||
| The backup IDs may still be listed, but their data will be gone. | ||
|
|
||
| * If the most recent backup is an incremental backup and you delete it, | ||
| you should run a **full backup** next. | ||
| Running another incremental backup immediately after may result in missing data in the | ||
| backup image. (See link:https://issues.apache.org/jira/browse/HBASE-28084[HBASE-28084]) | ||
| ==== | ||
|
|
||
| // hbase backup repair | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two thing that surprised me when experimenting with backup-restore, and would in my opinion be useful to add, are the following:
An example: assume you do a full backup every 2 weeks, and a daily incremental backup. If you do
hbase backup delete -k 7and the full backup is older than 7 days, you'll have effectively cleared all incremental backups as well. (The backup will still be listed, but the backup data inside it will be gone.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing it out @DieterDP-ng I have updated the doc, please review it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM