Package org.apache.hadoop.hbase.backup
Class TestBackupDeleteWithContinuousBackupAndPITR
java.lang.Object
org.apache.hadoop.hbase.backup.TestBackupBase
org.apache.hadoop.hbase.backup.TestBackupDeleteWithContinuousBackupAndPITR
@Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestBackupDeleteWithContinuousBackupAndPITR
extends TestBackupBase
Tests the deletion of HBase backups under continuous backup and PITR settings.
Terminology:
- ct (current time): Current timestamp
- maxAllowedPITRTime (mapt): Maximum allowed time range for PITR, typically a cluster-level config (e.g., 30 days ago)
- cst (continuousBackupStartTime): Earliest time from which continuous backup is available
- fs: Full backup start time (not reliably usable)
- fm: Time when snapshot (logical freeze) was taken (we don't have this)
- fe: Full backup end time (used as conservative proxy for fm)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.backup.TestBackupBase
TestBackupBase.FullTableBackupClientForTest, TestBackupBase.IncrementalTableBackupClientForTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.backup.impl.BackupSystemTableFields inherited from class org.apache.hadoop.hbase.backup.TestBackupBase
autoRestoreOnFailure, BACKUP_REMOTE_ROOT_DIR, BACKUP_ROOT_DIR, conf1, conf2, famName, NB_ROWS_IN_BATCH, provider, qualName, secure, table1, table1_restore, table1Desc, table2, table2_restore, table3, table3_restore, table4, TEST_UTIL, TEST_UTIL2, useSecondCluster -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertDeletionFails(org.apache.hadoop.hbase.backup.impl.BackupSystemTable table, String backupId) private voidassertDeletionSucceeds(org.apache.hadoop.hbase.backup.impl.BackupSystemTable table, String backupId, boolean isForceDelete) private booleanbackupExists(org.apache.hadoop.hbase.backup.impl.BackupSystemTable table, String backupId) private String[]buildBackupDeleteArgs(String backupId, boolean isForceDelete) private voidprivate voidconfigureContinuousBackup(long cstTimestamp) Configures continuous backup with the specified CST (continuous backup start time).private StringcreateAndUpdateBackup(long startTs, long completeTs) Creates a full backup and updates its timestamps.private intdeleteBackup(String backupId, boolean isForceDelete) private org.apache.hadoop.hbase.backup.BackupInfogetBackupInfoById(String backupId) voidvoidvoidMain Case: continuousBackupStartTime >= maxAllowedPITRTimevoidMain Case: continuousBackupStartTime >= maxAllowedPITRTimevoidMain Case: continuousBackupStartTime < maxAllowedPITRTimevoidMain Case: continuousBackupStartTime < maxAllowedPITRTimevoidMain Case: continuousBackupStartTime < maxAllowedPITRTimevoidMain Case: continuousBackupStartTime < maxAllowedPITRTimeMethods inherited from class org.apache.hadoop.hbase.backup.TestBackupBase
backupTables, backupTables, checkFailed, checkSucceeded, createBackupRequest, createBackupRequest, createBackupRequest, createTables, deleteContinuousBackupReplicationPeerIfExists, dumpBackupDir, fullTableBackup, getBackupAdmin, getLatestBackupManifest, getListOfWALFiles, incrementalTableBackup, insertIntoTable, loadTable, setUp, setUpHelper, tearDown, toList
-
Field Details
-
backupSystemTable
-
-
Constructor Details
-
TestBackupDeleteWithContinuousBackupAndPITR
-
-
Method Details
-
configureContinuousBackup
Configures continuous backup with the specified CST (continuous backup start time).- Throws:
IOException
-
cleanupContinuousBackup
- Throws:
IOException
-
testDeletionWhenBackupCompletesBeforeCST
Main Case: continuousBackupStartTime < maxAllowedPITRTimeSub Case: fe < cst
- Throws:
Exception
-
testDeletionWhenBackupStraddlesCST
Main Case: continuousBackupStartTime < maxAllowedPITRTimeSub Case: fs < cst < fe
- Throws:
Exception
-
testDeletionWhenBackupWithinCSTToMAPTRangeAndUncovered
Main Case: continuousBackupStartTime < maxAllowedPITRTimeSub Case: fs >= cst && fe < mapt
- Throws:
Exception
-
testDeletionWhenBackupExtendsBeyondMAPTAndUncovered
Main Case: continuousBackupStartTime < maxAllowedPITRTimeSub Case: fs >= cst && fe >= mapt
- Throws:
Exception
-
testDeletionWhenBackupBeforeCST_ShouldSucceed
Main Case: continuousBackupStartTime >= maxAllowedPITRTimeSub Case: fs < cst
- Throws:
Exception
-
testDeletionWhenBackupAfterCST_ShouldFailUnlessCovered
Main Case: continuousBackupStartTime >= maxAllowedPITRTimeSub Case: fs >= cst
- Throws:
Exception
-
testDeleteIncrementalBackup
- Throws:
Exception
-
testDeleteFullBackupNonContinuousTable
- Throws:
Exception
-
createAndUpdateBackup
Creates a full backup and updates its timestamps.- Throws:
Exception
-
assertDeletionSucceeds
private void assertDeletionSucceeds(org.apache.hadoop.hbase.backup.impl.BackupSystemTable table, String backupId, boolean isForceDelete) throws Exception - Throws:
Exception
-
assertDeletionFails
private void assertDeletionFails(org.apache.hadoop.hbase.backup.impl.BackupSystemTable table, String backupId) throws Exception - Throws:
Exception
-
backupExists
private boolean backupExists(org.apache.hadoop.hbase.backup.impl.BackupSystemTable table, String backupId) throws Exception - Throws:
Exception
-
deleteBackup
- Throws:
Exception
-
buildBackupDeleteArgs
-
getBackupInfoById
private org.apache.hadoop.hbase.backup.BackupInfo getBackupInfoById(String backupId) throws IOException - Throws:
IOException
-