Repository navigation
fix: bound compression scratch growth and oversized merge batches - #32052
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? |
bae980d to
a06d552
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: a06d552a5339470a5b1faa61b9283a09526b1376
Assessment: approve
No actionable findings. Compression sizing and earlier flushing preserve persisted values, ordering and transfer mappings.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Both complete owning-package suites passed, including all new regressions.
-
Base control failed both merge regressions as expected.
-
Preflight, native build, formatting and diff checks passed; receipts and logs reconciled in validation-report.json.
-
Five paired benchmarks measured 3.7–4.6% median component overhead, acceptable for the tighter bounds.
Limitations:
- Local execution used Linux/amd64. No GiB-sized allocation or production throughput run; component benchmarks had noisy outliers.
☑️ Command
|
…32081) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes #32051 ## What this PR does / why we need it: Backports #32052 to `4.2-dev`. Avoid an allocator-limit panic when a legal LZ4 scratch request above 1 GiB rounds up to 2 GiB: use the exact request when only power-of-two growth would exceed mpool.MaxAllocationSize(). Allocation failures retain the existing panic behavior. Check output batch bytes after every appended row in sorted merge and reshape, flushing through the existing writer path when the batch exceeds 1.5 times the target object size (192 MiB for a 128 MiB target). Preserve the schema row limit and source transfer stride. One indivisible row can exceed the soft byte threshold. The regression fixture uses this branch's existing test host because the main-branch JSON readback fixture is absent. Coverage remains limited to the allocation boundary and persisted data/order/transfer mappings for sorted merge and reshape with skewed and deleted rows. Validation on Go 1.26.4 with CGO and matching native dependencies: - `go test -p 4 ./pkg/objectio ./pkg/vm/engine/tae/mergesort -count=1` — both complete package test suites passed. - `make static-check` — passed on the full package graph (0 issues); uses this branch's pinned golangci-lint 2.6.2, molint v0.0.0-20260602145143-222a0b8adf07 and license-eye 0.4.0.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32051
What this PR does / why we need it:
A legal LZ4 scratch request slightly above 1 GiB was rounded to 2 GiB, exceeding mpool's single-allocation limit and panicking. Retain power-of-two growth where it fits; allocate the exact requested size when rounding alone would cross the limit. Actual allocation failures retain the existing panic behavior.
Check the output batch size after every appended row in both sorted merge and reshape. Flush the block and finish the object once its size exceeds 1.5 × target object size (192 MiB for a 128 MiB target), using the existing writer path. Keep the schema row limit and source transfer stride unchanged. The threshold is soft: one indivisible row may exceed it.
Only critical regression coverage is added:
Validation after rebasing onto upstream main
dd2499cdcd(Go 1.27.1, CGO and matching third-party libraries):make static-check-analysis GOLANGCI_LINT_CONCURRENCY=4— passed on the full package graph, including pinned molint and golangci-lint 2.14.0; 0 issues.license-eye -c .licenserc.yml header checkandlicense-eye -c .licenserc.yml dep check— passed.go test -p 2 ./pkg/objectio ./pkg/vm/engine/tae/mergesort -count=1— both complete package test suites passed.Prior A/B benchmark of the per-row check on deployed revision
71498157cc(8 alternating pairs, real merge/writer, memory file service): median time +0.6% for 8 fixed columns, +0.7% for 16 mixed columns, +2.9% for 512 columns. For 4 MiB rows, time fell 20.1% and incremental vector mpool peak fell from 784.7 to 401.9 MiB. A skewed 2 MiB-every-32-rows case was 4.2% faster but allocated 63.8% more cumulative Go bytes, so earlier flushing does not uniformly reduce allocation volume.