Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
031bdb3 to
40c2064
Compare
|
Rebased onto latest |
|
CI triage/fix update (2026-09-15):
|
|
Follow-up correction pushed in |
aptend
left a comment
There was a problem hiding this comment.
Blocking: CREATE/ALTER VIEW plans can outlive the authoring admission state and are not revalidated at execution. The exact-head focused HAKeeper, LogService, CNService, planner, compiler, frontend, and race tests otherwise passed. The exact-head CI UT failure is the unrelated TestIcebergSQLEngineEmbeddedHarness connection timeout.
| } | ||
| if viewRequiredProtocol > 0 { | ||
| if forAuthoring { | ||
| err = RequirePersistedProtocolVersionForAuthoring( |
There was a problem hiding this comment.
[P1] Recheck the authoring floor at CREATE/ALTER VIEW execution. This check runs only while building the plan. Scope.CreateView (pkg/sql/compile/ddl.go:2682-2772) writes qry.TableDef without revalidating its required_protocol_version, unlike the CreateTable and AlterTable execution paths. Repro: PREPARE CREATE VIEW v AS SELECT inet_ntoa(1) while the authoring floor is 72; let a new admission epoch clear PersistedExpressionProtocolAuthoringFloor to 0; then EXECUTE the stored plan. It still reaches dbSource.Create and publishes a view marked required_protocol_version=72 during the closed authoring window. A local exact-head counterexample that set the floor to 0 and invoked Scope.CreateView with this stored plan expected a protocol-version rejection, but got nil and created v. Please validate the persisted marker with RequirePersistedProtocolVersionForAuthoring at the catalog mutation boundary, and cover prepared CREATE/ALTER VIEW.
#28915) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue #28904 issue #28908 issue #28909 ## What this PR does / why we need it: This is the string-compatibility successor to #28885 and is delivered with #28940 as a real protocol-admission prerequisite. The branch keeps the aggregate protocol allocation from #28885 (v75-v78), the durable persisted-expression read/authoring/generation fence from #28940, and adds the disjoint v79 string-numeric result contract. The prerequisite commits are kept as separate ancestry so the PR is safe before either predecessor is merged; after they land, the review diff collapses to the v79 adaptation. - Accept one-argument `CONCAT` while retaining zero-argument rejection and correct NULL/value behavior. - Preserve the execution-bound occurrence when rebinding prepared `ELT` indexes. Runtime decimal rounding, numeric prefixes, NULL, out-of-range values, and explicit `DOUBLE` casts keep their intended results without mutating the cached plan. - Correct result metadata and execution domains for `FIND_IN_SET`, `STRCMP`, `CHAR_LENGTH`/`LENGTH_UTF8`, `UNCOMPRESSED_LENGTH`, and `CRC32`, while retaining legacy wrappers for older protocol consumers. - Gate sender placement, receiver validation, persisted expression admission, VIEW authoring/read/regeneration/restore, and generation/pending transitions at MORPC v79 so an older CN cannot decode or rebind the new result domain. ## Test plan - Combined affected-package normal tests: `pkg/sql/plan`, `pkg/sql/plan/function`, `pkg/sql/compile`, `pkg/frontend`, `pkg/hakeeper`, `pkg/cnservice`, and `pkg/logservice`. - Focused protocol/admission `-race -count=1` tests, including HAKeeper member capability/pending reconciliation, VIEW restore, sender/receiver placement, prepared `ELT`, wrappers, and one-argument `CONCAT`. - `go list -mod=readonly`, CGo-aware `go vet`, `git diff --check`, and `make build-with-prebuilt-native` all pass on the combined candidate. - On 10.222.1.55 using the combined candidate binary, `func_bounded_result_metadata` passed `63/63` statements, `0` failures in 0.462s. It covers direct/prepared `CONCAT`, prepared `ELT` decimal/prefix/NULL/out-of-range/`DOUBLE`, VIEW/CTAS metadata, and the corrected legacy metadata cells. - No new row-execution hot-path cache or unbounded state is introduced; version detection runs at plan/DDL/metadata boundaries. Official repository CI remains authoritative and is intentionally not awaited here.
37c8939 to
5159b99
Compare
matrixorigin#28915) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28904 issue matrixorigin#28908 issue matrixorigin#28909 ## What this PR does / why we need it: This is the string-compatibility successor to matrixorigin#28885 and is delivered with matrixorigin#28940 as a real protocol-admission prerequisite. The branch keeps the aggregate protocol allocation from matrixorigin#28885 (v75-v78), the durable persisted-expression read/authoring/generation fence from matrixorigin#28940, and adds the disjoint v79 string-numeric result contract. The prerequisite commits are kept as separate ancestry so the PR is safe before either predecessor is merged; after they land, the review diff collapses to the v79 adaptation. - Accept one-argument `CONCAT` while retaining zero-argument rejection and correct NULL/value behavior. - Preserve the execution-bound occurrence when rebinding prepared `ELT` indexes. Runtime decimal rounding, numeric prefixes, NULL, out-of-range values, and explicit `DOUBLE` casts keep their intended results without mutating the cached plan. - Correct result metadata and execution domains for `FIND_IN_SET`, `STRCMP`, `CHAR_LENGTH`/`LENGTH_UTF8`, `UNCOMPRESSED_LENGTH`, and `CRC32`, while retaining legacy wrappers for older protocol consumers. - Gate sender placement, receiver validation, persisted expression admission, VIEW authoring/read/regeneration/restore, and generation/pending transitions at MORPC v79 so an older CN cannot decode or rebind the new result domain. ## Test plan - Combined affected-package normal tests: `pkg/sql/plan`, `pkg/sql/plan/function`, `pkg/sql/compile`, `pkg/frontend`, `pkg/hakeeper`, `pkg/cnservice`, and `pkg/logservice`. - Focused protocol/admission `-race -count=1` tests, including HAKeeper member capability/pending reconciliation, VIEW restore, sender/receiver placement, prepared `ELT`, wrappers, and one-argument `CONCAT`. - `go list -mod=readonly`, CGo-aware `go vet`, `git diff --check`, and `make build-with-prebuilt-native` all pass on the combined candidate. - On 10.222.1.55 using the combined candidate binary, `func_bounded_result_metadata` passed `63/63` statements, `0` failures in 0.462s. It covers direct/prepared `CONCAT`, prepared `ELT` decimal/prefix/NULL/out-of-range/`DOUBLE`, VIEW/CTAS metadata, and the corrected legacy metadata cells. - No new row-execution hot-path cache or unbounded state is introduced; version detection runs at plan/DDL/metadata boundaries. Official repository CI remains authoritative and is intentionally not awaited here.
matrixorigin#28915) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28904 issue matrixorigin#28908 issue matrixorigin#28909 ## What this PR does / why we need it: This is the string-compatibility successor to matrixorigin#28885 and is delivered with matrixorigin#28940 as a real protocol-admission prerequisite. The branch keeps the aggregate protocol allocation from matrixorigin#28885 (v75-v78), the durable persisted-expression read/authoring/generation fence from matrixorigin#28940, and adds the disjoint v79 string-numeric result contract. The prerequisite commits are kept as separate ancestry so the PR is safe before either predecessor is merged; after they land, the review diff collapses to the v79 adaptation. - Accept one-argument `CONCAT` while retaining zero-argument rejection and correct NULL/value behavior. - Preserve the execution-bound occurrence when rebinding prepared `ELT` indexes. Runtime decimal rounding, numeric prefixes, NULL, out-of-range values, and explicit `DOUBLE` casts keep their intended results without mutating the cached plan. - Correct result metadata and execution domains for `FIND_IN_SET`, `STRCMP`, `CHAR_LENGTH`/`LENGTH_UTF8`, `UNCOMPRESSED_LENGTH`, and `CRC32`, while retaining legacy wrappers for older protocol consumers. - Gate sender placement, receiver validation, persisted expression admission, VIEW authoring/read/regeneration/restore, and generation/pending transitions at MORPC v79 so an older CN cannot decode or rebind the new result domain. ## Test plan - Combined affected-package normal tests: `pkg/sql/plan`, `pkg/sql/plan/function`, `pkg/sql/compile`, `pkg/frontend`, `pkg/hakeeper`, `pkg/cnservice`, and `pkg/logservice`. - Focused protocol/admission `-race -count=1` tests, including HAKeeper member capability/pending reconciliation, VIEW restore, sender/receiver placement, prepared `ELT`, wrappers, and one-argument `CONCAT`. - `go list -mod=readonly`, CGo-aware `go vet`, `git diff --check`, and `make build-with-prebuilt-native` all pass on the combined candidate. - On 10.222.1.55 using the combined candidate binary, `func_bounded_result_metadata` passed `63/63` statements, `0` failures in 0.462s. It covers direct/prepared `CONCAT`, prepared `ELT` decimal/prefix/NULL/out-of-range/`DOUBLE`, VIEW/CTAS metadata, and the corrected legacy metadata cells. - No new row-execution hot-path cache or unbounded state is introduced; version detection runs at plan/DDL/metadata boundaries. Official repository CI remains authoritative and is intentionally not awaited here.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #28883
What this PR does / why we need it:
Make persisted-view expression protocol activation a durable, one-way admission
boundary during rolling upgrades and restarts. The leader now checks the
capability of every current HAKeeper voting and non-voting member, even when a
heartbeat is expired; historical store records that are no longer members do
not block activation. While an enabled admission transition is still pending,
the checker first sends the legacy reconciliation entry so old-generation
targets can expire. Only after durable
Pending=falsemay the protocol-bearingentry raise the persisted-expression floor and start a new admission epoch.
The changes preserve the existing tag-22/V3 fail-closed RSM gate, monotonic
floor, generation fencing, snapshot envelope, and protobuf compatibility.
Test plan
TestViewMetadataAdmissionLogStoresReadyWithProtocolChecksCurrentMembers:expired current voting/non-voting members still block V3; upgraded members
pass; missing capability/record blocks; an expired historical non-member does
not block.
TestServiceViewMetadataAdmissionReconcilesPendingBeforeProtocolRaise:deterministic same-UUID generation 10→11 restart with logical ticks proves
legacy drain at floor 0, then V3 floor raise and new-epoch admission.
TestRegenerateViewDefinitionRejectsInvalidPersistedDefinitionsnow derivesfutureVersion := defines.MORPCLatestVersion + 1, so the protocol-rejection-before-parser oracle remains valid when the latest protocol advances.
-race -count=1runs for the dynamic test pass; theprior protocol focused/full-package normal/race and incremental SCA evidence
remains valid because this follow-up changes only a test.