-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29210: Introduce Validation for PITR-Critical Backup Deletion #6848
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
Conversation
d292b73 to
2eb33d3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
anmolnar
left a comment
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.
Overall lgtm. A few comments.
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| // Check if another valid full backup exists for this table | ||
| long finalPitrMaxStartTime = pitrMaxStartTime; |
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.
Why do you need to introduce this new variable?
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.
Otherwise we'll get this error: Variable used in lambda expression should be final or effectively final
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.
I see. Make it final then.
final long finalPitrMaxStartTime = pitrMaxStartTime;
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDelete.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
anmolnar
left a comment
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. just a nitpick.
| } | ||
|
|
||
| // Check if another valid full backup exists for this table | ||
| long finalPitrMaxStartTime = pitrMaxStartTime; |
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.
I see. Make it final then.
final long finalPitrMaxStartTime = pitrMaxStartTime;
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| // Check if another valid full backup exists for this table | ||
| List<BackupInfo> backupHistory = backupSystemTable.getBackupInfos(BackupState.COMPLETE); | ||
| final long finalPitrMaxStartTime = pitrMaxStartTime; |
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.
nit: declare pitrMaxStartTime as a final MutableLong, then no need to use extra variable here.
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
…6848) Signed-off-by: Andor Molnár <[email protected]> Signed-off-by: Wellington Chevreuil <[email protected]>
…pache#6848) Signed-off-by: Andor Molnár <[email protected]> Signed-off-by: Wellington Chevreuil <[email protected]>
…pache#6848) Signed-off-by: Andor Molnár <[email protected]> Signed-off-by: Wellington Chevreuil <[email protected]>
…6848) Signed-off-by: Andor Molnár <[email protected]> Signed-off-by: Wellington Chevreuil <[email protected]>
…6848) Signed-off-by: Andor Molnár <[email protected]> Signed-off-by: Wellington Chevreuil <[email protected]>
This PR introduces validation to prevent the deletion of backups that are essential for Point-In-Time Recovery (PITR). If a backup is the only remaining full backup enabling PITR for certain tables, deletion will be blocked unless the force option is explicitly specified.