Skip to content

Preserve committed index state during schema rollback - #6440

Open
joshua-spacetime wants to merge 1 commit into
joshua/pinned-row-tiered-storage-2from
joshua/pinned-row-tiered-storage-3
Open

joshua-spacetime wants to merge 1 commit into
joshua/pinned-row-tiered-storage-2from
joshua/pinned-row-tiered-storage-3

Conversation

@joshua-spacetime

Copy link
Copy Markdown
Collaborator

Description of Changes

Fix two cases where rolling back a transaction could leave committed tables with different duplicate-detection or uniqueness behavior:

  • Preserve the pointer map when undoing a non-unique index addition. Adding that index leaves the existing pointer map untouched, but rollback previously replaced it with None. Subsequent duplicate checks could panic. Restore the saved map only when undoing a unique index addition.
  • Preserve indexes that were already unique before adding a constraint. Rollback previously made every matching index non-unique, including indexes enforcing an existing constraint. Convert and record only previously non-unique indexes, so undo reverses only changes made by this operation.

Both fixes use the existing undo records.

API and ABI breaking changes

N/A

Rollback safety impact

N/A

Expected complexity level and risk

2

Testing

  • Verify that rolling back unique and non-unique index additions restores the pointer map and preserves duplicate detection.
  • Verify that rolling back an additional unique constraint preserves the original constraint, its index uniqueness, and rejection of conflicting inserts.

@joshua-spacetime
joshua-spacetime force-pushed the joshua/pinned-row-tiered-storage-3 branch from c573f70 to 391a967 Compare October 31, 2026 00:35

This branch has not been deployed

No deployments
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.

2 participants