Skip to content

fix(table): clone row delta snapshot properties#1403

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/row-delta-props-clone
Open

fix(table): clone row delta snapshot properties#1403
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/row-delta-props-clone

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Why

Transaction.NewRowDelta used to store snapshotProps by reference. If callers mutated the same map after creating a row delta, those changes leaked into snapshot summary metadata after commit.

Fix

Clone snapshot properties at construction time so the RowDelta snapshot metadata is isolated from caller-owned maps.

  • Defensive-copy snapshotProps in NewRowDelta.
  • Add a regression test (TestNewRowDeltaCopiesSnapshotProperties) that mutates the original map after NewRowDelta and verifies the committed snapshot still uses the original values.

Testing

go test ./table -run TestNewRowDeltaCopiesSnapshotProperties -count=1

@fallintoplace fallintoplace requested a review from zeroshade as a code owner July 5, 2026 00:09
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.

1 participant