Repository navigation
[4.2-dev] fix(hashbuild): bound collected runtime-filter keys - #32256
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? |
|
Fixed the coverage-UT producer failure in 958644dd45. The only failed test was Validation:
The branch includes the newest |
|
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: 958644dd45e22ed09bbf15fd8ce49ab23092978b
Assessment: approve
The backport preserves complete membership, exact IVF limits and ordinary IN semantics. It reuses existing hash/vector accounting; metadata leases and payload refcounts support the release's reader lifetimes. No actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed the complete delta, applicable contracts and discussion; discussion-assessment.json covers all 3 discussion keys.
-
Passed six full normal package suites and focused sqlexec, ivfflat and table_function consumer tests.
-
Passed six full package race suites and 100 race repetitions each of reservation commit/abort and payload retain/release.
-
Independent bitmap oracle passed 50,929 cases; git diff --check passed and source remained clean.
-
validation-audit.json reconciles 16 frozen-head receipts and retained logs. Initial native-header and dependency-download setup failures were recovered.
-
Reused frozen successful CI UT, SCA, coverage, shared-build and active multi-CN BVT status.
Limitations:
-
Raw CI logs and the author's local validation logs were not supplied; their reports remain distinguished from independent checks.
-
CUDA, multi-gigabyte workloads and end-to-end performance were not independently tested. Broader issue #30125 remains outside this component's scope.
Backport matrixorigin#32191 to 4.2-dev to stop HashBuild runtime-filter key vectors from growing across the entire build. Collect unique keys in aligned chunks of at most 8,192 rows, splitting earlier at payload and encoding byte limits. Preserve component slots and keep hash insertion as the sole uniqueness authority. Admit chunk directories and scratch before allocation, roll back failed multi-column appends, and discard collections with invalid checkpoints rather than retrying or publishing partial keys. Keep the ordinary IN wire format and single-chunk fast path. Sort fixed-width keys in the final admitted encoding and merge variable-width sorted runs without constructing a whole-build vector. Materialize composite keys per aligned chunk. Publish membership keys as one immutable, reference-counted payload. Adapt the existing 4.2-dev IVF/fulltext TVFs to consume every chunk into one reader filter, retaining keys through use and releasing them on error, reset and free. Preserve the release's exact non-integer IVF predicate and its global 8 MiB limit: required membership must be complete or return an error, never silently become approximate or partial. Do not import main's vectorscan/index-plugin reader refactor or change the native filter ABI. Include the small capacity-reservation helper needed to account for Go-backed key metadata on this release, and the existing main bitmap range-mask correction needed to clear NULL/grouping bits during append rollback at word boundaries. Retained build-row storage, JoinMap row addressing, planner thresholds, allocator limits, disk formats and spill policy are unchanged. (cherry picked from commit 692c8e1)
Configure the dedicated role-grant cycle fixture with each generated frontend SQL address before service startup, matching the shared embedded fixture. Its first CN heartbeat otherwise advertises an empty address that task storage can cache as the MySQL driver default port, causing DROP ACCOUNT cleanup to fail on 127.0.0.1:3306 under coverage instrumentation. Keep the concurrent role-cycle, error-code, committed-graph, and account-cleanup assertions unchanged. This only corrects fixture endpoint publication; runtime-filter production behavior is unchanged.
|
Resolved the conflicts and pushed normal merge The resolution preserves this PR's bounded first/rest key chunks and integrates the release branch's serialized-key casts, post-cast encoding bounds and out-of-range PASS fallback. Incoming test fixtures now use the chunked storage fields and the correct Int64 cast source. Two tiny two-row cases check cast ordering across chunks and cleanup when a later chunk is out of range. Minimal test selection on Go 1.26.4: |
|
mo-bot review · Commit: "interrupted" |
Preserve the fixture cleanup added in merge 324ec38 while keeping the broader chunk and cancellation coverage.
324ec38 to
91c9bbf
Compare
|
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: 91c9bbf26c012fab1cc8a4a4e7bb2f73373d7977
Assessment: approve
The bounded key collection preserves complete membership, tuple conversion, failure handling and existing filter formats. Reusing vector/accounting owners keeps the design coherent; capacity leases and immutable payload references justify their measured metadata cost. No actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed all 38 changed files, relevant owners/consumers and linked issue context; reconciled all seven discussion keys in discussion-assessment.json.
-
Preflight passed; CPU native prerequisites rebuilt from 171 matching tracked inputs. Provenance and command/exit/log reconciliation are retained in native-evidence.json, source-manifest.json and validation-audit.json.
-
Twelve CPU owner packages passed normally; ten passed with -race. Fifteen focused roots passed 1,478 exact race repetitions.
-
The changed two-CN fixture passed. Owner go list/build/vet, gofmt for 35 changed Go files and diff --check passed; source remains unchanged.
-
Baseline/candidate component benchmarks completed twelve cases with three samples each. Additional metadata allocations were measured; no material timing regression was demonstrated in these samples.
Limitations:
-
The broader issues suite timed out and included an export cleanup deadline; the exact export test subsequently passed in isolation. The full suite is not claimed as passing, and the initial failure is not established as preexisting.
-
Public SQL/composite probes, IVF BVT and two-CN race results remain attributed author reports. Historical approval/coverage and CI are not current-head kernel validation.
-
GPU, mixed-version rollout, multi-GB memory/RSS and end-to-end OLAP behavior were not validated. This component change does not close the linked issue's broader residency/spill work.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30125. Backport of #32191.
What this PR does / why we need it:
Bound HashBuild runtime-filter key collection to aligned chunks of at most 8,192 rows, with earlier splits for component-vector byte limits. This avoids growing one key vector across the entire build. The ordinary path collects newly inserted hash groups; HashOnPK retains the existing primary-key uniqueness assumption. Account for chunk metadata, roll back failed multi-column appends, and reject invalid checkpoints without publishing partial keys.
Keep the ordinary IN encoding and single-chunk fast path. Numeric runs are copied and sorted in the final admitted buffer; other sorted runs are merged without a whole-build vector. Inline runs whose key ranges are already ordered can use the same admitted buffer and bulk-copy path. Integrate the 4.2-dev composite-primary-key filter from #32400: convert components in probe-key order for each chunk, use the converted vectors for bounds and encoding, and turn an out-of-range optional filter into whole-filter PASS. A cancellation already observed at that fallback remains an error.
Publish membership keys as one immutable, reference-counted payload and adapt the existing 4.2-dev IVF/fulltext consumers to visit all chunks. IVF may use a complete exact SQL predicate or a tagged reader filter, according to the existing key-type contract. Required non-integer IVF membership retains the 8 MiB global literal-list limit and fails rather than becoming partial or approximate. The release keeps its existing TVF architecture and native filter ABI.
The rebase also adapts the #32243 optional-collection failure tests to the chunked owner, preserving PASS, complete JoinMap, wide-key lookup, and accounting checks. It retains the author's concurrent merge fixes and fixture cleanup.
Validation of the rebased production tree
-race -short.-racerepetitions: ordered-run cancellation and cleanup, composite narrowing, next-chunk admission failure, and cross-chunk rollback. HashBuild also passed-short -covermode=set(74.7% of that package's statements; this is not changed-code coverage).serial(cast(...), ...)composite-PK runtime-filter plan with 9,000 build keys; enabled, disabled, out-of-range and NULL controls returned the same 9,000 matches. The input exceeded one chunk, but the SQL experiment did not instrument per-operator chunk count; white-box tests explicitly construct and validate multiple chunks.gofmt,molint, and golangci-lint 2.6.2 passed over the changed package closure. The additional planner scan reports threecheckrecoveritems at identical lines on the unmodified 4.2-dev baseline. Tests used Go 1.26.6 and CPU native libraries; a rebuild from the same tracked native sources produced an identical libmo executable-code section.Performance and limits
In a local pinned-CPU microbenchmark comparing the rebased code immediately before and after the ordered-inline optimization, three-sample medians for ordered composite keys changed from 1.156/1.190 ms to 0.880/0.907 ms at 8,193 rows and from 10.341/10.101 ms to 7.537/7.755 ms at 65,536 rows (direct/cast respectively). Single-chunk controls also varied 4–8%, so these are local measurements, not a general speedup claim. Randomly interleaved 65,536-row cases changed by +2.4%/+1.4% in another three-sample comparison. Chunking still increases Go allocations: the 65,536-row cast fixture used about 111 allocations on the 4.2-dev baseline and 359 here. Go allocation figures exclude MPool/native memory.
CUDA, mixed-version rollout, multi-gigabyte workloads, peak MPool/native memory and end-to-end OLAP performance were not independently validated in this run. The author previously reported full-repository SCA and additional 100-run ownership stress on the earlier PR revision; those reports are historical evidence, not new-head CI results.
Design: bounded HashBuild key collection and 4.2-dev integration.