Skip to content

[Bug]: LIST-to-vector Parquet LOAD forces wide 100M rows into row mode and times out #29229

Closed

Description

@Ariznawlll

Description

LOAD DATA ... FORMAT='parquet' PARALLEL 'true' has a severe performance regression when the projected schema contains Parquet LIST columns mapped to MatrixOne vector types.

After #29111, projecting a supported LIST-to-vector column switches the complete projected row from the page-vectorized path to logical row mode. On the official 100M-row, 31-column Parquet type-conversion fixture, the same LOAD that previously completed in about 44.5 minutes does not finish within the 180-minute nightly timeout.

This is an S-1 main-line big-data regression. It blocks the official Parquet type-conversion workload, but it is not an OOM: no MO container restarted and no OOM signature was found.

Environment

  • Branch: main
  • Failing commit: c154cf5a0449b5b7c2b497ffc57924a04e74dd52
  • Current main checked: 3727c5c5436ca136d7b0312f75bc223a11692a85
  • Relevant Parquet source files are unchanged between the failing commit and current main.
  • Deployment: TKE, 3 CN + 1 DN + 3 Log + 2 Proxy
  • Namespace: mo-big-data-commit-c154cf5-suite-1y
  • Date: 2026-09-22

Steps to reproduce

Create the 100M type-conversion target table:

create database parquet_type_conversion_1y;

create table parquet_type_conversion_1y.all_type_parquet_1y (
  row_id bigint,
  c_tinyint tinyint,
  c_smallint smallint,
  c_int int,
  c_bigint bigint,
  c_uint8 tinyint unsigned,
  c_uint16 smallint unsigned,
  c_uint32 int unsigned,
  c_uint64 bigint unsigned,
  c_float32 float,
  c_float64 double,
  c_float_text float,
  c_double_text double,
  c_decimal decimal(38,10),
  c_decimal_sci decimal(38,10),
  c_bool bool,
  c_char char(32),
  c_varchar varchar(255),
  c_text text,
  c_json json,
  c_blob blob,
  c_binary binary(16),
  c_varbinary varbinary(32),
  c_date date,
  c_datetime datetime,
  c_timestamp timestamp,
  c_time time,
  c_uuid uuid,
  c_enum enum('red','green','blue','yellow','purple'),
  c_vecf32 vecf32(3),
  c_vecf64 vecf64(3)
);

Load the official merged fixture from an S3-compatible object store:

load data url s3option {
  'endpoint'='<endpoint>',
  'access_key_id'='<redacted>',
  'secret_access_key'='<redacted>',
  'bucket'='<bucket>',
  'filepath'='mo-big-data/parquet_type_conversion_100M_merged.parquet',
  'format'='parquet'
}
into table parquet_type_conversion_1y.all_type_parquet_1y
parallel 'true';

The nightly reproducer is:

cases/big_data_test/02_LOAD_DATA/15_load_parquet_type_conversion_100M.sql

Actual behavior

  • The LOAD starts at 2026-09-22 01:40:24 UTC.
  • After exactly 10800 seconds, the test client cancels it with Execution timeout after 10800s and MySQL error 2013.
  • GitHub Actions then reports Run Test has timed out after 180 minutes.
  • CN logs record context canceled and rollback only after the client timeout; these are cancellation consequences, not the initiating error.
  • All nine MO containers have restart count 0.
  • No OOMKilled, exit code 137, panic, fatal out-of-memory, or CrashLoop was found.

The executing CN's exact-file slow events show forward progress but extremely low throughput:

Time (UTC) File offset Representative Range size getReader latency
02:22:59 1,033,778,307 4 KiB 617 ms
03:02:56 2,040,890,784 4 KiB 550 ms
03:26:30 2,627,074,043 4 KiB 566 ms
04:30:20 4,196,362,180 190,864 bytes 536 ms

After almost three hours the load had only advanced to approximately the 4.2 GB offset. The same object has offsets beyond 9.5 GB in the successful control run.

Expected behavior

  • Preserve correct reconstruction of LIST vectors that cross Parquet data pages.
  • Keep scalar sibling columns on a batched/page-vectorized conversion path instead of converting every projected column one logical row at a time.
  • Preserve row-group fanout across CNs and bounded S3 read amplification.
  • Complete the official 100M Parquet type-conversion workload within its established runtime envelope and well below the 180-minute job timeout.

