fix insert ignore - #26607
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? |
…/matrixone into 0731-fix-insert-ignore
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head 7532437. The previous ENUM/SET numeric-context blocker and the local/VALUES INSERT IGNORE cases are addressed, and the focused planner/function/util regressions pass. One distributed correctness blocker remains.
P1 — INSERT IGNORE adjustment state is lost at the remote-CN process boundary
The new execution-time YEAR/BIT/ENUM/SET adjustment branches all depend on statementIgnore(proc), which reads proc.GetStmtProfile().GetStatementIgnore(). The frontend sets that flag on the coordinator, but BuildProcessInfo and pipeline.ProcessInfo do not serialize the statement runtime profile, and remoterunServer.go reconstructs a fresh StmtProfile from only txnId/stmtId. Its ignore bit is therefore false.
This is reachable, not just a codec concern: INSERT IGNORE ... SELECT adds the assignment casts in a PROJECT above the source; compilePlanScope keeps PROJECT on each table-scan scope, and table-scan scopes are Remote over the generated CN nodes. If an invalid YEAR/BIT/ENUM/SET value is evaluated on a remote source scope, the same cast that adjusts locally takes its strict error branch and aborts the statement. The added BVT covers INSERT ... SELECT but does not force that projection onto a different CN, so it does not close this execution shape.
A temporary boundary regression on this head set statementRuntimeIgnore=true, built ProcessInfo, reconstructed the remote StmtProfile exactly as remoterunServer does, and asserted the remote flag. It fails: expected true, got false.
Please carry the required statement runtime semantics through ProcessInfo and restore them before remote pipeline execution, with rolling-upgrade-safe behavior, and add a forced remote/multi-CN regression alongside the local control. A minimal public witness is strict mode plus INSERT IGNORE INTO dst(bit(4)) SELECT 31 FROM a source placed on another CN: expected stored 15 without statement failure; the remote projection currently sees ignore=false and raises out-of-range.
Unhappy-path audit: Q1 ownership/transfer fails at coordinator StmtProfile -> ProcessInfo -> remote StmtProfile; Q2 aborts before the write path can apply ignore semantics; Q3 adds no growth risk, but the state-transfer contract is incomplete. diff --check is clean; focused planner, function, and util tests pass; CI is green.
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-review of c716491: the previous blocker is resolved.\n\nThe statement-level IGNORE flag is now carried through ProcessInfo, restored by both codecService.Decode and the remote-run server, and re-serialized on further hops. Missing field data from an older sender decodes to false, so mixed-version execution fails closed instead of silently applying IGNORE semantics.\n\nI also verified the forced multi-CN regression actually sets ForceScanOnMultiCN and exercises an assignment cast on a remote scan scope.\n\nFocused local validation passed:\n- pkg/vm/process: ProcessInfo build/codec round-trip + legacy absent-field case\n- pkg/sql/compile: remote helper/new compile restoration\n- pkg/tests/dml: TestInsertIgnoreSpecialTypeOnRemoteCN\n\nNo blocking correctness issue found.
Merge Queue Status
This pull request spent 34 minutes 18 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26607 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.
Failing checks:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-review of new head 50f55a7 after the main-branch merge.\n\nc71649112e365edd6831725d6ba46a4962f866dd is the first parent. The merge adds only already-merged main changes and does not modify this PR's protobuf, ProcessInfo codec, remote-run restoration, or INSERT IGNORE regression files; no conflict resolution altered the reviewed fix.\n\nExact-head focused validation passed again:\n- ProcessInfo build/codec round-trip and legacy absent-field behavior\n- remote helper/new compile statement state restoration\n- forced multi-CN INSERT IGNORE special-type integration test\n\nThe prior approval remains valid on the new head; no blocking issue found.
What type of PR is this?
Which issue(s) this PR fixes:
issue #25367
What this PR does / why we need it: