mazhengxuan created HBASE-30588:
-----------------------------------

             Summary: Truncating a table can corrupt incremental backups
                 Key: HBASE-30588
                 URL: https://issues.apache.org/jira/browse/HBASE-30588
             Project: HBase
          Issue Type: Bug
          Components: backup&restore
            Reporter: mazhengxuan


h3. Reproduction

On a local MiniCluster:

# Write row \{{A}} to table \{{T}} and take a full backup.
# Write row \{{A1}}, then truncate \{{T}} with region splits preserved.
# Write row \{{B}} and verify that the live table contains only \{{B}}.
# Take a regular incremental backup and restore it to a new table.

The incremental backup succeeded. The restored table contained \{{A}}, \{{A1}}, 
and \{{B}}. The truncate hook clears tracked bulk loads, so the next 
incremental backup can still use the pre-truncate full backup and WAL 
boundaries.

h3. Impact on overwrite restore

{\{restore -overwrite}} disables the target table, then calls 
\{{Admin.truncateTable(target, true)}} before loading the backup. If the 
truncate fix rejects that call because another backup holds the exclusive lock, 
the restore can fail after disabling the target. The target would then remain 
disabled, and a subsequent overwrite attempt would reject it as offline. This 
lock-conflict scenario is based on code inspection.

h3. Expected behavior

* After a truncate, including one performed by a successful overwrite restore, 
the target table requires a new full backup before it can be backed up 
incrementally again. Existing backup images remain restorable by ID.
* If lock contention prevents the overwrite from truncating the target, the 
target remains enabled with its original data. The restore can be retried once 
the lock is released.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to