Skip to content

HBASE-29984 Support separate old WAL directories in backup (#8512) - #8620

Open
taklwu wants to merge 1 commit into
apache:branch-2from
taklwu:branch-2
Open

HBASE-29984 Support separate old WAL directories in backup (#8512)#8620
taklwu wants to merge 1 commit into
apache:branch-2from
taklwu:branch-2

Conversation

@taklwu

@taklwu taklwu commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

this is a clean cherry-pick from 96922fc

Signed-off-by: Tak Lon (Stephen) Wu <taklwu@apache.org>
Co-authored-by: mazhengxuan <mazhengxuan@didiglobal.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The newly added test can be flaky due to creating a potentially-colliding archived WAL file path without explicitly overwriting/ensuring uniqueness.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates HBase backup’s incremental WAL collection logic to handle hbase.separate.oldlogdir.by.regionserver, where archived WALs may be stored under per-RegionServer subdirectories, and adds/extends unit tests to validate the behavior.

Changes:

  • Make incremental backup scan .oldlogs/oldWALs recursively so archived WALs in per-server subdirectories are discovered.
  • Enhance BackupUtils.parseHostFromOldLog to derive host:port from the parent directory when the parent is a full ServerName.
  • Add a new incremental backup manager test and extend existing parsing tests to cover per-server archived WAL layouts.
File summaries
File Description
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupManager.java New test validating incremental WAL collection for both flat and per-server old WAL directory layouts.
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupUtils.java Extends WAL host parsing test coverage for archived WALs placed under a server-name directory.
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupUtils.java Improves archived WAL host parsing by supporting per-server directory layouts and adds a recursive file listing helper.
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalBackupManager.java Switches old WAL enumeration from non-recursive listStatus to recursive listing to support per-server old WAL directories.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Path archivedWAL = new Path(archiveDir, walName);
FileSystem fs = walRootDir.getFileSystem(conf1);
fs.mkdirs(archiveDir);
fs.create(archivedWAL).close();
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.

3 participants