Skip to content

Publish generated IDs for LOAD DATA - #31623

Merged
mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/83796a17624490c14819f7b04921a751328bff101c9fb9553710affd87190bb0
Oct 28, 2026
Merged

mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/83796a17624490c14819f7b04921a751328bff101c9fb9553710affd87190bb0

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

What this PR does / why we need it:

LOAD DATA could insert auto-increment values while leaving LAST_INSERT_ID() at zero or a previous statement's value. Publish the statement's generated ID in the MySQL OK response and update the session when it is nonzero, using the existing statement-wide coordinator. Loads that generate no user auto-increment value leave the session value unchanged.

Prior validation (reused; frontend implementation and SQL BVT unchanged by the CI repair):

  • Frontend response tests cover generated and zero IDs; real MySQL protocol clients checked LOAD, LOCAL, subsequent INSERT, affected rows, and error/retry paths.
  • The new SQL BVT passed twice, and the load_data directory passed (1629 passed, 5 existing ignored). Controlled multi-scope and multi-CN experiments covered completion order, remote generated IDs and retry isolation, including individual race-instrumented runs.
  • These experiments predate the latest main merge. They did not exhaust all message schedules or independent process failures.

The change adds constant work per successful LOAD, with no per-row work or additional I/O.

CI repair validation (3f86be350cf73ef5ca4d30f5f6690329ca98e80d, based on main 3cf38889bca2d183e973e78b1288f8c704727542):

  • Coverage run 40743265600, attempt 1, failed only because TestLoadAutoIncrementObservedDemand still expected LOAD to leave LAST_INSERT_ID unchanged. Update its generated-ID expectations (1 and offset 3) and assert the MySQL OK IDs through the existing client; allocation, rollback and explicit-ID checks remain intact.
  • New local checks on Go 1.27.1, Darwin/arm64, via mo-cgo-test: the exact test passed with -count=1 -short -tags matrixone_test -covermode=set -coverpkg=./pkg/frontend; normal full-package -count=1 -tags matrixone_test ./pkg/tests/sqlintegration passed (169.743s, CI admission pool size 2).
  • go vet and incremental golangci-lint --new-from-rev 3cf38889bca2d183e973e78b1288f8c704727542 passed for ./pkg/frontend ./pkg/tests/sqlintegration; formatting and diff checks passed.
  • Reused exact-head Linux/x86 coverage evidence from the same run: the frontend package and generated/zero-ID response tests passed. Local checks do not reproduce Linux all-package instrumentation; new CI results are pending publication of this repair.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 3f86be350cf73ef5ca4d30f5f6690329ca98e80d

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 3f86be350cf73ef5ca4d30f5f6690329ca98e80d

Assessment: approve

LOAD now publishes generated IDs through the existing statement coordinator, preserving session state when no ID is generated. Completion, retry and error paths remain coherent. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

Validation:

  • Reviewed all five changed files, affected owners and consumers, linked issue and both discussion entries.

  • Static audit passed: frozen patch identity, clean source, formatting and all 20 BVT statements. Receipt checks/1793223076581630837-4.json matches review-audit.log.

  • Frozen current-head CI reports successful build, UT, SCA, coverage and active proxy/multi-CN BVT.

Limitations:

  • No fresh local Go tests or SQL service execution; current-head CI evidence was reused.

  • Detailed CI logs and author-reported validation artifacts were unavailable; historical experiments were not treated as current-head execution proof.

@mergify mergify Bot added the queued label Oct 28, 2026
@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 5cd0b19 at 23:21 UTC

1 h 50 min in the queue, 56 min of it CI.

So far

  • ✅ Entered the queue Wed 28 Oct, 21:32 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Passed · in place
  • ✅ Merged 23:21 · 5cd0b19 · squash
Merge conditions: 3 of 3 met

This pull request

Condition Required by
✅ #review-threads-unresolved = 0 GitHub branch protection
✅ github-review-approved GitHub branch protection

The batch, tested in place

Condition Required by
✅ any of: check-success = CI Required, check-neutral = CI Required, check-skipped = CI Required GitHub branch protection

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants