Repository navigation
[Spark] Reject duplicate txn and domain metadata keys in AMT snapshot state - #8437
Merged
murali-db merged 1 commit intoDec 5, 2026
Conversation
… state Snapshot reads of an AMT checkpoint with sidecars now fail with INTERNAL_ERROR when a txn appId or a domain is held more than once across inline entries and sidecars, since the winning entry would otherwise be arbitrary. - The writer's duplicate key check moves unchanged to AMTNonContentSidecarReader.assertNoDuplicateKeys, and a new assertNoDuplicateKeysInCheckpoint is used by the snapshot. - Checksum answers are not checked, non-AMT tables and AMT checkpoints without sidecars are skipped, and each kind is checked at most once per snapshot. - checkpointSizeInBytes in the AMT write usage log now counts the non-content sidecars, and two fields are renamed: numInlineSystemDomainMetadata to numAlwaysInlineDomainMetadata and numDomainMetadataSidecarWithoutCountTag to numDomainMetadataSidecarsWithoutCountTag.
prakharjain09
force-pushed
the
amt-sidecar-non-content-metadata-task-14-dupcheck
branch
from
December 5, 2026 02:33
93b6660 to
07b3112
Compare
murali-db
approved these changes
Dec 5, 2026
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.
Which Delta project/connector is this regarding?
Description
Snapshot reads of an AMT checkpoint with sidecars now fail with
INTERNAL_ERRORwhen a txnappIdor a domain is held more than once across inline entries and sidecars, since the winning entry would otherwise be arbitrary.SnapshotStatecheckssetTransactionsanddomainMetadatawhen they come from a reconstructed AMT checkpoint. Checksum answers are not checked, non-AMT tables and AMT checkpoints without sidecars are skipped, and each kind is checked at most once per snapshot.AMTNonContentSidecarReader.assertNoDuplicateKeys, plus a newassertNoDuplicateKeysInCheckpointused by the snapshot.checkpointSizeInBytesin the AMT write usage log now counts the non-content sidecars, and two fields are renamed:numInlineSystemDomainMetadatatonumAlwaysInlineDomainMetadataandnumDomainMetadataSidecarWithoutCountTagtonumDomainMetadataSidecarsWithoutCountTag.How was this patch tested?
New tests in
AMTNonContentSidecarSuiteon hand-built AMT checkpoints cover a key duplicated across inline entries and a sidecar, a key duplicated across two sidecars, checkpoints without sidecars and non-AMT tables (not checked), lookups answered by the checksum (not checked), and a state reconstructed by another accessor. The write metrics tests check the renamed fields and that the loggedcheckpointSizeInBytesincludes the sidecars. The existing incremental writer duplicate key tests still pass on the shared helper.Does this PR introduce any user-facing changes?
No