Stability and controls

  • Reproducer: official main nightly failure, 1/1. One reproduction consumes the full three-hour job timeout.
  • Successful control: the same main workflow and the exact same merged fixture on commit be1591f completed in 2670695 ms (about 44.5 minutes).
  • The control run showed similar object-store connection latency, including getReader calls around 0.5 seconds and occasional calls above 2 seconds, so COS RTT alone does not explain the new regression.
  • Control reads were distributed across three CNs and representative Range sizes were generally 16 KiB to approximately 1 MiB.
  • Cancellation reached CN rollback and caused no process restart. Target-table atomicity was not queried by this nightly job and is not claimed as verified.

Evidence

Code analysis

High-confidence regression candidate: #29111 / bde7e0cad8, which fixed LIST vectors split across Parquet V1 data pages.

Before that change, supported LIST-to-vector mappings used the physical leaf column and stayed on getDataByPage. After the change, prepare does the following for LIST-to-vector targets:

physicalCol = col
h.hasNestedCols = true

ParquetHandler.getData then dispatches the entire projected batch to getDataByRow. For this fixture, two vector columns therefore force the other 29 scalar columns through logical-row processing as well. Scalar conversions not directly supported by the row path may reset/build a one-row Parquet buffer and invoke the page mapper per row.

The #29111 description explicitly notes that the logical-row path is less vectorized and has higher allocation volume. Its validation used a 50K-row, approximately 449 MB vector fixture; it did not cover a wide 31-column, 100M-row remote object-store LOAD.

This is related to but distinct from #27894: that issue addressed unprojected-column decoding for nested projections. In this regression all target columns are legitimately projected; the problem is that one LIST-to-vector column forces every projected scalar sibling from batched page mapping into per-row mapping.

Other observed errors are not causal discriminators:

  • iscp transaction finish timeout also occurred continuously in the prior successful run.
  • system.statement_info TEXT-length errors and Proxy close errors are background observability/connection-close noise.

Regression coverage

  • Keep the existing big-data case 15_load_parquet_type_conversion_100M.sql as the scale acceptance test.
  • Add a focused benchmark containing LIST-to-vector plus many scalar sibling columns. Record page/row-mode time, allocations, Range call count, requested/fetched bytes, row-group fanout, wall time, and peak memory.
  • Verify the fix preserves the cross-page vector correctness covered by [Bug]: LOAD DATA INFILE misreads Parquet vector dimension for list<double> #29110/fix: load parquet vectors across data pages #29111.
  • Compare bde7e0^ and bde7e0 with the same fixture to confirm the regression boundary.
  • Do not resolve this only by increasing the workflow timeout.

Related

