Skip to content

Core: Reject reserved properties in snapshot summary set()#17107

Open
sachinnn99 wants to merge 1 commit into
apache:mainfrom
sachinnn99:fix/snapshot-summary-reserved-keys
Open

Core: Reject reserved properties in snapshot summary set()#17107
sachinnn99 wants to merge 1 commit into
apache:mainfrom
sachinnn99:fix/snapshot-summary-reserved-keys

Conversation

@sachinnn99

Copy link
Copy Markdown
Contributor

SnapshotUpdate.set(String, String) lets callers supply arbitrary key/value pairs for the snapshot summary. Inside SnapshotSummary.Builder.build(), custom properties are copied first and computed metrics overwrite them, which protects a metric key only when the metric is actually computed for the commit. A user-supplied value under a reserved metric key that is not computed (e.g. set("added-delete-files", "5") on a commit that adds no delete files) survives into the final summary unchallenged.

This adds reserved-key validation to SnapshotSummary.Builder.set() so that reserved metric keys and the partitions. prefix are rejected with an IllegalArgumentException. Internal callers (SnapshotProducer, BaseRewriteManifests) that legitimately write reserved keys use a new package-private setInternal() bypass. Non-metric operation properties like wap.id remain settable through the public API.

Fixes #17009

User-supplied properties via SnapshotUpdate.set() could silently occupy
reserved metric keys when the metric was not computed for the commit,
corrupting the snapshot summary.

Add reserved-key validation to SnapshotSummary.Builder.set() following
the existing TableProperties.RESERVED_PROPERTIES pattern.
@github-actions github-actions Bot added the core label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snapshot summary: user-supplied properties can occupy reserved metric keys when the metric isn't computed

1 participant