Repository navigation
test(sql): align ODKU CHECK cases with input validation - #33691
Merged
XuPeng-SH merged 1 commit intoDec 2, 2026
Merged
Conversation
Signed-off-by: XuPeng-SH <[email protected]>
1 of 7 tasks
1 task done
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? |
1 task done
XuPeng-SH
added a commit
that referenced
this pull request
Dec 3, 2026
## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: Related to #33556. ## What this PR does / why we need it: The proxy rebalancer could leave an existing session on a CN that the current route no longer selects. With one eligible target, the load threshold can prevent migration from the obsolete source. This is consistent with the placement error in #33556, although the incident's exact connection path could not be recovered. Each rebalance pass fixes its registration boundary before reading CN discovery. It applies the shared routing policy for removed, draining, and relabeled sources, including the existing sys root/dump fallback and a live plugin destination for sessions that originally used Bypass. Backend registrations carry their own route origin during migration and rollback. Built-in pool balancing excludes retained plugin sessions outside that pool. A pass attempts at most one synchronous discovery refresh, reuses compiled label patterns, and defers busy tunnels. Plugin probes use the configured RPC timeout. ### Validation - The previous implementation reproduced the stale-view and sys fallback failures on the same main base. Both regressions pass with the fix. - The full race suites for proxy, cluster service, and route passed on `16b9b15643`. The Proxy suite included the embedded-cluster session migration test and ran with the local HAKeeper listener isolated. Seven focused race tests passed 100 repetitions each, including the two-CN migration followed by a SQL request. The two-CN balance test passed 63 repetitions. Vet and incremental SCA passed. - After rebasing onto `914470d753`, the Proxy race regressions passed again. The intervening base commit updates IVFFlat and the Proxy, cluster-service, route, and native build source files are byte-identical to the tested version. - In a local steady-state benchmark with 64 tenants, 128 CNs and 4,096 registrations, median pass time fell from 7.59 ms to 5.08 ms, and bytes allocated per pass fell from 2.92 MB to 0.70 MB. ### Review follow-up (2026-12-02) - A queued rebalance request now retains the selected backend registration and checks it again before transfer, so a completed migration invalidates stale work. It also checks the current tenant route before evacuating a source or balancing away from the only remaining tenant CN. - A busy tunnel on a draining CN retains scaling transfer intent even if that CN disappears from discovery before the next scan. Tunnel close clears the intent. - Added regressions for route relabeling, stale backend registration, shrinking balance pools, and busy scaling delivery after CN removal. Focused proxy tests and the same focused race tests passed; `go vet ./pkg/proxy` passed. Merged upstream `main` at `f9d52a3a39`. ### Verify the plugin's current selection against the registered endpoint An existing TCP connection may record `127.0.0.1:port` as its peer while the CN advertises `localhost:port`. When a plugin switches from Bypass to Select, the proxy now checks a serving recommendation against the registered CN ID and advertised address before retaining the session. A changed advertised address still permits evacuation. [Review](#33568 (review)) - Rebased onto main `edd86400a89a`. The hostname regression reaches the tunnel's real destination selection with a TCP socket and a mock CN registration. On the reviewed code it attempted a replacement dial. On the corrected code it retains the source when the plugin still selects it. Controls exercise changed recommendations, a changed advertised endpoint, a draining source and load balancing. - Full race runs passed for `pkg/proxy` (37.042s), `pkg/clusterservice` (3.465s) and `pkg/vm/engine/disttae/route` (3.380s). They include automatic two-CN migration followed by a MySQL request and real session migration with privilege checks. The hostname regression passed 100/100 repeats under race. - The incremental SCA selector covered 18 packages for this review fix. Molint and golangci-lint passed. [Previous full PR CI](https://github.com/matrixorigin/matrixone/actions/runs/47020822961) ### Rebased validation for `89068bb76c96` on main `faafdf4fef03` The tested checkout `7be7ae2c341b` matches the published Git tree `9c13314c471196025052449bca3514f8804bad10`. The run used Go 1.27.1 on Darwin ARM64 and the checked native library profile. The package-wide race run completed with exit 0. ```text ok github.com/matrixorigin/matrixone/pkg/proxy 24.612s ok github.com/matrixorigin/matrixone/pkg/clusterservice 1.674s ok github.com/matrixorigin/matrixone/pkg/vm/engine/disttae/route 1.308s ``` The suite includes `TestRebalanceFallbackToNewlyLabeledCN`, which checks one automatic transfer and a successful MySQL command afterward, and `TestRenameUserProxyMigrationPrincipal`, which opens a real client session through Proxy on a two-CN cluster and verifies identity and privileges after transfer. The focused runs separately stress the deferred evacuation and observed drain paths. | Exact test under race | Passed | | --- | ---: | | `TestDeferredEvacuationKeepsRecoveredSource` | 100/100 | | `TestScalingRetainsUnqueuedDrain` | 100/100 | | `TestRebalanceRejectsSupersededRegistration` | 100/100 | | `TestTransferRouteKeepsPreferredTier` | 100/100 | | `TestRebalanceFallbackToNewlyLabeledCN` | 100/100 | | `TestRenameUserProxyMigrationPrincipal` | 3/3 | Incremental molint and golangci-lint passed on those three packages. The local package-race JSON receipt has SHA-256 `1ce1ecdde9172ce921b0c038085dc5b2ba492c998408a0e7393fe00747b710d9`. The base contains #33691, which updates the ODKU CHECK expectations that failed the previous Compose BVT job. The original connection path in #33556 remains unknown. --------- Co-authored-by: XuPeng-SH <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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 #33536. Follow-up to #33687.
What this PR does / why we need it:
The CHECK BVT still expected an invalid incoming row to update an existing row when the duplicate-key assignment had a valid value. #33687 validates the incoming row before duplicate-key arbitration.
Keep that input in the script and assert the CHECK violation and the unchanged stored value. Use a valid incoming row with an invalid assignment to cover CHECK on the UPDATE image independently. A valid input and assignment still update the row to 30.
Ran both versions of
check_constraint.testagainst a local MatrixOne cluster atd96cdf0c26with the failing job's mo-tester revision309a0ca650. The old script reproduced all 3 failures. The updated script passed 71/71 statements. The full Compose BVT suite was not run locally.