Add a sanity check for duplicate file actions in commitImpl - #6892
Merged
murali-db merged 1 commit intoMay 27, 2026
Conversation
prakharjain09
approved these changes
May 27, 2026
murali-db
approved these changes
May 27, 2026
Contributor
|
@dhruvarya-db @prakharjain09 @murali-db I think it would be possible to be even more strict and disallow duplicated path regardless of DV:
|
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.
What changes were proposed in this pull request?
This PR adds a sanity check to the commit path that rejects a commit containing duplicate file actions for the same
(path, deletion vector id).commitImplpreviously did not validate that the prepared actions were free of duplicates. This change adds that validation:checkNoDuplicateActionshelper on theConflictCheckercompanion object that streams the actions in a single pass and throws if it finds the same file added twice, the same file removed twice, or the same path + deletion vector both added and removed within one commit.DELTA_DUPLICATE_ACTIONS_FOUNDand the correspondingDeltaErrors.duplicateActionCheckFailedhelper.commitImpl, guarded by theDELTA_DUPLICATE_ACTION_CHECK_ENABLEDconfiguration, that runs the check on the prepared actions before a commit is written.ConflictChecker.checkConflictsAndValidateActionsre-runs the duplicate check whenever conflict resolution changes the current transaction's actions.How was this patch tested?
Added 10 tests to
OptimisticTransactionSuiteBasecovering duplicate add, duplicate remove, and add/remove overlap on the same path, including deletion-vector variants (same DV, DV vs. no DV, and different DVs). They run in every concrete suite that mixes in the base trait.Does this PR introduce any user-facing changes?
No.