perf: optimize rollback validation by checking lazy rollback policy before clustering validation#17537
Merged
nsivabalan merged 2 commits intoapache:masterfrom Dec 30, 2025
Merged
Conversation
…g and execute validateRollbackSequence method. To determine whether an instant is Clustering instant or not needs opening the requested file. By doing the eager checks in advance we can skip reading .requested files for replacecommit files.
Collaborator
nsivabalan
approved these changes
Dec 30, 2025
PavithranRick
pushed a commit
to PavithranRick/hudi
that referenced
this pull request
Jan 8, 2026
…efore clustering validation (apache#17537)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the issue this Pull Request addresses
This PR optimizes the rollback validation process by reordering conditional checks to avoid unnecessary file I/O operations. Currently, determining whether an instant is a clustering instant requires opening and reading the
.requestedfile. By checking if the lazy rollback is enabled first, we can skip the expensive clustering instant validation for lazy rollback scenarios.Summary and Changelog
Improves rollback performance by reducing unnecessary file reads during validation.
Changes:
config.getFailedWritesCleanPolicy().isEager()) earlier in the validation flowvalidateRollbackCommitSequence()to only execute when needed (eager clean policy on non-metadata tables)Impact
Minor performance improvement for rollback operations when lazy rollback is enabled. No API changes or breaking changes.
Risk Level
none - This is a code restructuring that maintains the same validation logic but changes the order of execution to optimize performance. The validation behavior remains unchanged.
Documentation Update
None. This is an internal optimization with no user-facing changes or new configurations.
Contributor's checklist