Repository navigation
fix(sql): preserve complete join expression ownership - #29919
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? |
7361b08 to
bf11829
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
本轮修复、rebase 和最终评审(commit bf11829efc778c19cb778e4c3a9c2b7fd69d7c81):
- 确定性对照确认 CI 根因:CN0 的 REVOKE 已提交,但默认普通快照允许 CN1 尚未应用该提交。原测试立即断言拒绝,缺少可见性屏障。冻结 CN1 logtail 后可复现同一 EXPLAIN ANALYZE 仍成功;实际观察到已有 SyncCommit 的目标时间戳等待;释放后同步完成,同一热会话收到权限错误。
- 修复复用现有
mo_ctl('cn','synccommit',''),覆盖远端目录变更后的观察边界,并保留独立热缓存、旧数据事务、各协议/nested/角色/grant-option/目录故障断言。恢复在撤权前注册,使用独立有界上下文;连接由所属子测试清理,失败后停止后续依赖场景。诊断 overlay 不进入 PR。 - 已 rebase 到 main
a5b7d1e75fde337400d4f0c71932a0ebbaff0b30。完整权限测试 normal/race PASS(79.128s/31.212s);planner/compiler/hashjoin/loopjoin 整包 normal/race 全部 PASS。5 包增量 vet、配置 lint、molint PASS,0 新增诊断,11 条提示均对照 base 确认。正常 spill 检查的初始整包上限过短,按原 12 分钟上限串行补跑完整 hashjoin PASS(99.508s)。 - gpt-6.1-sol/xhigh 设计和最终整体评审通过,最终核对全部 14 文件:无未解决实质阻断项。最终评审 session
01a12d5d-e3e9-7043-9a4e-b5902f3829e1。CI 修复仅改现有测试,生产运行路径无新增开销;原 JOIN 生产改动净减 50 行。
没有未处理的 inline review comments。原始 correlated-limit 55/55 两轮与原 head 的多 CN BVT 是历史验证;新 head 远端 CI 尚待结果。原 size-label 的 TLS 网络失败将随新提交重新执行。
|
mo-bot review · Commit: Assessment: approve 完成全部 14 文件及相关调用链审查,未发现已确认的未解决缺陷。JOIN 输入归属判断统一到既有表达式分析,重复判断已删除;权限测试修复保留了原有安全断言和缓存行为。 Model: Session: Validation:
Limitations:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: bf11829efc778c19cb778e4c3a9c2b7fd69d7c81
Assessment: approve
完成全部 14 文件及相关调用链审查,未发现已确认的未解决缺陷。JOIN 输入归属判断统一到既有表达式分析,重复判断已删除;权限测试修复保留了原有安全断言和缓存行为。
Model: gpt-6-astra / xhigh
Session: 01a12d8f-8e48-7622-ad17-b605f08450ce · slot 1 · generation 0
Validation:
-
核实指定 HEAD、冻结证据和完整 patch 一致,源码保持干净。
-
追踪常量提升、JOIN 键与残余条件拆分、MARK/shuffle 的 NULL 规则、行数优化,以及 hashjoin/loopjoin 的错误传播和 Reset/Free。
-
审查全部新增测试与 SQL 结果,包括原始 UPDATE、重复执行、NULL、无匹配、混合输入、空右表、聚合及残余条件失败后的会话可用性。
-
确认 SyncCommit 使用既有时间戳应用屏障,不直接清空其他会话权限缓存;独立协议会话、旧事务、角色、嵌套授权和目录故障断言仍保留。
-
当前 HEAD 的冻结 CI:构建、Ubuntu/x86 UT、ARM64 SCA、覆盖率及 proxy/pessimistic 多 CN BVT 均成功。复用作者记录的 planner/compiler/hashjoin/loopjoin 整包 normal/race 和完整权限回归验证。
-
本轮仅执行范围一致性检查,未运行 native 测试或使用遗留二进制。完整记录:/home/xupeng/.local/state/mo-bot/jobs/87fd1d9fe140527a54deb6a1/attempt-1/review-record.md。
Limitations:
-
冻结材料没有关联 issue 的独立正文;依据 PR 复现描述、代码和回归契约核对需求。
-
未独立重跑 native 测试;CI 材料仅提供检查结论,作者诊断 overlay 和历史 BVT 运行未冒充本轮执行。
-
未测量吞吐变化。新增分析位于规划/编译阶段;混合条件转为正确的残余或循环连接不代表所有工作负载性能不变。
-
跳过的 Darwin、升级和 optimistic 作业不构成验证;ARM 静态分析不等同于 ARM 运行时验证。
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed bf11829 against merge-base a5b7d1e. No blocking finding.
Complete operand ownership, rather than the first column or a conflicting subtree mistaken for a constant, now governs post-remap hash-key admission. Mixed/unknown/correlated forms remain residuals, genuine one-side computed keys remain eligible, and orientation agrees across compiler, shuffle/MARK and row-count-only consumers. Foldable scalar pullup uses the existing constant policy; volatile and genuine inner expressions still retain their exports.
The permission-test fence is correctly limited to test visibility: it synchronizes remote catalog application before asserting authorization, without clearing the warm session caches or changing production consistency. Partial-failure restoration and subtest connection cleanup remain owned.
Reviewed the complete changed hunks and reused the reported complete normal/race package checks, authenticated two-CN tests, deterministic visibility control and public SQL/BVT evidence. Current-head CI is green. No local native suite or throughput benchmark was rerun by me.
|
mo-bot work · Commit: Final gate confirms the noop. The sole trigger is Qodo’s account notice; no source repair or remote action is warranted. |
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #29897
What this PR does / why we need it:
The released correlated permission UPDATE panics because decorrelation exports a literal CAST as an inner projection column, making an outer CASE reference both JOIN inputs.
HasColExprtreats a conflicting child's-1as column-free, admits the mixed expression as a hash key, and one-input evaluation reads the wrong vector. On current main the same artificial column also prevents proving the outer correlation key for correlated LIMIT.Keep genuinely foldable function expressions inline during PROJECT/AGG predicate pullup through the existing
function.IsConstantpolicy. Genuine inner and volatile expressions retain their exports. Complete JOIN-side analysis and one post-remap equality predicate serve admission/orientation, compiler key/residual splitting, shuffle/MARK and row-count-only eligibility. Mixed, unknown and correlated operands use the existing two-input residual/loop evaluation. Remove the compiler's first-column walker and redundant MARK ownership walker; retain pre-remap policies and NULL rules. Ordinary computed one-side hash keys remain eligible.The existing remote privilege-cache regression assumed CN0's REVOKE completion meant CN1 had already applied it. Its default snapshot policy permits an older locally applied snapshot, so a warm grant can remain valid until replay advances. Reuse public
mo_ctl('cn','synccommit','')after catalog mutation boundaries before observing authorization. Keep separate warm text, SQL-prepared and binary sessions, old data transactions, nested authorization and catalog-fault assertions. Batch consecutive replacement/bootstrap mutations. Subtest-owned connections and restoration registered before revoke-and-sync handle partial failure; failed scenarios stop subsequent dependent cases.The CI repair changes only this test; production snapshot/cache consistency retains its documented contract. The original JOIN correction runs during preparation and adds no per-row validation. No throughput improvement is claimed.
Current validation
Rebased onto pinned main
a5b7d1e75fde337400d4f0c71932a0ebbaff0b30. Go 1.27.1, Linux amd64, matching native source/artifact provenance and repository CGo wrapper. UT uses CI's-vet=offwith independent static checks.TestPrivilegeCacheTracksRemoteCatalogChangesPASS normally (79.128s) and under race (31.212s), retaining all existing protocol, nested/old-transaction, role, replacement, grant-option and fault cases.go vet, configured golangci-lint and molint cover planner/compiler/hashjoin/loopjoin/issues including the uncommitted test amendment: PASS, 0 introduced lint issues. All 11 molint advisories match expressions on pinned main. Formatting/diff checks PASS.gpt-6.1-sol/xhighdesign: APPROVE, session01a12d4b-e56c-7163-a64f-01b3d9e931fc. Complete overall review and terminal evidence reconciliation: APPROVE, no unresolved material blocker, covering all 14 final file hashes, in session01a12d5d-e3e9-7043-9a4e-b5902f3829e1.Normal hashjoin's initial four-minute aggregate guard expired while spill cases were progressing; the serial full-package rerun with the original twelve-minute guard passed. Interrupted Go tool/cache/linker runs and a diagnostic startup with an overlong Unix socket path are not counted as passes or attributed to this PR.
Earlier public evidence and remote CI
Original public UPDATE with content-type/permission metadata and foreign keys produced exact
(1,'change',101), (2,'add',102), (3,'publish',103)and retained per-key ROW_NUMBER partitioning. Extendedsubquery/correlated-limit.sqlcovered idempotence, NULL/no match, mixed CASE with/without a valid hash key, unmatched LEFT rows, empty right input, correlated aggregate, residual error and subsequent successful SQL: normal mo-tester comparison 55/55 twice, teardown verified. These are earlier runs; their SQL/golden inputs remain unchanged after rebase.Original-head CI at
7361b0889e(run 38153917185) passed build, ARM64 SCA, UT Coverage, Proxy/pessimistic multi-CN BVT and coverage aggregation. UT failed only the remote-revoke assertion corrected here; the size-label action independently failed its GitHub API TLS connection. New-head CI remains pending after push.Production increment: +64/-114 (net -50); Go tests +196/-38; BVT SQL +65/result +89; documentation 0. The CI amendment is +58/-36 in the existing permission test, with no new fixture or production mechanism.