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? |
|
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: 6612cf7d113d9551c0c859b1d5bb03282da8f251
Assessment: request_changes
One confirmed EXPLAIN integration defect remains. Temporal row-correctness probes and targeted lifecycle tests passed.
Model: gpt-6-astra / xhigh
Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2
- P2
pkg/frontend/mysql_cmd_executor.go:4216: Plain EXPLAIN plans an eligible temporal query through doExplainStmt → buildPlanWithAuthorization → this wrapper, which supplies a nil temporal scope.
Impact: Plain EXPLAIN cannot select or describe the new temporal access path. It reports a base scan while execution uses a covering index, misleading users about index selection, pruning and local placement.
Evidence: The retained million-row public SQL probe shows EXPLAIN reporting Table Scan forselect id,d from events where d > now(6), while EXPLAIN ANALYZE selects Index Table Scan on events.idx_d [ForceOneCN]. See public-sql-explain-comparison.log and checks/1793427919812636584-5.json. applyCostedTemporalIndex requires a usable scope. Create and release the same bounded planning scope for plain EXPLAIN, and add a public access-path parity regression.
Validation:
-
Foundation tests in 3 packages, focused tests in 16 affected packages, and all newly added tests passed.
-
Selected lifecycle race tests passed with GOMAXPROCS=4/count=3 and GOMAXPROCS=1/count=5.
-
Public SQL matched IGNORE INDEX through repeated execution, timezone changes, DML, rollback, prepared parameters and index removal. Real-cluster reconnect recovery passed.
-
Isolation, native provenance, formatting, unchanged source and discussion coverage checks passed. Receipts, logs and probe hashes are reconciled in validation-index.json.
Limitations:
-
Author-reported large benchmarks and full validation matrices were not independently reproduced; supplied CI remained incomplete.
-
Earlier small-fixture probes did not select the optimization; those runs and one corrected probe compilation error are retained separately from successful validation.
6612cf7 to
4101565
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: 4101565717d762bfae2c4096ff157bff1db06100
Assessment: request_changes
The prior P2 EXPLAIN finding remains unresolved after the rebase. Reviewed the new interactions and reused supplied prior coverage for unchanged contracts.
Model: gpt-6-astra / xhigh
Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2
- P2
pkg/frontend/mysql_cmd_executor.go:4216: Plain EXPLAIN plans an eligible temporal query whose execution selects the new covering-index path.
Impact: EXPLAIN receives no temporal planning scope and cannot select that path, misleading users about index selection, pruning and local placement.
Evidence: doExplainStmt calls buildPlanWithAuthorization, which reaches this nil-scope wrapper. applyCostedTemporalIndex rejects unusable scopes, while ordinary execution creates one. This call chain is unchanged from review 5721632267, whose public SQL probe demonstrated Table Scan versus EXPLAIN ANALYZE's Index Table Scan. Create and release an equivalent bounded scope for supported plain EXPLAIN queries and add a public access-path parity regression.
Validation:
-
Compared all 135 changed files with the prior assessed head: 130 files are identical; 134 PR edit sets are unchanged. The sole new PR edit is six license-comment lines.
-
Inspected all rebase interaction hunks and revalidated the EXPLAIN call chain.
-
Source/evidence audit passed; receipt checks/1793442650424504407-3.json and retained output review-audit.log. All four discussion entries are accounted for.
Limitations:
-
No fresh product tests were run; prior execution results are supplied review reports.
-
Current build, UT, SCA, coverage and Connector/J checks were pending in the frozen evidence and were not counted as passes.
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 0ec56525a6687e2a9698ee9ba771fafb2ba98606
Assessment: approve
The scoped temporal optimization preserves conservative bounds and the full SQL residual while reusing existing selection, mapping and lifecycle owners. Its measured constructor cost is acceptable against the reported sparse-query gain. Earlier EXPLAIN, cache and fixture concerns are resolved; the old-peer protocol request conflicts with the shutdown-only upgrade contract.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed all 27 discussion items and linked issue context. Qualified 122 unchanged files against the exact prior same-PR review; independently reviewed 14 changed files and the removed traversal.
-
Local bounded static audit passed: frozen clean source, patch whitespace, protobuf field/options/enum preservation, function IDs, reader normalization and prior receipt/log integrity. Receipt: checks/1793939514386053769-2.json; retained output: source-audit.log.
-
Author reports exact-head planner/frontend/compile race suites, affected static checks, two-CN/proxy BVT results of 105/105 and 16/16, and distributed result-parity controls.
-
Qualified the reported sparse benchmark to unchanged temporal inputs: 124 to 4 blocks and approximately 90% median improvement. Assessed the reported extra 192 bytes/two allocations and roughly 9–14% constructor microcost.
Limitations:
-
No fresh Go, SQL, BVT or SCA execution. Supplied local_validation is empty; raw author execution logs are unavailable. Pending/skipped CI is not counted as a pass.
-
Historical prepared-query outliers remain unexplained; small performance deltas are inconclusive. Universal performance equivalence, actual reader-DOP coverage and binary-prepared plan selection are not established.
-
Public reverse CAST retains BASE. Prepared, named-zone, non-covering, FORCE and LIMIT cases retain existing safe paths; older engine execution identity and the historical checkpoint/lazy-replay condition remain qualified.
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
|
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: da605a64cd579a8b00bb75aa200a578e16621c90
Assessment: approve
The scoped implementation still coherently reuses existing selector, cache and transaction owners. The sole addition is a sound borrowed-read design proposal that keeps required safeguards explicit. No actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reconciled all 137 changed paths: 136 exactly match prior reviewed source and patch content; independently reviewed the new design and its actual owners.
-
Assessed all 35 discussion entries and both linked issues.
-
Verified prior receipts and retained logs; reused source-matching CI summaries and attributed author execution evidence.
-
Static source/evidence audit passed; source unchanged. Receipt: checks/1793954679120692071-2.json. Details: validation-ledger.json.
Limitations:
-
No fresh product execution; raw author and CI runtime logs remain unavailable. Five current-head CI checks were unfinished.
-
The borrowed-read refactor is unimplemented; its implementation and performance validation remain future obligations.
-
Historical prepared-performance outliers and previously qualified DOP, binary-prepared and checkpoint-GC coverage limits remain.
|
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: de620823b9676b0d406e1b3e91f9f778f7bc16b8
Assessment: approve
Resolver-owned borrowed reads remove ambient frames, the locked registry and retained frontend scopes while preserving authorization, read pairing, cleanup and cache/rebuild contracts. Necessary typed-range and lifetime checks remain. No actionable findings remain. The historical old-peer gate request conflicts with the shutdown-only upgrade contract.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reconciled all 141 changed paths, independently reviewed the 32-file follow-up, and assessed all 37 discussion entries and both linked issues.
-
43 focused normal test roots passed, including public EXPLAIN/result parity and prepared contracts. All 41 focused race roots and 100 single-claim repetitions passed without skips.
-
Full planner normal run passed. Frontend had 2,879 passing roots and one unchanged fixture failing on the read-only checkout; its private-path overlay rerun passed all eight assertions. Three preexisting skips were retained.
-
Isolation, fresh matching native build, formatting and final source/receipt/log audit passed. Commands, actual exits and evidence hashes are recorded in validation-ledger.json.
-
Qualified attributed production-matching full race, two-CN and immediate-pre-refactor performance reports.
Limitations:
-
Raw author runtime logs are unavailable. Broad race, two-CN and performance reports were not independently rerun; five frozen CI checks were unfinished.
-
Historical performance outliers and an earlier intermittent two-CN exit remain unexplained. Reported measurements do not establish workload-wide equivalence.
-
Read-only-fixture, overlay setup and build-timeout diagnostics retain their actual failed or incomplete exits.
|
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: 6ba845886cdd8e3f4d21f6867c557c7fb79e714f
Assessment: approve
No blocking defects found. Lexical borrowed reads reuse ordinary resolution and existing transaction/retry owners; retained safety checks protect distinct contracts. Mixed temporal comparisons require zone/precision conversion; shutdown-only upgrades do not require the proposed old-peer gate.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
145 focused tests across 14 packages and two public SQL tests passed at the assessed head.
-
43 race tests across six packages passed.
-
All 141 changed paths reviewed; formatting, protobuf/builtin compatibility and 21 relocated helper equivalence checks passed.
-
Isolation preflight passed; 198 native inputs and 34 outputs qualified. Commands, source fingerprints, exits and retained logs reconciled in validation-ledger.json.
-
All 39 discussion keys assessed; qualified earlier same-PR execution retained in reused-evidence.json.
Limitations:
-
Broader lint, distributed BVT and performance coverage relies on frozen author reports; raw logs were unavailable. Pending or skipped CI was not counted as passed.
-
Historical prepared-latency and HAKeeper-timeout observations remain unexplained; current controls do not establish a reproducible regression.
|
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: db225c815a0cfb38cde193e49fd1891ee737204a
Assessment: approve
No actionable correctness or design findings. Consolidation removes redundant guard and permission machinery, reuses ordinary resolution and bounded proofs, and preserves necessary residual, catalog, placement and cache/retry safeguards. The earlier mixed-version gate request is inapplicable under the shutdown-only upgrade contract.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Qualified all 142 changed paths: 109 match supplied prior review 5801956203 exactly; reviewed all 33 follow-up paths and affected consumers. Reconciled all 41 discussion entries.
-
Source/protobuf/function-ID audit passed 14 checks; assessment coverage and whitespace audit passed. Receipts and logs are retained in checks/, source-audit.log and closure-audit.log.
-
Considered supplied normal/race, public SQL, two-CN and matched performance reports. Only a descriptor-test correction separates the reported production revision from this head; its final rerun is separately reported.
Limitations:
-
No fresh Go/native/server execution this attempt; supplied runtime and benchmark raw logs were unavailable. Five product CI jobs remained in progress.
-
Performance conclusions remain scoped to reported workloads and controls; historical prepared-timing and shutdown anomalies remain unexplained.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #31619; its wrong-result bug was fixed by #31624. This PR improves eligible AUTO index selection for mixed DATETIME/TIMESTAMP comparisons and separately fixes stale cached plans after
time_zonechanges. The original FORCE INDEX/LIMIT query retains its existing safe path. It addresses part of #32318; the remaining cache and typed-range responsibilities are described in the reviewed design.What this PR does / why we need it:
A DATETIME is a wall-clock value and a TIMESTAMP is an instant. Their mixed comparison depends on time zone and timestamp precision, so a physical key range must be conservative. The optimizer derives a necessary range, lets the existing cost-based selector compare a covering index with BASE, and retains the complete original predicate as the residual.
NOW(6)is one eligible statement-stable bound, not a query-specific special case.Validation
End-to-end performance
On
10.222.1.57, A = mainbfdf875816, B = previous PR head6ba845886c, C = production code incc766a273a(the finaldb225c815aadds only a descriptor test correction). Identical Go 1.27.1, amd64 v3/simd,-funcalign=64, native libraries and test probe; 1,000,001 rows, seven phases, 25 warmups and 100 timed executions per phase. Twelve separate processes ran ABCCBA and CBAABC. All 84 phase full-rowIGNORE INDEXoracles passed and row counts/checksums agreed. Each cell gives the geometric mean of the two per-process percentiles in that block, in ms.Main advanced to
720a5488ecafter the comparison started; the only intervening changes are deployment documentation and a deployment script, so the tested SQL/build inputs are unchanged. The binary hashes for A/B/C are34f5de21…/353a0032…/3f8a10b6….The issue-shaped query is
SELECT id,d FROM events WHERE d > NOW(6)over a shuffled DATETIME(6) index with 1,000 matches. Main scanned BASE/124 blocks; both B and C used INDEX/4. Ordered sparse remained BASE/4; same-domain and dense controls remained BASE/124. The parameterized binary-prepared physical plan was not observed.p50: A (main) and B (previous PR) → C (current)
p95: A (main) and B (previous PR) → C (current)
Process-wide CPU and allocated bytes include client/background work and do not isolate planner or native memory. Shuffled sparse CPU fell from 30.9/30.1 to 1.34/1.28 ms per query, and process Go allocation from 1.11/1.13 MB to 0.61/0.60 MB. The second block’s adjacent main/main sparse p50 differed by +51.2%; results for smaller changes must be interpreted with same-version controls. The previous PR → current prepared p50 was +7.0% / +2.0%, with p95 -2.8% / -12.2%; the adjacent current/current prepared p95 varied -27.5%. Host monitoring sampled other work on test CPUs or their siblings in some dense/ordered windows; its two-second cadence missed 7 of 12 prepared windows. The B binary also has an extra RUNPATH entry, although its linked libraries and the runtime
LD_LIBRARY_PATHmatched A and C. These observations do not prove that all workloads are free of regression.An earlier
dfc3ab0e38→de620823b9binary-prepared comparison showed +42.5% p50/+47.9% p95 in one order but +4.1%/+0.5% in the reverse order. Its cause remains unconfirmed. A later instrumented run observed 25/25 cache hits and no source rebuild, but did not explain the historical timing or expose the measured binary statement’s physical plan.A separate test-only allocation profile used the real frontend on 16 cold sparse executions per revision (one warmup, full-row oracle and physical INDEX checked each time). At the synchronous frontend planning-plus-physical-compile stack, Go heap allocation was 143,465 → 114,364 B/query and 1,612.56 → 1,359.06 objects/query from B to C.
temporalIndexOperandswas called twice → once per query; the base-reader shape check remained once and the candidate builder remained twice. The two folded-filter builds created 7+5 → 6+4 executors per query. This is one instrumented run per version, not a latency measurement; it excludes native/CGo memory and Run-only stacks.Correctness and safety
-race. Test-only fault injection changed clock or zone after actual physical INDEX compilation; both complete result maps matched fresh IGNORE controls.-race: types, plan protobuf, plan functions, planner, compile, frontend, readutil, disttae and process. The first combined run exposed an obsolete descriptor-test expectation; the test-onlydb225c815acorrection was rerun successfully for the complete protobuf package. Repository-configured gofmt, vet and selected static checks passed for the 20-package delta and the final test-only correction.gpt-6.1-sol/maxreview; validation and final review are reconciled against the submitted revision. Local validation is separate from PR CI.The local reader-parallelism cost is heuristic, and these fixtures do not cover every layout, MaxDop or missing-statistics case. The historical checkpoint-GC-before-lazy-replay boundary was not revalidated. The old 35ea two-CN shutdown timeout was not reproduced in the subsequent controls; its original cause remains unconfirmed. Same-version fixed-offset transport is tested; mixed-version forwarding remains outside the repository’s shutdown-only upgrade contract.