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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #25367
What this PR does / why we need it: