Repository navigation
perf(objectio): compress directly into writer arena on 4.2 - #32775
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? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review discussion changed before publication; a fresh contextual review is queued. |
Independent QA challenge (base
|
| Scenario | Base | Head | Delta |
|---|---|---|---|
| ~5.5 KiB text, direct eligible | 705.05 ns | 699.85 ns | -0.7% |
| ~8 MiB highly compressible text, direct eligible | 811.71 µs | 809.67 µs | -0.3% |
| 8 MiB varied input, direct eligible | 320.00 µs | 163.98 µs | -48.8% |
| ~8 MiB text, bound-1 fallback | 813.08 µs | 812.27 µs | -0.1% |
| 8 MiB varied input, bound-1 fallback | 321.42 µs | 317.84 µs | -1.1% |
The large varied-input case benefits materially from removing the scratch-to-arena copy. Small inputs, highly compressible input, and fallback paths are effectively flat in this run; there is no observed fallback regression beyond sample noise.
Validation boundary
I did not independently rerun SQL LOAD/ALTER row hashes, process-level RSS measurements, or a multi-CN deployment. Those remain covered by the PR validation and CI rather than by this local run. At the time of this comment, Analyze(go), CodeQL, shared build, and UT coverage have passed; Ubuntu UT, SCA, and the two multi-CN BVT jobs are still pending.
|
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: 9b3b68c7c77aefd8abd68c2ac01f0f5a1c557213
Assessment: approve
The fast path reuses the existing arena and accounting, preserving 4.2 workspace/pool limits, encoding and required fallbacks. Avoiding compression scratch and copying justifies the small added checks.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Full pkg/objectio normal and race suites passed with Go 1.26.6: 76 top-level tests each, including all five new cases and existing workspace/budget tests.
-
The independent-arena test passed 100 focused race repetitions; both selected sinker layout/workspace consumers passed under race.
-
go vet, gofmt, complete-delta whitespace, preflight and native prerequisite verification passed.
-
validation-audit.json reconciles ten local validation receipts with retained logs. All five discussion entries are accounted for; exact-head macOS QA corroborates the assessment. Source remains unchanged.
Limitations:
-
Author/QA SQL, RSS and benchmark figures were not independently reproduced or checked against raw logs. This assessment does not close #32751 or establish production OOM resolution.
-
Hosted validation was incomplete in the structured snapshot; QA reported later progress without a refreshed structured status.
9b3b68c to
d76e4f8
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: d76e4f8dbdd687c64f98c32bd01a1e649af4875b
Assessment: approve
The fast path reuses 4.2's existing arena, codec and accounting while preserving workspace/pool limits, encoding and required fallbacks. Avoiding compression scratch and copying justifies the small checks. The isolated overlap helper and legacy linter pin preserve the writer's unsafe restriction. No blocking findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Read the complete five-file delta and 4.2 writer, workspace, pool/reaper, Sync and reader consumers. All seven discussion keys are covered in discussion-assessment.json; identical linked #32751 context was compared and reused within the batch.
-
Current-head pkg/objectio normal and race suites passed 82 top-level roots each with Go 1.26.6, isolated test-exec runtimes and unchanged source/test paths.
-
The independent-arena test passed 100 focused race repetitions (T=0.01s, B=30s, N=100). Both selected Sinker persisted-layout/workspace consumers passed under race.
-
Compared the complete old/new legacy molint modules: only the helper approval and its tests differ. Pinned policy tests, installed go vet -vettool, standard go vet, gofmt and complete-delta whitespace checks passed.
-
Preflight and native provenance checks passed: 170 current native inputs and 43 retained outputs matched. validation-audit.json reconciles commands, frozen source, exits and retained logs.
Limitations:
-
Author/QA SQL, RSS/profile and benchmark reports were assessed without independently reproducing their raw runs. No universal latency, production OOM or umbrella #32751 completion claim is established.
-
Hosted shared-build, UT, SCA, coverage, E2E and Go-analysis validation remained incomplete in the frozen snapshot; skipped jobs were not counted as passes.
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? |
d76e4f8 to
93e4450
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: 93e4450817d517622d95edaed91914499c68758e
Assessment: approve
Approve the scoped 4.2-dev compression optimization. Independently owned serialization buffers establish non-aliasing while reusing the existing codec, arena allocation/accounting and scratch fallback. Borrowed inputs retain baseline behavior, and workspace/pool budgets remain intact. Current boundary, byte/extent, readback, consumer and race evidence closes the affected contracts; prior reviews and QA were reconciled with the new ownership boundary. No actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Full objectio package: 84 root tests/seed runs passed normally and under race detection, including all seven added roots; no skips. Receipts and retained JSON logs: validation-audit.json, objectio-normal.jsonl, objectio-race.jsonl.
-
Three real sinker/workspace consumers passed under race detection. The independent-arena test passed 100 repetitions, selected from its measured race duration. See ioutil-consumers-race.jsonl, arena-stress-race.jsonl and race-stress-plan.json.
-
Pinned golangci-lint v2.6.2 passed configured analysis of objectio and objectio/ioutil with the repository's existing exclusions; changed Go files are gofmt clean and git diff --check passed. See golangci-selected., source-audit..
-
Preflight passed; reused native prerequisites matched all 170 current inputs, 71 artifact hashes and compiler identity. All claimed checks were reconciled to frozen-head command/source/exit receipts and retained logs; all ten discussion keys are covered exactly once.
Limitations:
-
No new whole-SQL, RSS, GPU or performance benchmark campaign was run. Historical author/QA measurements are reported context, not current frozen-head execution proof; the tracker remains broader than this component optimization.
-
The unchanged branch pin molint 222a0b8adf07 supports only its legacy vettool interface. Its prescribed invocation exited 0 with empty JSON; that exit is not treated as independent diagnostic enforcement. Configured golangci analysis and source policy review cover the changed paths. The attempted standalone invocation was unsupported, not a product-test failure.
-
Initial dependency/tool setup timeouts were recovered using the same task caches. Evidence for external linter discussions #57/#58 was not supplied correctly; this delta changes neither unsafe usage nor the linter pin.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32751; 4.2-dev counterpart of #32774.
What this PR does / why we need it:
When an arena has enough unused capacity for the LZ4 compression bound, compress independently owned writer buffers directly into its tail and commit only the actual output length. This avoids the separate compression scratch buffer and the subsequent copy on those writes. The existing scratch path remains in use when the bound does not fit or no arena is available.
The internal serialization and metadata buffers are created independently of the arena and marked with a private ownership type.
WriteWithCompress, which accepts arbitrary borrowed bytes, always keeps the original scratch path even when the bytes happen not to overlap. Thus existing external callers retain their previous behavior, while the in-tree serialization and metadata paths can use direct compression. The object format, extent and arena accounting, SQL behavior, and 4.2 pool limits are unchanged.No
unsafeimport, new linter exception, or linter pin change is needed on 4.2. This PR no longer depends on the unmerged linter compatibility branch in linter #58. The main implementation and its reviewed narrow exception are tracked separately in #32774 and linter #57.Validation
On CPU-only 57, Go 1.26.4, final commit
93e4450817rebased onto25305b6137:pkg/objectiosuite passed normally and under race. This includes the new direct-compression, overlapping/adjacent borrowed inputs, empty and incompressible input, no-arena and insufficient-tail fallbacks, arena reuse, multicolumn readback, and the new base's S3-cache interaction tests. For these runs the existing hardcoded test directory was temporarily redirected into the task-owned test directory and restored afterwards.molint check -mod=readonly ./pkg/objectiopassed; the existing selected golangci checks passed. A separate negative control verified that the official checker fails on an injected unapprovedunsafeimport.The 4.2-dev
go vet -vettoolSCA step has a pre-existing limitation: it can print linter diagnostics while returning success. This was reproduced with a negative control and observed in a previous green CI run. This PR does not change that branch-wide CI behavior, so the standalone officialmolint checkabove is independent evidence for the modified package; a green legacy SCA job alone is not proof that its linter findings were enforced.Large rows whose compression bound cannot fit in the remaining arena still use the existing scratch path; this optimization alone does not resolve the original very-large-row OOM.