Repository navigation
fix(load): restore sampling context and make CN PK checks opt-in - #30697
mergify[bot] merged 4 commits into
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. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
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-xupeng · review
Commit: ce6352a010492ebbc8134e014652d40bc2eacfe0
Assessment: approve
Reviewed the complete 30-file delta, design, callers, tests and frozen comments. Sampling preserves authorization and bounded cleanup; both LOAD planners share the session policy and existing cache lifecycle. The prior CALL/nested-CALL bypass is fixed and verified. Default-OFF duplicate-key behavior is an explicit documented tradeoff. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0
Validation:
-
Verified exact HEAD/base, unchanged source, frozen-patch identity and git diff --check; receipt checks/1792570601288682424-4.json.
-
Isolation preflight passed. Native provenance verification passed after matching 190 native/build inputs; receipts checks/1792570210359360206-3.json and checks/1792570251987024833-36.json.
-
Full frontend, planner and compiler packages passed with -count=1 -vet=all and the supplied test-exec; owner-tests.log and receipt checks/1792570750847546399-4.json.
-
Authenticated two-CN TestLoadRejectsDuplicatePrimaryKeys passed, covering session isolation, policy transitions, direct/CALL/nested CALL, colliding procedure locals, duplicate errors, rollback, recovery and neighboring constraints; load-sql.log and receipt checks/1792570872035758036-4.json.
-
Command, source, exit and log reconciliation passed. Evidence is retained in validation-index.json, evidence-audit.log and review-notes.md under /home/xupeng/.local/state/mo-bot/jobs/34f1390e54648820db7e5756/attempt-1.
Limitations:
-
Did not independently run mo-tester or the original TKE/COS 100M-row workload. Five adjusted distributed BVT blocks retain preexisting skips; one unrelated owning-package test also skipped.
-
Coordinator local_validation was empty. Raw author/CI logs and the linked issue body were unavailable; external performance claims were not treated as independently verified results.
Merge Queue Status
This pull request spent 56 minutes 32 seconds in the queue, including 54 minutes 36 seconds running CI. Required conditions to merge
|
|
补充 2026-10-23 在 129 上完成的 fresh 1T LOAD + 双 CN Q5/Q3 验收:包含 #30697 的版本使用默认 对应 issue #30821 的同组验证记录:129 fresh 1T 默认OFF验收。
每版每条查询一次预热、两轮正式,串行执行。以下来自原工具
预热另行保留:旧版 Q5/Q3 为38.855/37.869秒,新版为37.015/34.519秒。八表行数均符合预期(lineitem 5,999,989,709、orders 1,500,000,000),两版合计12次查询的原始 golden 校验全部通过。lineitem LOAD 耗时旧版2137.074秒、新版2140.176秒,约+0.15%。 性能恢复同时有布局和传输量证据:
两代对象 ID 无交集,但每个对象的行数、metadata_scan返回的大小、orderkey min/max组成的多重集合完全一致;各组查询前后对象清单均未变化。lineitem这里比较的是复合主键第一分量 l_orderkey 的范围。正式查询期间两台CN均有显著RPC输出,另采集的诊断执行计划包含两个实际CN地址。 RPC为查询窗口内进程级 MORPC output 增量,两台AP求和一次,计数单调,未叠加input,不是精确SQL归因或物理NIC字节。相邻查询短间隙的最大合计输出为新版45,944字节、旧版25,625字节,远小于正式窗口。保留采样未观察到spill reserve/reject;诊断plan的SpillSize为0,各节点无OOM、RestartCount=0。测试正常退出,任务实例/临时数据/租约已清理,原始输入及结果证据保留。 结论范围:默认OFF、重新导入后的Q5/Q3,在上述129同机双CN环境已恢复;无需追加默认路径补丁。 已有旧数据对象不会因升级自动重新布局。此结果不替代TKE物理网络/存储环境、完整TPCH套件或CN检查ON路径验收,也不构成同SHA ON/OFF的严格因果实验;OFF保留其既定校验策略差异。 证据与测量边界固定顺序为新版、旧版,每版两轮正式;结果属于工程验收,不宣称统计等价。正式计时为原客户端时间,未导出正式statement Exec.Run;远端operator统计未完整导出。新版Q3单独analyzed plan采于同镜像重启后,仅作诊断,不混入正式成绩。新版首次server stdout在补采诊断时被覆盖;原始正式工具日志、结果、计时、探针、Q5plan、对象清单及首次运行Docker检查均保留。 129证据:
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30613 (LOAD regression after #30519).
What this PR does / why we need it:
Restore authorized first-line sampling for modern LOAD, and add an explicit session policy for the CN primary-key validation enabled by #30421. The default is intentionally OFF to recover the historical bulk-load behavior. Disabling validation changes correctness semantics; it is not a speedup under equivalent checking.
Bind the statement identity with
process.SQLFileAccessContextbefore sampling. Previously the unbound context failed file admission and silently fell back to declared column widths. A BLOB column could make millions of short rows look like a small TP query and reduce reader/CN parallelism. Admission, the sample bound, fallback, and scheduling rules remain unchanged.Add dynamic SESSION BOOL
mo_pk_check_by_cn, default OFF. Both modern and legacy LOAD planners use the session value. OFF omits ordinary LOAD's CN primary-key hash validation; ON retains its current eligible input/target duplicate checks, error 1062, and statement rollback. INSERT checks, index maintenance, foreign keys, andmo_pk_check_by_dnremain independently governed. Existing IGNORE/REPLACE and other validation exemptions remain.Reuse session plan invalidation after a changed SET. Other sessions and equivalent/invalid SETs preserve their state. Existing correctness tests explicitly enable the setting instead of changing their duplicate-error assertions.
Preserve the owning connection's current LOAD policy through frontend background sessions for CALL and nested CALL. System-variable reads bypass identically named procedure locals, preserving the session/global namespace and existing ordinary local/user-variable lookup.
Use the same connection for SET and LOAD:
OFF can admit duplicate input primary keys; it does not remove duplicate rows. The independent TN switch can still reject conflicts, but historical testing showed TN ON alone did not detect duplicates within one input file. The new switch is session-only, does not apply to INSERT, and is not an all-unique-index checking switch. See the versioned design.
Validation:
ce6352a010: both new regressions fail before their respective fixes. Final full frontend package passes (15.357 s); focused background/namespace tests pass (1.142 s); the complete authenticated two-CN LOAD fixture passes (6.870 s). It covers ON/OFF/ON, direct/CALL/nested CALL input and target conflicts, 1062/rollback/recovery, and nil/0/1 same-name procedure locals. Tests use-count=1 -vet=all; incremental four-package lint reports 0 issues. Independent gpt-6-astra medium final review passes.63a964a82f: planner 17.387 s, frontend 14.024 s, compiler 10.249 s. Focused cases cover OFF/ON typed plan shape, both planners, resolver errors/defaults, session cache invalidation, and internal compiler delegation. Scoped vet, incremental lint, formatting and diff checks pass.TestLoadRejectsDuplicatePrimaryKeyspasses (6.219 s), covering session isolation, OFF/ON/OFF on identical LOAD text, invalid/global SET, prepared INSERT across SETs, and existing duplicate/rollback, composite-key, index, FK, parallel-file and cross-batch cases. PREPARE LOAD is not admitted by the existing parser; this change does not extend it.ddl/alter.sqlpasses normal mo-tester comparison twice: 314 successful statements, 42 existing skips, zero failures each; teardown verified. Five other adjusted duplicate-LOAD BVT blocks retain their existing [Enhancement]: Hash join/Hash agg spill #3433 skips and were not executed. Their original error oracles remain intact.2196656528plus the same sampling and switch production patches, 16 CPU / 64 GiB, one identical 2M-row 857,722,330-byte file: PK-only OFF 5.19 s, ON 9.73 s, prior-goodb24d1b31155.16 s. Both return 2M rows/distinct keys and key sum 2,000,001,000,000. OFF has six data writers and no hash-build/dedup operators; ON has one data writer and 16 hash-build/dedup operators. These are single bounded runs with different validation semantics, not statistical or original TKE throughput claims. ON input and existing-table conflicts return 1062 with rollback for both parallel options.Original three-CN TKE 100M throughput for the new head remains pending in run 39540728649, dispatched for exact commit
579e0a1fad124ac4cafd77a88b018919d80dd21f. The earlier workflow run targets sampling-only commitc38e3715539749aee13f3175d4900593b53f6bb8and cannot validate this switch. Design and integrated final review use gpt-6-astra with medium reasoning.