Repository navigation
fix(ivfflat): preserve candidate ownership across flush replay - #33154
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? |
|
Queue requested — the merge queue status continues in this comment ↓. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 09ff6b55b3276c60e31ac7f1b9c9fd01d727881f
Assessment: request_changes
The focused mixed-replay storage test passes, but the new RPC version and legacy ownership path violate the target branch’s upgrade contract. The associated query-wide probe also creates an avoidable failure path for scans that will not execute.
Model: gpt-6.1-terra / max
Session: 01a21155-55c0-79f0-b683-78fb22f78abd · slot 1 · generation 13
- P2
pkg/defines/const.go:173: An AP multi-CN query containing a partitionable IVF scan triggers the new MORPC 135 capability check, including when the scan is beneath an outer literal LIMIT 0.
Impact: The target branch supports shutdown-only upgrades and prohibits new per-feature MORPC versions, peer capability checks, and old-peer fallbacks. The added marker and legacy branch maintain two ownership modes for an unsupported mixed-binary deployment. The eager check also returns a peer query-service error before the compiler can skip a zero-limit subtree, so an otherwise empty query can fail because of an unused peer.
Evidence: The pinned .agents/skills/mo-dev/references/upgrade-compatibility.md:94 states the in-cluster rule. The new version is required by pkg/sql/colexec/vectorscan/protocol.go:29, and unmarked plans retain legacy ownership in pkg/vectorindex/ivfflat/plan_reader.go:112. The retained planner probe shows an AP multi-CN IVF scan below LIMIT 0; pkg/sql/compile/compile.go:1528 invokes the new check before the zero-limit shortcut at pkg/sql/compile/compile.go:2022, and pkg/sql/compile/vector_scan_protocol.go:190 returns probe errors. Route appendable objects to the existing IsLocalCN memory owner before object-ID hashing, preserving immutable-object hashing, and remove the new version, marker, and older-peer negotiation while retaining unrelated existing gates.
Validation:
-
The private /tmp and loopback preflight passed; see preflight.log and checks/1795593630014682727-2.json.
-
TestIVFFlushPreservesPartitionOwnership passed on retry, including both mixed replay orders and both aligned controls; see ivfflat-test-retry.log and checks/1795596157457609453-2.json. The first run timed out during compilation.
-
The generated protobuf descriptor matched the merge-base descriptor after removing the new optional field 25; see descriptor-probe.log and checks/1795593962787953238-2.json.
-
A temporary planner probe using SQL and mock table fixtures confirmed the zero-limit and decimal-expression plan shapes; see placement-plan-probe.log and checks/1795596483284370006-2.json.
Limitations:
-
The planner probe did not execute a live peer failure; that consequence follows from the cited compiler and probe error paths.
-
The author-reported two-CN SQL run and owning-suite results were not backed by retained execution logs in the supplied evidence and were not independently rerun.
Assign flushed appendable objects to the existing memory owner before IVF ObjectID hashing. Keep the base scan protocol and the immutable hash unchanged; no new wire marker or query-wide capability probe is needed. Cover pruned scans with an unavailable peer and both mixed flush replay orders.
|
Addressed the requested change in 20513817ca. The only production behavior delta against the PR base is in
The full |
|
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-local · review
Commit: 20513817ca11439df0d1b211e8e84c2a5e8d7efb
Assessment: approve
The revised fix assigns appendable IVF files to the existing replay-memory owner and retains ObjectID hashing for immutable files. Compiler placement keeps the coordinator in a partitioned scan, and the single-CN and local-parallel paths retain one memory owner. This corrects the mixed-replay ownership boundary without adding a second ownership protocol. The prior review's new RPC gate, fallback, and eager probe are removed.
Model: gpt-6.1-terra / max
Session: 01a2110f-4081-7e00-8415-e36a337ad118 · slot 0 · generation 12
Validation:
-
Reviewed the complete delta, linked issue and discussion, and traced compiler placement through IVF reader identity and storage range filtering. The new storage test covers both mixed replay orders, aligned states, a single-CN control, and a later immutable object; compiler tests cover ingress placement and LIMIT 0 versus LIMIT 1.
-
The exact-head CI snapshot reports successful Ubuntu/x86 unit, arm64 static analysis, enabled proxy and pessimistic multi-CN BVT, and CI Required checks. The author reports focused storage and compiler runs and a two-CN SQL run with exact keys and transaction controls.
-
Private-runtime preflight and git diff --check passed; see preflight.log, diff-check.log, and receipts checks/1795611134611871181-2.json and checks/1795611134557974368-2.json.
Limitations:
- No local Go package or live two-CN SQL run was repeated. The author's updated-head focused runs have no retained execution logs in local_validation; CI success is reported at job level. The older review's storage run is evidence for its own prior head only.
🚫 Left the queue · pull request dequeued27 min in the queue, with no time running CI. So far
Reason Pull request #33154 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.
To get back in the queue
Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
What type of PR is this?
Which issue(s) this PR fixes
Refs #33149 (main implementation; #33153 is the 4.2 companion).
What this PR does / why we need it
At the same read snapshot, two CNs can have applied different parts of the flush logtail. One can see an IVF entry in replay memory and the other can see the same entry in the old appendable object's file with its original commit timestamp. Assigning replay rows to the memory owner but assigning the appendable file by ObjectID can return the entry twice, or not at all. The historical Top‑10 observation did not retain per-CN candidate RowIDs; the deterministic storage test demonstrates the failure mechanism independently.
Check the appendable flag before the IVF ObjectID hash in the existing storage shuffle predicate. Both representations follow the existing replay-memory reader (
IsLocalCN); immutable objects still use the full ObjectID hash. Non-IVF shuffle and single-reader behavior are unchanged. There is no post-LIMIT deduplication, index format change, new MORPC version, protobuf marker, query-wide peer probe, or old-peer fallback. Existing protocol checks for executed scans and their session knobs remain unchanged from main.Verification
LIMIT 0compiles without a peer probe; theLIMIT 1control still propagates the peer error. Placement coverage switches ingress with two and three workers.