fix(view): decode signed account IDs in metadata admission - #27770
Merged
mergify[bot] merged 1 commit intoAug 28, 2026
Conversation
gouhongshen
force-pushed
the
agent/issue-27768-7ca758bd
branch
from
August 28, 2026 00:58
69fe797 to
9ec7540
Compare
gouhongshen
force-pushed
the
agent/issue-27768-7ca758bd
branch
from
August 28, 2026 01:23
9ec7540 to
58c2db3
Compare
Contributor
Author
|
Unrelated CI blockers: the Ubuntu/x86 race UT has two unrelated, separately tracked failures.
|
gouhongshen
force-pushed
the
agent/issue-27768-7ca758bd
branch
from
August 28, 2026 04:39
58c2db3 to
fea15e1
Compare
aptend
approved these changes
Aug 28, 2026
aptend
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the exact head fea15e1. The signed INT32 catalog decode, page-shape validation, error propagation, result closure, and decode-before-write atomicity are consistent with the executor and catalog contracts. Focused normal and race tests, build, and vet passed.
Contributor
|
Queued — the merge queue status continues in this comment ↓. |
Contributor
Author
|
@Mergifyio queue |
Contributor
Merge Queue Status
This pull request spent 20 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
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.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #27768
What this PR does / why we need it:
Root cause
The catalog declares
mo_catalog.mo_account.account_idas signedINT, which is theT_int32vector type. The view-metadata admission fence read that result withvector.MustFixedColNoTypeCheck[uint32]. Race builds validate no-type-check vector access and panic when anINTvector is cast to[]uint32. The former bounded-page fixture also usedT_uint32, so it did not exercise the catalog type contract.A pre-change race run with the fixture corrected to
T_int32reproduced the reported panic atview_metadata_recovery.go:157; the ordinary build passed because the no-type-check helper is unchecked outside race builds.Changes
T_int32, validates the result shape and values, uses checkedint32reads, and converts valid IDs to the internaluint32representation.mo_view_dependencieswrites, preserving failure atomicity.T_int32catalog type and add invalid-page regression cases for wrong type, negative ID, and batch/vector length mismatch. Each case asserts no panic, an error, and no metadata write.BVT is not appropriate for this issue: SQL BVTs cannot directly control the internal executor vector type at this boundary. The focused compile UTs and the exact embedded-cluster issue test cover both the typed handoff and the public admission path.
Issue-to-test proof
TestSeedViewMetadataRevalidationPageIsBoundedsupplies 32 signedINT32account IDs and verifies bounded pagination and cursor advancement.TestSeedViewMetadataRevalidationPageRejectsInvalidAccountPagecovers an unexpectedUINT32vector, a negative signed ID, and a row-count/vector-length mismatch; it verifies panic-free error handling and that no replacement/update follows a rejected page.TestIssue26114CrossAccountBranchQuotaAndOwnershipexercises the reported embedded-cluster path, including bothtarget_quota_and_ownershipandlegacy_metadata_counts_toward_target_quota.Tests run
.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=120s -run ^TestSeedViewMetadataRevalidationPage(IsBounded|RejectsInvalidAccountPage)$ ./pkg/sql/compile-race.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run ^TestIssue26114CrossAccountBranchQuotaAndOwnership$ ./pkg/tests/issues/isolated-race-race -count=2.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s ./pkg/sql/compileAll listed commands passed.
Residual risks
The change is limited to decoding the account discovery page. A malformed catalog result now returns an internal error through the existing admission/recovery error path instead of panicking; generation fencing and bounded progress SQL are unchanged. The local exact race integration test was nondeterministic before the fix, but the corrected internal-vector regression deterministically reproduces the original panic and now passes in race mode.