Activity

  1. added this to the MO-202609 milestone on Sep 22, 2026
  2. added theissue type on Sep 22, 2026
  3. daviszhen commented on Sep 22, 2026

    @daviszhen
    Contributor

    • 不是故障提交 c154cf5。这次测试的是 issue 标注的 current main:3727c5c543。

    用 #29229 的 31 列 schema 和你提供的原始 Parquet 文件,在本机单 CN、本地文件环境中,LOAD 成功完成,客户端实测耗时 72
    分 35.61 秒。加载后确认 100,000,000 行,首尾行的向量抽样与源文件一致。

    这个数字不能代表 issue 中 3 CN + 远端 S3 的耗时,也不能证明故障提交已恢复;c154cf5a044 尚未实测。测试专用实例已停止,
    数据保留在测试工作目录 (matrixone-29229-benchmark)。

  4. daviszhen commented on Sep 22, 2026

    @daviszhen
    Contributor

    Docker A/B 加载测试结果(PR #29111)

    使用相同的 Docker 基础镜像、Issue #29229 的 31 列表结构、同一 Parquet 文件 parquet_type_conversion_100M_merged.parquet 和相同 LOAD DATA SQL,分别测试 bde7e0c^ 与 bde7e0c:

    版本 客户端 wall time
    bde7e0c^(d3ecd5e) 4842.13 秒(80 分 42.13 秒)
    bde7e0c 4625.91 秒(77 分 05.91 秒)

    bde7e0c 比前置版本快 216.22 秒(4.47%)。两次均成功加载 100,000,000 行,行数及 c_vecf32/c_vecf64 首尾样本校验一致。

    结论:在本次单次、单 CN Docker 测试中,没有观察到 PR #29111 导致加载变慢。但该 Parquet 文件中的 c_vecf32/c_vecf64 实际是 BYTE_ARRAY STRING 标量列,不是 Parquet LIST,因此没有覆盖 PR #29111 新增的 LIST 行模式路径;该结果不能排除真实 LIST 数据或远程 S3/TKE 场景中的性能差异。以上时间是客户端命令 wall time,不是服务端纯 SQL 执行时间。

  5. daviszhen commented on Sep 22, 2026

    @daviszhen
    Contributor

    三次完整加载结果汇总

    将当前 main 原生运行、PR #29111 的前置版本 Docker 运行、PR 版本 Docker 运行放在一起比较:

    版本 / 环境 客户端 wall time
    当前 main 3727c5c,原生运行 4355.61 秒(72 分 35.61 秒)
    bde7e0c^,Docker 4842.13 秒(80 分 42.13 秒)
    bde7e0c,Docker 4625.91 秒(77 分 05.91 秒)

    结论:

    • 在相同 Docker 环境下,bde7e0c 比 bde7e0c^ 快 216.22 秒(4.47%),本次 A/B 没有观察到加载变慢。
    • 原生 main 比 Docker 前置版本快 11.17%,比 Docker PR 版本快 6.21%;这是运行环境差异,不能用于判断 PR 的性能变化。
    • 三次均成功加载 100,000,000 行,行数及向量样本校验一致。
    • 测试文件中的 c_vecf32/c_vecf64 是 BYTE_ARRAY STRING 标量列,不是 Parquet LIST,因此没有覆盖 PR fix: load parquet vectors across data pages #29111 的 LIST 行模式路径。以上时间是客户端 wall time,且每个版本仅测一次;真实 LIST 数据或远程 S3/TKE 场景仍需单独验证。
  6. daviszhen commented on Sep 23, 2026

    @daviszhen
    Contributor

    多 CN Docker A/B 测试结果(PR #29111)

    使用相同的 Linux/arm64 镜像构建方式、Issue Schema、Parquet 文件、LOAD DATA SQL、默认 make dev-up 资源配置(2 CN + TN + Log + Proxy)和独立数据目录,顺序测试 bde7e0c^ 与 bde7e0c:

    版本 客户端 wall time
    bde7e0c^ 5460.73 秒(91 分 00.73 秒)
    bde7e0c 5950.27 秒(99 分 10.27 秒)

    bde7e0c 比前置版本慢 489.54 秒(8.96%)。两次均成功加载 100,000,000 行,行数及 c_vecf32/c_vecf64 首尾样本一致。

    限制与结论:

    • 测试期间同一 Docker Desktop 上另一套 issue29182-* 多 CN 集群运行了一段时间,存在共享 CPU/内存资源竞争,因此这不是完全隔离的性能基准,不能将 8.96% 直接归因于 PR fix: load parquet vectors across data pages #29111。
    • 测试文件中的 c_vecf32/c_vecf64 是 BYTE_ARRAY STRING 标量列,不是 Parquet LIST,没有覆盖 PR fix: load parquet vectors across data pages #29111 新增的 LIST 行模式路径。
    • 每个版本仅运行一次,时间是客户端 wall time,不是服务端纯 SQL 时间。

    此前同一文件的单 CN Docker A/B 中,bde7e0c 比前置版本快 4.47%;多 CN 与单 CN 结果方向不同,进一步说明需要在无其他集群、真实 LIST Parquet 数据和重复运行条件下继续验证。

  7. daviszhen commented on Sep 27, 2026

    @daviszhen
    Contributor

    COS LOAD DATA 二分结果(按 commit 提交顺序)

    测试使用同一套 big-data-load-1y.yml、codex/scenario-runner、Issue #29229 的 schema、COS 文件 parquet_type_conversion_100M_merged.parquet、LOAD DATA SQL 和 1y.all_type_parquet_1y 表。

    已知边界:bde7e0c 为通过基线,c154cf5a 为 nightly 中已出现 3 小时超时的坏基线。以下按 bde7e0c..c154cf5a 的 commit 位置升序排列:

    位置 Commit 结果 验证记录
    24 39cc357e 通过 run 36244665682,LOAD DATA 约 41 分 34 秒,成功
    30 8813404679 通过 run 36284722741,约 43 分 03 秒,成功
    31 e5d7afd932 通过 run 36292900528,约 60 分 42 秒,成功;复跑 run 36302687736,约 45 分 38 秒,成功,均为 Passed tables: 1; failed tables: 0
    32 f42330b618 坏点 首次 run 36296278830 运行超过 100 分钟后取消;复跑 run 36305928057 达到 100 分钟仍未结束后取消
    33 b2f178defd 坏点 run 36287688097,约 100 分钟后取消
    36 b4da0fe652 坏点 run 36248107473,约 100 分钟后取消
    48 c154cf5a 已知坏基线 nightly 已记录 3 小时超时

    结论:位置 31 的 e5d7afd9326a0d4deaa9f8fb7ee0cbed78a6e011 可重复通过,位置 32 的 f42330b618f05d117bcaadf9a3fa01f874bd3cc3 可重复表现为超过 100 分钟未完成;两者相邻,因此当前二分定位的首个坏提交是 f42330b618...([Compatibility]: enforce BLOB/TEXT family byte limits (#29121))。

    说明:f42330b618... 的坏点判定采用人工 100 分钟取消规则,并非自然运行满 10800 秒后产生的超时日志;重复复跑结果支持该提交是可重复的慢点,但尚未证明它会自然达到 3 小时。

  8. daviszhen commented on Sep 27, 2026

    @daviszhen
    Contributor

    复现与定位结论

    基于相同的 COS 文件、LOAD DATA SQL、目标表、严格 sql_mode 和 TKE 资源配置,完成了四组对比:

    Run 代码 LOAD DATA 结果
    36302687736 e5d7afd93 2,737,854.33 ms,约 45 分 38 秒,成功
    36305928057 f42330b618 100 分钟以上未完成,手动取消
    36315657099 f423 + 绕过 Parquet 同类型 BLOB/TEXT assignment cast 100 分 14 秒仍未完成,取消
    36315703208 f423 + rowsToSourceBudget 二分查找 5,115,168.07 ms,约 85 分 15 秒,成功

    主要瓶颈

    f423 的 CN profile 热点集中在:

    getDataByPage -> rowsToSourceBudget -> Page.Slice -> optionalPage.Slice -> countLevelsNotEqual/bytealg.Count

    • bytealg.Count 约 3,591 CPU-sec,占聚合 CPU 约 61.5%。
    • rowsToSourceBudget 累计约 3,747 CPU-sec。
    • newBufferedPage、newOptionalPage、byteArrayPage.Slice 产生了数十 GB 的分配。
    • S3FS.Read CPU 约 129 CPU-sec,不支持“COS 带宽是主要 CPU 瓶颈”的判断。

    pkg/sql/colexec/external/parquet.go 原实现遇到字典页时,对每一行调用 Page.Slice(row, row+1);parquet-go 的 optionalPage.Slice 会重复扫描 definition levels 前缀,因此在大页/大量字典页上接近 O(n²)。二分查找实验将该路径改为对页前缀进行 O(log n) 次切片,最终从 100 分钟未完成降到 85 分钟完成。

    f423 特有改动的影响

    f423 在 pkg/sql/plan/bind_load.go 对 BLOB/TEXT LOAD assignment 添加 cast,并在 build_constraint_util.go 中让 BLOB/TEXT 即使规划器类型相同也必须进行 assignment cast;pkg/sql/plan/function/func_cast.go 随后逐值检查字节宽度并复制到目标向量。

    但 cast 隔离实验在 100 分钟内仍未完成,且 profile 中 strToStr、NewAssignCast 的 CPU 占比很小。因此,BLOB/TEXT cast 更像是额外的内存/批次压力放大因素,不是当前超时的首要耗时来源。

    结论与后续

    1. 首要修复对象是 Parquet 字典页的 rowsToSourceBudget 重复逐行切片/扫描。
    2. f423 的同类型 BLOB/TEXT assignment cast 需要继续优化,但单独绕过它不足以恢复基线性能。
    3. budget 二分实验仍比 e5 基线慢约 86.8%,说明还存在 cast 或其他批处理开销;建议下一步测试“budget 优化 + cast 绕过”的组合,并补充字典页、NULL、不同字符串长度的正确性测试。

    限制:f423 的 Pyroscope profile 可取,但 e5 对应 namespace 已无保留 series,因此目前不能做严格同时间窗口的 profile A/B;e5 主要作为耗时和成功率基线。

  9. daviszhen commented on Sep 28, 2026

    @daviszhen
    Contributor

    在最新 main 提交 7d117380c67e09fe6e9c7afdb05b09e23c872aef 上重新进行了 TKE 多 CN COS LOAD DATA 验证:

    • Workflow:Run 36404171240
    • 测试范围:1y,表 1y.all_type_parquet_1y
    • 文件:mo-big-data/parquet_type_conversion_100M_merged.parquet
    • 结果:LOAD DATA 成功,Passed tables=1,failed tables=0
    • LOAD DATA 耗时:约 21 分 03 秒
    • 未出现 Execution timeout、Lost connection 或执行失败

    与参考 run 36366084312(提交 9494371491,约 28 分 09 秒)相比,最新 main 约快 7 分 05 秒,耗时下降约 25.2%。

    结论:#29229 的修复在最新 main 的 TKE 多 CN COS LOAD DATA 场景下验证通过,并且本次耗时明显低于参考 run。

  10. Ariznawlll commented on Sep 29, 2026

    @Ariznawlll
    CollaboratorAuthor

    明天测完更新结果

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s-1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions