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? |
|
Queue requested — the merge queue status continues in this comment ↓. |
473171b to
1e91864
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Please close ownership on the new rejection path before merging. The greeting stage is the right place for the ID check, and the existing retry policy gives a bounded path to another eligible CN. The check adds one comparison per backend handshake. A single eligible CN still yields a fast connection failure in the mismatch case.
The full pkg/proxy suite passed under -race at 1e91864079. An additional probe through client.connectToBackend(prevAddr) isolated the ownership failure below. The different-CN mismatch control preserved both indexes.
A different CN with a matching greeting and successful auth can also overwrite the connection-ID entry before migration commits. When source export fails, candidate close removes that entry while the original tunnel remains active. I reproduced this on both this head and the clean base 57cd85573c. In 4.2-dev, handleKill still routes through SelectByConnID. Please scope the PR's failed-migration claim to the transition actually protected, or make registration transfer follow the existing migration commit point.
The two existing regression cases cover rejection before login, then retry and health accounting. Extend the ownership case to assert the drain and routing indexes as well as the ID entry. The issue's real-CN diagnostics establish the preface timing failure, and the PR's fake peer covers Proxy rejection. Keep those claims distinct.
## What type of PR is this? - [x] Test and CI ## Which issue(s) this PR fixes: Related to #33429. ## What this PR does / why we need it: Use the two existing UT Coverage groups for main and 4.2-dev. The legacy and standby Shanghai paths share the prefix-scoped IDC fixture and require successful basic and streaming-write tests. The manual OSS/COS workflow tests the official 4.2-dev source and reports fixed identifiers for both SDK and S3FS failures, even when provider metadata appears later in the Go report. The manual check validates both configs before source checkout and reports Go test timeouts separately. [matrixorigin/CI#505](matrixorigin/CI#505) has merged. All five references use the published commit `d94028c93e14f8054a7cd4d1e2535bbaf59a8ec8`. Its tree is identical to the reviewed CI head. Linux actionlint, 140 companion CI tests, 86 MatrixOne CI tests and the cross-repository retry and cleanup replay passed against the published revision. Exact legacy workflow setup and pass gates were exercised with local MinIO on both source branches. Healthy requests passed and invalid credentials and zero-request reports failed. Replayed the real UT and BVT profiles from [4.2-dev PR #33424, attempt 2](https://github.com/matrixorigin/matrixone/actions/runs/46107411827/attempts/2). Removing the OSS/COS profile kept changed-code coverage at 100% and changed overall block coverage from 76.784% to 76.752%. Live IDC/CS and the manual provider run remain rollout checks.
1e91864 to
cfbd93c
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 19b151353a7c73a8738db1c84341641e861b0b15
Assessment: request_changes
The greeting check and delayed manager registration address the reported mismatch and the earlier same-CN cleanup concern. The new mismatch failure, however, emits an incorrect structured connection ID, undermining correlation of the diagnostic this fix introduces. The separate post-authentication migration mapping issue discussed earlier is also present at the merge-base.
Model: gpt-6.1-terra / max
Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45
- P2
pkg/proxy/handshake.go:290: A backend greeting reports a connection ID different from the ID sent in ExtraInfo.
Impact: The resultingbackend handshake failedevent has an unrelated value in its structuredconnection_idfield. Queries joining Proxy diagnostics by connection ID can miss the affected session or associate the event with another session, although the error text contains the expected and received IDs.
Evidence: The early return occurs befores.connIDis updated, leaving the independent counter assigned bynewServerConnContext;logBackendHandshakeEventlogs that counter. An isolated extension of the existing mismatch test observed request ID 42 and structuredconnection_id1001. Pre-greeting failures already had this logging weakness, but this change introduces the mismatch-specific failure path that encounters it. Emit the request-owned ID for this event and assert the structured field in the regression test.
Validation:
-
Private /tmp and loopback preflight passed: preflight.log and checks/1796019944336716700-3.json.
-
The complete
pkg/proxysuite passed under-race, including a MySQL driver through Proxy with a controlled backend: proxy-package-race.log and checks/1796020456410010372-3.json. -
The mismatch ownership test passed 55 race repetitions and the cached-connection rebinding test passed 100: handshake-stress.log, cache-stress.log, and their checks/1796020546905871081-3.json and checks/1796020552347582714-123.json receipts.
-
The nonzero-ID diagnostic overlay probe failed its structured-ID assertion as described: diagnostic-nonzero-probe.log and checks/1796020484243000091-4.json. The evidence audit verified the overlay, source fingerprint, native inputs, discussion coverage, and receipts: evidence-audit.log and checks/1796020653270594218-5.json.
Limitations:
-
The reported real-CN preface timing diagnostic and direct/Proxy driver smoke were not independently repeated; the supplied PR evidence contains author-reported results without retained raw logs.
-
The separate post-authentication failed-migration ID-map issue remains outside this PR's regression scope. In the normal handler, connection-ID lookup uses the SQL worker; the connection-manager lookup is used by the test-mode handler.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
The change is correct and I found no blocking or non-blocking defects beyond what the prior review already raised and the head already addresses. The proxy now parses the backend greeting with the standalone parseBackendConnID and rejects it whenever the ID differs from the request-owned CNServer.connID that connectContext wrote into the ExtraInfo preface; the CN side is verified (mysql_protocol.go:3910 adopts ExtraInfo.ConnectionID and echoes it in the greeting at :1648), so a healthy path always matches and only the preface-miss failure mode observed in issue #33376 is rejected. The rejection happens before the login packet is forwarded, is classified as a retryable non-timeout connectErr, does not trip the CN health breaker, and lets clientConn.connectToBackendContext retry another eligible CN; on exhaustion the client connection fails fast instead of consuming the 10s auth deadline. Both inline findings from the existing CHANGES_REQUESTED review are fixed in this head and I verified the fixes in code: manager/tunnel ownership moved from construction to a post-handshake register() call (router.go, server_conn.go), so a rejected candidate's Close can no longer remove a live tunnel from the routing, drain, or connection-ID indexes, including the same-UUID Unix address alias case; the new regression test asserts all three indexes plus the ID entry, as requested. The connIDServers pointer-identity guard in connManager.disconnect also stops a superseded source backend from deleting the replacement's entry, an improvement over the base's unconditional delete. The bounds check now also validates len(p.Payload), where the base could slice out of range on a malformed packet. The remaining known gap (a candidate that registers after a successful handshake and then fails during migration removes the connection-ID entry) reproduces on clean 4.2-dev per the prior reviewer, and the PR description now scopes its claim to exclude it exactly as that reviewer requested, so I do not report it as a finding. Test limitation: I could not execute the pkg/proxy suite or even complete go vet in this checkout because the pkg/proxy dependency closure (per a decoded go list -deps -test snapshot, 2159 packages, no errors, no DepsErrors) includes github.com/matrixorigin/matrixone/cgo, which requires thirdparties build products (xxhash.h, roaring.h, usearch.h headers and -lusearch_c/-lroaring from thirdparties/install) that are absent in this worktree; building them with make cgo/make thirdparties is outside review scope. go vet ./pkg/proxy exited 1 at cgo compile with those missing headers (log saved under $TMPDIR), and gofmt over pkg/proxy is clean. Supporting execution evidence comes from the PR record: the prior reviewer ran the full suite under -race, and the author reports rebase-identical patches passing the proxy suite, focused race iterations, and lint on this 4.2-dev base.
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 3e4969685b90e488b721c58c84d5ce667c1bf5bf
Assessment: approve
The greeting check, deferred registration, and request-owned diagnostic ID address the prior review concerns. The change uses the existing handshake and connection-manager ownership paths. The separate post-authentication migration ID-map issue predates this change.
Model: gpt-6.1-terra / max
Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45
Validation:
-
Private /tmp and loopback preflight passed.
-
Current-head race-enabled proxy tests passed for greeting IDs, retry, same-CN cleanup, diagnostics, timeout handling, and cached-connection rebinding; receipt 1796034259837783701-3.json.
-
Reused the prior full proxy race-suite result for unchanged paths after comparing the intervening source changes and its retained receipt.
-
The captured CI snapshot reports successful Linux/x86 unit tests, Linux/arm64 SCA, and proxy and pessimistic multi-CN BVT.
Limitations:
- The author's real-CN delayed-preface diagnostic and direct/Proxy MySQL driver smoke tests were not independently repeated.
🚫 Left the queue · pull request dequeued34 min in the queue, with no time running CI. So far
Reason Pull request #33424 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
To get back in the queue
Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
Nine paired field timeouts showed different connection IDs at the Proxy and CN. The Proxy previously accepted the CN greeting and forwarded the client login, so the failure surfaced later as a backend authentication timeout. The field logs do not establish why the CN missed the connection preface.
The Proxy now checks the greeting against the ID it sent on that physical connection. A mismatch closes that candidate before forwarding login and lets the router try another eligible CN. The existing greeting-stage diagnostic includes both IDs and classifies the failure as non-timeout. Its structured
connection_idis the request ID sent in ExtraInfo, including when the greeting is rejected. A candidate rejected during the greeting has no connection-manager registration to remove. Its cleanup preserves the live tunnel in the routing, drain, and connection-ID indexes, including when a Unix socket address alias selects the same CN. Closing a superseded backend also preserves the replacement's connection-ID entry. A separate pre-existing case remains when a candidate registers after a successful handshake and destination migration then fails.The comparison runs once when opening a backend connection, before SQL execution.
Validation
SELECT 1andSELECT CONNECTION_ID().pkg/proxysuite passed normally and under-race. Isolated backend tests cover zero and nonzero IDs, closure before login, retry on a healthy alternative, and registration ownership during migration.pkg/proxy.After rebasing onto official
4.2-dev(57cd85573c), both original patches matched ingit range-diff. On1e91864079(Go 1.26.4, Darwin arm64),mo-cgo-test -v -count=1 -timeout=180s ./pkg/proxy,mo-cgo-test -race -v -count=1 -timeout=240s ./pkg/proxy, andgo vet -mod=readonly ./pkg/proxypassed. The MySQL driver smoke test and lint results above are from the original validation.The review fix at
cfbd93c894was tested on official4.2-dev(2bdc8daf52) with Go 1.26.4 on Darwin arm64.mo-cgo-test -count=1 -timeout=180s ./pkg/proxyandmo-cgo-test -race -count=1 -timeout=240s ./pkg/proxypassed. Focused race runs passed 54 iterations for backend greeting ownership and 100 for cached backend rebinding.go vet -mod=readonly ./pkg/proxy, molint, and incremental golangci-lint passed. The fake CN verifies Proxy rejection and index ownership. The real-CN timing and MySQL driver observations above come from the earlier validation.The CI refresh at
19b151353arebases the three unchanged Proxy patches onto official4.2-dev(70bb7b3515), which includes the catalog DDL and focused restore test updates from #33458. On Darwin arm64 with Go 1.26.4,mo-cgo-test -short -race -tags matrixone_test -p 1 -count=3passed bothTestDropAccountWithMinimumRowLockCountandTestAlterPublicationExplicitTargetLockScope. The completepkg/proxysuite passed in the same mode with-count=1. The earlier Linux x86 run passed Proxy but failed in the isolated catalog package, with a restore race and an unlock fatal during CN startup. The Linux x86 UT and CI Required checks passed on19b151353a.The handshake diagnostic follow-up at
3e4969685b90was validated on Darwin arm64 with Go 1.26.4. Before the fix, two assertions reproduced a structured ID mismatch for request IDs 0 and 42. After the fix,TestRouter_BackendHandshakeConnectionIDpassed 20 repetitions under-race -tags matrixone_test. The fullpkg/proxysuite passed normally and under-race -tags matrixone_test. Go vet, molint, and incremental golangci-lint passed. Linux CI for this follow-up will run after push.Main PR: #33423