Repository navigation
fix: restore load data pre-lock path - #24233
Conversation
Backport matrixorigin#24201 to main. Co-authored-by: Copilot <[email protected]>
Stacked backport of matrixorigin#24226 on top of matrixorigin#24201 for main. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR restores pre-pipeline table locking for LOAD DATA plans (while keeping the narrower lock window for regular INSERT), and ensures all pre-pipeline lock targets are locked rather than stopping after the first.
Changes:
- Route
Query_INSERTtable locks to the pipeline/EOF path by default, but keep pre-pipeline locking forLOAD DATA(LoadTag=true). - Update
Compile.lockTable()to lock all pre-pipeline targets in a deterministic order. - Add unit tests covering the routing decision and multi-target pre-pipeline locking behavior, plus a LockOp EOF table-lock test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/sql/compile/compile.go | Restores LOAD DATA pre-pipeline lock routing and locks all pre-pipeline targets (sorted). |
| pkg/sql/compile/compile_test.go | Adds compile-level tests for routing and multi-target pre-pipeline locking. |
| pkg/sql/colexec/lockop/lock_op_test.go | Adds test ensuring EOF-time table locking occurs when no rows are produced. |
Co-authored-by: Copilot <[email protected]>
Merge Queue Status
This pull request spent 58 minutes 58 seconds in the queue, with no time running CI. Waiting for:
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks HintYou may have to fix your CI before adding the pull request to the queue again. |
Merge Queue Status
This pull request spent 55 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
fixes #24213
What this PR does / why we need it:
This backports #24226 to
mainon top of #24231.#24231moves regularQuery_INSERTtable locking off the pre-pipeline path.LOAD DATAis also planned asQuery_INSERTand always carries a table-lockingLockOp, so it needs a narrow exception to stay on the pre-pipeline lock path and avoid retrying the same whole-table lock on every non-empty batch.This stacked backport keeps the
#24231behavior for regular INSERT statements, but restores pre-pipeline table locking forLOAD DATAonly. It also makesCompile.lockTable()lock all pre-pipeline targets instead of returning after the first one.Also included:
LOAD DATAStacking note:
#24231backport in its visible diff as well. After#24231lands, this branch should be rebased so reviewers only see the incremental#24226change.Validation
go test ./pkg/sql/compile -run 'TestShouldPrePipelineLockTable|TestLockTableLocksAllPrePipelineTargets' -count=1(blocked in this Darwin environment because the repository's current CGO dependencies require missing headers such asusearch.h/xxhash.h; the backport was kept aligned with the merged 3.0-dev fix and will rely on CI for full package validation)