You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IDC stability environment, DN merging objects with large TEXT values.
Actual Behavior
A merge produced a column of approximately 1.03 GiB. Its LZ4 compression scratch request was legal for one mpool allocation, but WriteArena.CompressBuf rounded the capacity up to 2 GiB. This exceeded mpool's single-allocation payload limit and triggered a panic reporting a requested allocation of 2147483648 bytes.
The DN process did not restart during the incident; I/O worker panics reduced the available workers.
Sorted merge checks output batch bytes only every 100 rows, allowing a skewed group of large rows to grow far beyond the soft block threshold before the next check. Reshape has no equivalent byte threshold and flushes only at the block row limit.
Expected Behavior
An otherwise legal compression buffer request should not fail solely because speculative capacity rounding crosses the allocator limit. Merge and reshape should flush oversized batches promptly while preserving row order and transfer mappings. Actual allocation failures should retain the existing panic behavior.
Steps to Reproduce
Merge objects containing sufficiently large or skewed variable-length values, so a column grows beyond 1 GiB before the next 100-row size check (or before reshape reaches its block row limit).
Persist the output block through the object writer's LZ4 compression path.
Observe that a scratch request above 1 GiB rounds to 2147483648 bytes and mpool rejects it.
The capacity boundary can also be demonstrated without a GiB-sized allocation: arenaNextPow2((1 << 30) + 1) is 1 << 31, which exceeds mpool.MaxAllocationSize().
Additional information
Proposed fix:
Use the exact requested compression buffer size when the request is legal but power-of-two rounding would exceed mpool.MaxAllocationSize().
Check batch size after each appended row in sorted merge and reshape. Reuse the existing flush path when the batch exceeds 1.5 times the target object size (192 MiB for a 128 MiB target).
Preserve the schema row cap, source transfer stride and existing panic on allocation failure. The byte threshold remains soft because one indivisible row can exceed it.
Big Data TKE run 41787647919 成功;执行产品源码为 main@b27f3869e6f2552311fbbdda2f62b0ca31ec3a67,测试 workflow commit 为 fdcf33ab509c53208507fd5aa13d4d468f96552f。构建镜像、部署环境、专项执行及环境清理均成功;本次是 issue_32051 专项,不是整套 1Y/10Y 测试。
Activity
fix: bound compression scratch growth and merge batches on 4.2-dev (#…
fix: bound compression scratch growth and oversized merge batches (#3…
XuPeng-SH commentedon Nov 3, 2026
QA 交接(不是验收通过)
修复 PR #32052 已合入 main,merge SHA:
d2451d5c2e32c8c0bbab606a48f1f9c12de023ca。已核对本 issue 正文及完整评论、PR 修复范围与讨论,目前未见适用于新修复的已验证反例或未完成的开发 follow-up,交由 @Ariznawlll 回归。修复范围:合法的 LZ4 scratch 请求在向上取整会超过 mpool 单次分配上限时改用精确大小;sorted merge 与 reshape 每追加一行检查软字节阈值并复用 flush 路径,保留行数上限、顺序和 transfer 映射。单个不可拆分的大行仍可超过软阈值,真实分配失败仍按原逻辑 panic。
验证证据(作者/远端报告,不是本轮本地实测):PR 作者报告 rebase 后 objectio、mergesort 两个完整包测试、静态检查及 license 检查通过;先前独立评审报告 owning-package 测试通过、基线控制能触发回归失败。最新合并队列记录显示 CI Required 成功并于 17:27 UTC 合入。历史失败/分支更新错误不代表当前修复仍未完成。
未测范围及建议:本轮没有运行测试;已有容量边界测试未实际分配 GiB 级缓冲区。请在资源允许的 IDC 类环境回归约 1.03 GiB 列的 LZ4 写入、1 GiB/最大合法分配边界与非法请求;覆盖 sorted merge/reshape 的偏斜大行、删除行、持久化值和顺序、transfer 目标及 I/O worker 存活。确认真实 OOM 行为、单行超过软阈值、宽表与生产并发负载。作者旧基准显示部分小行/宽表有开销、偏斜场景累计 Go 分配可能增加,不应推断所有负载的内存或吞吐均改善。
Ariznawlll commentedon Nov 4, 2026
结论
测试通过。超过 1 GiB 的合法压缩缓冲区请求不再仅因向上取整失败;真实大行合并在软字节阈值处分块,结果及删除行正确。回归已提交 MOTR PR。
关键证据
main@0f6c07639604c40d7ca880cb63d1d282239def08,macOS arm64;独立 1 Log / 1 TN / 1 CN、本地 MinIO,MOgit_version()为0f6c076396。WriteArena.CompressBuf实际申请 1,111,638,610 字节,长度、容量及解压后的首/中/末标记一致,3/3;超过 allocator 上限的非法请求仍触发 panic,之后 arena 可重新使用、Reset 保留缓冲,3/3。该测试直接调用生产 arena 与 LZ4,并不声称是一次完整的 1.03 GiB 线上对象写入。8aa69be1cfffcb1374d8e0d40277dce9396db15c的同一阈值断言在两个路径均失败(只有 1 块)。pkg/objectio与pkg/vm/engine/tae/mergesort全包用例均成功。MOTR_BIG_DATA_TESTS=1,在线测试由本地执行,非离线 CI 覆盖。待解决点
Ariznawlll commentedon Nov 4, 2026
按新的验收要求重新打开本 Issue:此前“测试通过”的评论仅覆盖当时已执行的本地测试和 MOTR 专项用例,并不代表独立 big-data 流水线已经验收。
独立 big-data 用例已提交至 PR #1903。每轮使用 286 行、每行 4 MiB,合计约 1.117 GiB 逻辑输入,验证真实合并的输出块上限、删除行、顺序与 CRC;最新 main 本地 3 轮通过。TKE 专项 run 41787647919 已触发,正在等待镜像构建和集群执行,尚无 big-data 流水线通过结论。该用例验证总输入超过 1 GiB 后的输出拆分,不声称产生了单列大于 1 GiB 的持久化块。
Ariznawlll commentedon Nov 4, 2026
结论
测试通过。独立 big-data TKE 专项已实际执行,超过 1 GiB 的逻辑输入经过大行合并后,输出块限制和完整结果校验均连续 3 次通过;专项回归已提交 PR。
关键证据
main@b27f3869e6f2552311fbbdda2f62b0ca31ec3a67,测试 workflow commit 为fdcf33ab509c53208507fd5aa13d4d468f96552f。构建镜像、部署环境、专项执行及环境清理均成功;本次是issue_32051专项,不是整套 1Y/10Y 测试。[21,25,48,48,48,48,48]、[25,33,36,48,48,48,48]、[46,48,48,48,48,48]。物理计数可包含被墓碑删除的行,逻辑查询已验证该行不存在。main@b27f3869e6f2552311fbbdda2f62b0ca31ec3a67连续 3 轮通过。此前直接调用生产WriteArena.CompressBuf和 LZ4,对约 1.031 GiB 输入完成压缩/解压 3/3;非法超上限请求的 panic/恢复及 sorted merge、reshape 路径分别验证通过,详见本 Issue 的上一条完整测试评论。待解决点