Skip to content

Comments

Incremental backups fail on archived bulkloaded HFiles (not yet upstream)#201

Merged
hgromer merged 3 commits intohubspot-2.6from
incr-backups-fail-on-archived-files
Sep 23, 2025
Merged

Incremental backups fail on archived bulkloaded HFiles (not yet upstream)#201
hgromer merged 3 commits intohubspot-2.6from
incr-backups-fail-on-archived-files

Conversation

@hgromer
Copy link
Collaborator

@hgromer hgromer commented Sep 23, 2025

At the moment, when we update the archive list, we're not adding the archived files, we're adding the original bulkloaded HFiles. This means that when we go to re-try loading the bulkloaded files, it'll just fail again.

This PR converts the original bulkloaded HFiles that no longer exist into archived HFiles, so they can be backed up correctly.

archiveFiles.addAll(newlyArchived);
for (String file : newlyArchived) {
String archivedFile = file.substring(rootDir.length() + 1);
archivedFile = new Path(HFileArchiveUtil.getArchivePath(conf), archivedFile).toString();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will it be helpful to log debug the tracking of the files from one directory to the other?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 Yeah good idea

archiveFiles.addAll(newlyArchived);
for (String file : newlyArchived) {
String archivedFile = file.substring(rootDir.length() + 1);
archivedFile = new Path(HFileArchiveUtil.getArchivePath(conf), archivedFile).toString();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should you confirm that this new file path exists before handing it off to the next step? Maybe complain loudly if the file doesn't exist in the new or old location?

Just thinking about how this might silently drop data due to a path manipulation bug.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We won't drop data b/c the call to backup a file that doesn't exist will fail, but I can probably just add a check here to fast fail. Thanks

@hgromer hgromer merged commit b67dbbd into hubspot-2.6 Sep 23, 2025
1 check passed
Copy link
Collaborator

@ndimiduk ndimiduk left a comment

Choose a reason for hiding this comment

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

🚢

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