Skip to content

fix(requirements): validate missing last partition spec id#1380

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/assert-last-partition-id-nilcheck
Jul 4, 2026
Merged

fix(requirements): validate missing last partition spec id#1380
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/assert-last-partition-id-nilcheck

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

Fix a panic in requirement validation when metadata lacks last partition spec ID (for example v1 or malformed metadata).

The previous implementation directly dereferenced meta.LastPartitionSpecID() and could panic. This change now checks for nil and returns a clean requirement failure message:

  • requirement failed: last assigned partition id is missing

When the field is present, behavior is unchanged and the previous comparison path still validates for mismatches.

Testing

  • go test ./table -run TestAssertLastAssignedPartitionIDValidate -count=1

@fallintoplace fallintoplace requested a review from zeroshade as a code owner July 4, 2026 16:08

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The nil LastPartitionSpecID case now returns a requirement failure instead of panicking, consistent with the other requirement validators, and the tests cover missing/match/mismatch.

@zeroshade zeroshade merged commit 0470b71 into apache:main Jul 4, 2026
15 checks passed
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