Skip to content

Fix an issue with duplicated backups of decommissioned host WAL files - #228

Merged
krconv merged 2 commits into
hubspot-2.6from
kodey-fix-backup-logs
Dec 16, 2025
Merged

Fix an issue with duplicated backups of decommissioned host WAL files#228
krconv merged 2 commits into
hubspot-2.6from
kodey-fix-backup-logs

Conversation

@krconv

@krconv krconv commented Dec 15, 2025

Copy link
Copy Markdown

After #227 fixed the issue with WALs from decommissioned RegionServers not being included in backups, we found that there is another problem with this logic: WALs that are replayed and included in an incremental backup cannot be replayed again, because doing so effectively replays the edits out of order. In this case, a compaction can remove a tombstone that was applied after the original edit, and replaying the edit again will cause the cells to incorrectly re-appear.

long logTs = BackupUtils.getCreationTime(logPath);
Long existingTs = newestTimestamps.get(logHost);
if (existingTs == null || logTs > existingTs) {
newestTimestamps.put(logHost, logTs);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

newestTimestamps is a collection of the last timestamps that will be included in this backup. When the backup finishes, these are stored in the backup table, and will be used when the next backup runs as the lower-bound (exclusive) for WAL files to replay

FileSystem fs = walRootDir.getFileSystem(conf);
if (fs.exists(oldLogDir)) {
for (FileStatus oldlog : fs.listStatus(oldLogDir)) {
String host = BackupUtils.parseHostFromOldLog(oldlog.getPath());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mind if we also filter out meta WAL files? AbstractFSWALProvider.isMetaFile(p)

@hgromer hgromer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Neat. This change is applied to the client. So just need to deploy HBDR in orion once this has built

@krconv
krconv force-pushed the kodey-fix-backup-logs branch from c504349 to 129ce93 Compare December 15, 2025 19:32
@krconv
krconv merged commit 82ee29e into hubspot-2.6 Dec 16, 2025
1 check passed
charlesconnell pushed a commit that referenced this pull request Jul 14, 2026
…#228)

* Fix an issue with duplicated backups of inactive host WAL files

* Skip meta region WAL files
charlesconnell pushed a commit that referenced this pull request Jul 15, 2026
…#228)

* Fix an issue with duplicated backups of inactive host WAL files

* Skip meta region WAL files
charlesconnell pushed a commit that referenced this pull request Aug 4, 2026
…#228)

* Fix an issue with duplicated backups of inactive host WAL files

* Skip meta region WAL files
charlesconnell pushed a commit that referenced this pull request Aug 4, 2026
…#228)

* Fix an issue with duplicated backups of inactive host WAL files

* Skip meta region WAL files
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