Skip to content

Conversation

@apurtell
Copy link
Contributor

@apurtell apurtell commented Aug 1, 2025

Although HFiles are copied to the archive in a destructive schema change, recovery scenarios are not automatic and involve some operator labor to reconstruct the table and re-import the archived data. We can easily prevent the deletion of the HFiles of a deleted table or column family by taking a snapshot of the table immediately prior to any destructive schema actions. We also set a TTL on the snapshot so housekeeping of unwanted HFiles remains no touch. Because we take a table snapshot all table structure and metadata is also captured and saved so fast recovery is possible, as either a restore from snapshot, or a clone from snapshot to a new table.

Existing site configuration property prerequisites:

  • hbase.snapshot.enabled = true ( default is true )

New site configuration properties:

  • hbase.snapshot.before.destructive.action.enabled = true ( default is false )
  • hbase.snapshot.before.destructive.action.ttl = <integer>, in seconds ( default 86400 (one day) )

@apurtell
Copy link
Contributor Author

apurtell commented Aug 1, 2025

This is the branch-2/branch-2.6 version of #7183

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Although HFiles are copied to the archive in a destructive schema change, recovery
scenarios are not automatic and involve some operator labor to reconstruct the
table and re-import the archived data. We can easily prevent the deletion of the
HFiles of a deleted table or column family by taking a snapshot of the table
immediately prior to any destructive schema actions. We also set a TTL on the
snapshot so housekeeping of unwanted HFiles remains no touch. Because we take a
table snapshot all table structure and metadata is also captured and saved so fast
recovery is possible, as either a restore from snapshot, or a clone from snapshot
to a new table.

Existing site configuration property prerequisites:

* hbase.snapshot.enabled = true ( default is true )

New site configuration properties:

* hbase.snapshot.before.destructive.action.enabled = true ( default is false )
* hbase.snapshot.before.destructive.action.ttl = <integer>, in seconds ( default 86400 (one day) )
…L as

specified in the soft drop design doc. Set the RECOVERY_SNAPSHOT_TTL attribute
to override the default site-wide TTL for automatic snapshots created before
destructive operations.
@apurtell
Copy link
Contributor Author

apurtell commented Aug 5, 2025

Rebased, including a piece of the design missed last time, incorporating review feedback.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 0s Docker mode activated.
-1 ❌ docker 0m 4s Docker failed to build run-specific yetus/hbase:tp-13296}.
Subsystem Report/Notes
GITHUB PR #7184
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/console
versions git=2.17.1
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 50s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 buf 0m 0s buf was not available.
+0 🆗 buf 0m 0s buf was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ branch-2.6 Compile Tests _
+0 🆗 mvndep 0m 50s Maven dependency ordering for branch
+1 💚 mvninstall 3m 33s branch-2.6 passed
+1 💚 compile 4m 15s branch-2.6 passed
+1 💚 checkstyle 0m 57s branch-2.6 passed
+1 💚 spotbugs 3m 56s branch-2.6 passed
+1 💚 spotless 0m 46s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 2m 58s the patch passed
+1 💚 compile 4m 9s the patch passed
+1 💚 cc 4m 9s the patch passed
+1 💚 javac 4m 9s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 38s /results-checkstyle-hbase-server.txt hbase-server: The patch generated 1 new + 1 unchanged - 0 fixed = 2 total (was 1)
+1 💚 spotbugs 4m 14s the patch passed
+1 💚 hadoopcheck 17m 21s Patch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.0.
+1 💚 hbaseprotoc 1m 24s the patch passed
+1 💚 spotless 0m 46s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 26s The patch does not generate ASF License warnings.
50m 7s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7184
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat hbaseprotoc
uname Linux fd71eb26aefc 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2.6 / 0aaf32e
Default Java Eclipse Adoptium-11.0.23+9
Max. process+thread count 80 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-common hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

