Skip to content

CN OOM during large LOAD DATA and INSERT SELECT S3 writes #24267

Closed

Description

@LeftHandCold

Describe the bug

A CN can be OOMKilled when running a large LOAD DATA ... PARALLEL 'TRUE' followed by large INSERT ... SELECT copies into tables with wide columns such as vecf32(1024), text, and json.

In one nightly-regression run, the CN restarted shortly after the first copy statement started. The available logs indicate the process RSS crossed the CNFlushS3 soft budget and got very close to the cgroup limit before restart:

MemoryThrottler-Refresh {CNFlushS3: limit=49.5GiB, total=62.56GiB, available=2.264GiB, cgroup=55GiB, rss=52.65GiB, pinned=87.21MiB, limitRate=0.900000}
MO logger init ...

The low pinned value compared with the high RSS suggests large S3 write/off-heap memory in the ToWriteS3 path is not sufficiently covered by CNFlushS3 backpressure.

Steps to reproduce the behavior

  1. Create a table containing vecf32(1024), text, json, a primary key, and secondary indexes.
  2. Load a large CSV file using LOAD DATA URL ... PARALLEL 'TRUE'.
  3. Immediately run INSERT INTO copy_table SELECT * FROM source_table one or more times.
  4. Continue with vector/fulltext index creation.

The observed run used a CSV around 15.6 GB and a CN cgroup limit of 55 GiB.

Expected behavior

CN should apply backpressure or flush S3 writer state before RSS approaches the cgroup hard limit. Large load/copy workloads should fail gracefully or run slower instead of being OOMKilled.

Actual behavior

CN RSS grew to about 52.65 GiB with a 55 GiB cgroup limit and the process restarted shortly afterward.

Additional information

The risky path is normal insert.ToWriteS3, used by large LOAD DATA / INSERT SELECT writes. Unlike the multi-update S3 writer delegate, it did not reserve memory through CNMemoryThrottler before feeding batches to CNS3DataWriter.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions