Repository navigation
perf(container): optimize appends, validity ranges and typed reads - #30160
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? |
|
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: 7b56098abc2a493be906dc5e5e114c0c6c8801b3
Assessment: approve
Reviewed the complete 13-file delta and affected callers. The design reuses existing allocation, rollback, conversion and synchronization owners while preserving aliasing, NULL, metadata and lifetime contracts. Tests cover meaningful boundaries and failure paths. Measured gains justify the added guards; the disclosed inline-batch slowdown remains a reasonable tradeoff. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Verified the frozen head, merge base, complete patch and unchanged checkout. Recorded six behavioral closures in review-map.json.
-
Preflight passed. Built native prerequisites through the repository build owner; independently verified 192 source inputs and retained artifact hashes.
-
All 16 added container tests passed with -tags=typecheck and the supplied test-exec, including overlap, rollback, validity boundaries, borrowed lifetime and getter guards. Receipt: checks/1792121115407814013-5.json; log: container-focused.log.
-
Exact-base/head ABBA benchmarks used identical fixtures and six samples per variant. Representative speedups: fixed append 4.92x, non-inline byte append 2.02x, validity count 37.92x, typed read 1.49x. Follow-up confirmed 2.07x non-inline gains; small batches were 2.7% slower and inline batches 3.0% slower, versus 6.7% inline slowdown initially.
-
Reused the supplied exact-head successful Ubuntu UT, arm64 SCA, UT coverage and selected BVT conclusions. Inspected task-service publication and restart-context ownership independently.
-
Reconciled 12 successful execution receipts with commands, source fingerprints and retained logs. Final audit passed: checks/1792121730664720617-4.json. Evidence resides under /home/xupeng/.local/state/mo-bot/jobs/3aeae1b5530625986774ecb3/attempt-1/validation-audit.json and final-evidence-index.json.
Limitations:
-
Raw CI and historical author logs were not supplied; frontend and restart tests were not rerun locally. Historical author measurements were not treated as independently verified results.
-
Local measurements are single-host API microbenchmarks, not SQL throughput or cross-platform guarantees. Inline prescanning has a measured workload-dependent cost.
-
Linked issue bodies were not separately supplied; their scoped contracts were assessed through the frozen PR description and source.
-
An initial diagnostic audit rejected a final-newline difference in the retained patch. Content equivalence was subsequently verified; this was not a product-test failure.
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? |
Merge Queue Status
This pull request spent 1 hour 20 minutes 55 seconds in the queue, with no time running CI. 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. Requeued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 38 minutes 34 seconds in the queue, with no time running CI. ReasonPull request #30160 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.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #30175.
Related to #24097 (query-execution performance umbrella); this PR does not close the umbrella issue.
What this PR does / why we need it:
Vector append and read paths perform redundant per-row work. Borrowed Arrow validity range queries also scan individual bits. This PR reduces that work while preserving API, NULL, metadata, aliasing, type-check and serialization behavior. It also addresses CI-exposed service-publication and test-cleanup lifecycle problems described below.
Performance
Apple M1, Go 1.27.1, GOMAXPROCS=1; ABBA order with six 250 ms samples per variant/case. Representative 2048-row/bit API results:
Append measurements compare main a53390c with 44e4b67; range/read measurements compare 44e4b67 with 56c4323. These are independent API workloads, not SQL throughput. Bytes-read benchmarks consume length and the first byte rather than all content.
Performance follow-up (2026-10-15)
A focused a53390c-to-ef9ba664d8 ABBA check (11 cases, six samples per variant/case) exposed an unmeasured downside: fresh, all-inline 8-byte varbinary batches of 2048 rows take 24843.5 -> 26402.5 ns/op (+6.28%); 128 rows are +4.73%. All-inline varchar cold cases are +1.80% to +2.49%. The pregrow path scans lengths even when there is no non-inline payload to reserve. The task owner has chosen to retain the current implementation and accept this measured local tradeoff; no additional code change is planned for it. The measurements remain disclosed for review. These are local API results; passing CI is not proof of no performance regression.
The original three small varchar cases with >5% median slowdown did not reproduce that magnitude in this focused check (-1.92%, -0.82%, +0.49%). The 2048-row 64-byte positive controls remain faster (varbinary 2.61x, varchar 1.80x). No production code changed in this follow-up.
Validation
CI regression fixes
A cluster restart can wait in admission longer than the previous generation's SQL context budget. The restart test now cancels that context and creates a fresh context after each successful start, retaining the same three-minute budget and persistence/error/ID assertions.
During CN startup, SHOW TASKS may read ParameterUnit.TaskService while createTaskService publishes it under a lock. The frontend now calls the existing GetTaskService getter, pairing the read lock with SetTaskService. The not-ready error and returned service identity remain unchanged. A lightweight regression covers readiness before publication, a concurrent read, and the published service after joining the publisher. The CI-named TestIssue27719DropAccountCleansSQLTaskLifecycle remains intact.
Hosted CI run 38692131676 completed successfully for commit 6f4660d: Ubuntu unit tests, Linux arm64 SCA, both selected BVT jobs, UT coverage, coverage aggregation and CI Required all passed. Connector/J E2E and Iceberg module tidy also passed. Upgrade and other unselected jobs were skipped; cross-version upgrade and SQL throughput are not claimed.
CI test cleanup and current validation
The Ready-triggered run38847040729 failed two tests at unchanged head7b56098. All four published-view query assertions passed; account teardown then exhausted the20s cleanup context shared with publication teardown. Separately, a100ms global procfs snapshot exhausted its budget before locating the owned child, so the pipe-holder signal-evidence assertion failed although emergency cleanup found that child. Both test files were identical at verifiedbaseb678; these failures are not attributed to the container algorithms.
Local evidence: exactCrossDatabaseCorrelation root passed race before the merge(17.960s) and after the merge(14.360s,21 selected cases; package20.178s). The latter used the repository CGo wrapper with DWARF disabled(-w) to fit available local disk; source,race instrumentation,native link inputs and assertions are unchanged. Standard-debug linking was blocked by
no space left on deviceand is not reported as passed. A controlled extracted-source fake-proc probe plus17 focused race repeats validates evidence after a truncated snapshot,stale-generation/neighbor rejection and missing-status handling. A separate context-lifecycle control validates independent20s resource budgets and prompt cancellation. Merged Linux/amd64 optools compilation and incremental vet/lint pass. Two same-process repeats of the exact merged SQL root also pass with race (42 selected test events), following the existing30s adaptive validation budget. Local Docker endpoints remain unavailable; the current-head hosted Ubuntu unit-test job has now completed successfully. This does not rewrite the local compile-only qualification.Complete pre-merge macOS optools normal/race runs each had322 named PASS and two Linux-only SKIP, plus the same unrelated default-prebuild fixture failure. Exact-parent normal/race controls reproduce that failure; the merged focused control still fails. All failing logs are retained, and whole-package local green is not claimed. No third unrelated test fix is included. The final new-head CI and any subsequent required review remain authoritative; prior successful runs do not substitute for them.
Current-head CI result (2026-10-16)
MatrixOne ALL CI 38857209498 completed successfully for exact head
ed3d69e09a76f679151af2b6c8c1c0fe406a5503at 07:59:37 UTC. Ubuntu unit tests, arm64 SCA, shared build, both selected BVT jobs, UT coverage, coverage aggregation and CI Required passed. Connector/J and Iceberg module tidy also passed. Skipped upgrade checks are not cross-version validation. GitHub retains an Approved review for older commit7b56098; this is not claimed as a fresh review of the subsequent test repairs. The PR remains Ready and open for follow-up review.