Class RecoverySnapshotUtils should be declared as final. [FinalClass]
@apurtell apurtell merged commit 41c191d into apache:branch-2.6 Aug 5, 2025
@apurtell apurtell deleted the HBASE-28919-2.6 branch August 5, 2025 20:55
asf-gitbox-commits pushed a commit that referenced this pull request Aug 5, 2025
…-2.6) (#7184)

Although HFiles are copied to the archive in a destructive schema change, recovery
scenarios are not automatic and involve some operator labor to reconstruct the
table and re-import the archived data. We can easily prevent the deletion of the
HFiles of a deleted table or column family by taking a snapshot of the table
immediately prior to any destructive schema actions. We also set a TTL on the
snapshot so housekeeping of unwanted HFiles remains no touch. Because we take a
table snapshot all table structure and metadata is also captured and saved so fast
recovery is possible, as either a restore from snapshot, or a clone from snapshot
to a new table.

Existing site configuration property prerequisites:

* hbase.snapshot.enabled = true ( default is true )

New site configuration properties:

* hbase.snapshot.before.destructive.action.enabled = true ( default is false )
* hbase.snapshot.before.destructive.action.ttl = <integer>, in seconds ( default 86400 (one day) )

Signed-off-by: Viraj Jasani <vjasani@apache.org>
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 2m 36s Docker mode activated.
-0 ⚠️ yetus 0m 6s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2.6 Compile Tests _
+0 🆗 mvndep 1m 6s Maven dependency ordering for branch
+1 💚 mvninstall 4m 57s branch-2.6 passed
+1 💚 compile 1m 52s branch-2.6 passed
+1 💚 javadoc 1m 6s branch-2.6 passed
+1 💚 shadedjars 6m 25s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
+1 💚 mvninstall 2m 55s the patch passed
+1 💚 compile 2m 7s the patch passed
+1 💚 javac 2m 7s the patch passed
+1 💚 javadoc 1m 13s the patch passed
+1 💚 shadedjars 6m 20s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 0m 29s hbase-protocol-shaded in the patch passed.
+1 💚 unit 2m 30s hbase-common in the patch passed.
+1 💚 unit 308m 12s hbase-server in the patch passed.
347m 18s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR #7184
Optional Tests javac javadoc unit compile shadedjars
uname Linux 033f5aa18b7c 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2.6 / 0aaf32e
Default Java Temurin-1.8.0_412-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/testReport/
Max. process+thread count 4035 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-common hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 2m 32s Docker mode activated.
-0 ⚠️ yetus 0m 6s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2.6 Compile Tests _
+0 🆗 mvndep 1m 18s Maven dependency ordering for branch
+1 💚 mvninstall 5m 59s branch-2.6 passed
+1 💚 compile 2m 17s branch-2.6 passed
+1 💚 javadoc 1m 5s branch-2.6 passed
+1 💚 shadedjars 7m 44s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
+1 💚 mvninstall 4m 11s the patch passed
+1 💚 compile 2m 0s the patch passed
+1 💚 javac 2m 0s the patch passed
+1 💚 javadoc 0m 59s the patch passed
+1 💚 shadedjars 8m 15s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 0m 54s hbase-protocol-shaded in the patch passed.
+1 💚 unit 4m 10s hbase-common in the patch passed.
+1 💚 unit 305m 3s hbase-server in the patch passed.
351m 56s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #7184
Optional Tests javac javadoc unit compile shadedjars
uname Linux 5d926a2a8d75 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision branch-2.6 / 0aaf32e
Default Java Eclipse Adoptium-11.0.23+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/testReport/
Max. process+thread count 4153 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-common hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7184/3/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
…-2.6) (apache#7184)

Although HFiles are copied to the archive in a destructive schema change, recovery
scenarios are not automatic and involve some operator labor to reconstruct the
table and re-import the archived data. We can easily prevent the deletion of the
HFiles of a deleted table or column family by taking a snapshot of the table
immediately prior to any destructive schema actions. We also set a TTL on the
snapshot so housekeeping of unwanted HFiles remains no touch. Because we take a
table snapshot all table structure and metadata is also captured and saved so fast
recovery is possible, as either a restore from snapshot, or a clone from snapshot
to a new table.

Existing site configuration property prerequisites:

* hbase.snapshot.enabled = true ( default is true )

New site configuration properties:

* hbase.snapshot.before.destructive.action.enabled = true ( default is false )
* hbase.snapshot.before.destructive.action.ttl = <integer>, in seconds ( default 86400 (one day) )

Signed-off-by: Viraj Jasani <vjasani@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants