Skip to content

[Bug]: Memoria workload repeatedly OOM-kills 16 GiB CNs, including after the last observed Add/Search traffic #32008

Open

Description

@VioletQwQ-0

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Searched open/closed MO issues for Memoria + OOM, the deployed commit, CN OOM, memory-cache accounting, and lock-binding failures. No report matching this exact deployment and incident was found. Related reports and existing fixes are listed below; a shared root cause has not been established.

Branch Name

Deployed release reports v4.2.1-hotfix-20260909 (4.2 hotfix line). The exact source-branch name and immutable image digest still need to be recorded; the executable Git commit below is the source identity for this report. Current main has not been tested for this incident.

Commit ID

2cb5379d78a32fb1969ab68f8570104b6e0944f4

Other Environment Information

  • Environment: AWS production deployment serving Memoria; two CNs on different EC2 nodes.
  • Each CN: CPU request/limit 4/4 vCPU; memory request/limit 16/16 GiB.
  • Actual cgroup memory.max: 17,179,869,184 bytes per CN.
  • Nodes: m5dn.2xlarge, 8 vCPU / 32 GiB each; approximately 30.01 GiB allocatable. Node capacity is not the CN memory limit.
  • OS: Linux containers with cgroup memory limits; exact distribution/kernel not recorded in the source report.
  • Go build version: go1.26.4.
  • GOMEMLIMIT=6114MiB (approximately 5.97 GiB).
  • One explicitly configured FileService memory-cache capacity: 1228 MiB (approximately 1.20 GiB). This is not an inventory or sum of all caches.
  • FileService disk-cache capacity: 230 GiB.
  • Request path: evaluation client -> ALB -> memory_benchmarks (mb) -> Memoria -> MatrixOne / embedding.
  • Previously verified application source baselines in the incident report: mb 904b35e, Memoria 80b4b2a. Reconfirm actual images and configuration before a replay.
  • Evidence source: memoria-website #264, especially supplement C. Runtime values below are that report's 2026-11-02 read-only snapshots, not a new live cluster inspection during filing.

Actual Behavior

Two 16 GiB CN containers repeatedly restart. The latest instances inspected in supplement C terminated with OOMKilled / exit code 137 after RSS approached their container limits. The incident continued after the last Add/Search request visible in the archived ingress logs.

Latest-instance timeline (2026-11-02, China Standard Time / UTC+8):

CN Previous instance lifetime Latest OOM Cumulative restartCount at that snapshot
A 04:52:41 -> 05:55:30, approximately 63 minutes 05:55:30, OOMKilled / 137 80
B 08:06:02 -> 09:39:20, approximately 93 minutes 09:39:20, OOMKilled / 137 69

The source's earlier snapshot recorded B at 68 restarts; the later snapshot recorded 69. These cumulative counts start before this Full run and must not be described as 149 OOMs or 149 failures belonging to this evaluation.

The last archived Add/Search was at 03:13:26 CST. Both OOMs above occurred afterward. This does not prove that all background work, in-flight SQL, or other database clients had stopped.

Pre-OOM RSS-pressure records (same date/time zone; values transcribed from the source report):

CN / time RSS visible Detected memory limit free-os-memory evict-cache cache-target-percent
A 05:54:12 14 GiB 121.9 MiB 16 GiB true true 80
A 05:54:43 15.24 GiB 608.3 MiB 16 GiB false true 50
A 05:55:15 15.45 GiB 122.9 MiB 16 GiB true false 50
B 09:37:38 13.98 GiB 138.6 MiB 16 GiB true true 80
B 09:38:31 14.91 GiB 577.2 MiB 16 GiB false true 50
B 09:38:42 14.38 GiB 123.4 MiB 16 GiB true false 50

The program recognized the 16 GiB limit and triggered RSS-pressure actions, but OOM still followed. The log flags do not independently prove that asynchronous eviction completed or that native pages were returned.

At this commit, visible is the throttler's reserved bytes plus mpool current bytes, not all process memory. The RSS-minus-visible difference is not a measured leak.

Business impact: retained Memoria logs include backend connection refusal (20505), EOF, RPC stream closure (20503), connection reset, pool waiting timeouts, 20702: lock table bind changed, and lock wait timeout 1205. The source report time-correlates at least seven Memoria write-500 -> mb Add-502 -> ALB target-502 chains. It does not establish that every failed HTTP attempt was caused by OOM, or that any particular successful write was lost. Logged UPDATE durations up to approximately 354/430 seconds are elapsed observations, not CPU execution time.

Expected Behavior

The deployed CNs should operate within an explicit overall memory budget, with bounded growth and effective reclamation under the supported workload. Work that cannot fit should be rejected or bounded before causing repeated process-wide OOM failures.

Acceptance requires:

  • Attribute the major memory growth using synchronized Go heap/runtime, native allocator, cache backing/resident, process RSS, and cgroup measurements from the same growth episode.
  • Reproduce the responsible mechanism with synthetic or otherwise permitted data and validate an appropriate fix for the affected release line.
  • Compare the original and candidate under the same 16 GiB limits, comparable data/concurrency, and background tasks. Observe RSS, cgroup usage, backing/resident, cache hit rate, latency/throughput, and transaction/lock behavior; retain adverse results.
  • Run a soak exceeding the observed approximately 63/93-minute failure windows and include a subsequent stage without foreground Add/Search while background tasks remain enabled. Demonstrate stable or reclaimable memory and no OOM/restart.
  • Verify committed-data integrity and bounded transaction/connection recovery through the production entry points. A Pod becoming Ready or a short smoke passing is insufficient closure evidence.

Steps to Reproduce

The production incident is observed; a deterministic minimal reproduction is not yet available. No new workload, fault injection, active GC, cache flush, or production configuration change was performed during issue filing.

Investigation/replay plan:

  1. Preserve the executable commit, immutable images, complete effective CN/FileService/allocator configuration, topology, data scale, and actual foreground/background SQL templates and rates.
  2. In an isolated environment, reproduce the Memoria load using synthetic data with two 4-vCPU/16-GiB CNs and the recorded budgets. Preserve metrics-summary and call-log background work, and distinguish it from foreground requests.
  3. Observe a complete memory-growth cycle. Before RSS reaches the hard limit (for example around 12-14 GiB), obtain time-aligned Go/native/cache/cgroup evidence. Capture active transaction/connection counts, query ages, and background-task activity.
  4. Continue observation after foreground Add/Search stops; determine whether memory continues growing, live work remains, or freed pages remain resident.
  5. Once the dominant mechanism is identified, compare the appropriate release-compatible correction under the same conditions. Do not treat an unrelated newer main build or increased memory limit alone as causal validation.

Additional information

Confirmed source-level lead, not established sole root cause

The deployed code still accounts FileService cache data by logical length:

Main PR #26783 (0676200da47052659cf46ad9e22d67ab9654e393) changes cache accounting to backing capacity. PR #26997 (31adf54ab1794764eacce856ac4dbbaf8842487f) addresses allocator efficiency/residency with dedicated jemalloc arenas and related accounting/reclamation. Both merge commits are absent from the deployed commit's ancestry; the deployed source still contains the old accounting path.

This is a concrete accounting gap. It has not been shown to explain all approximately 15 GiB of pre-OOM RSS. Backing-capacity accounting is not itself a total process-RSS cap. If a backport is selected, review release compatibility and performance together: #26926 documented a read-path regression after the initial physical-accounting change.

Profile limitations

Post-restart, lower-occupancy samples in the source report showed Go HeapAlloc approximately 0.95-2.85 GiB, Go Sys 3.57-3.80 GiB, RSS 4-5 GiB, and cgroup memory.current 4.5-5.5 GiB. Native malloc profile book in-use was approximately 1.16/1.22 GiB with visible FileService cache-allocation stacks. These are not simultaneous pre-OOM snapshots and do not identify a leaking function. Old allocator accounting is not physical RSS; cumulative allocation is not live memory.

GOMEMLIMIT is a soft limit for Go-runtime-managed memory, excluding external allocations such as C/mmap memory (Go runtime documentation). Raising it alone can reduce native-memory headroom.

Related, not established duplicates

Scope here is CN memory growth/OOM and its MO-side validation. HTTP retry policy, full application recovery, historical 403 responses, and evaluation score improvements are not independent acceptance claims for this issue.

Runtime evidence is transcribed from the linked report. That report names cn-oom-investigation-20261102.json and full-completion-log-review-20261102.json as local sanitized archives; they are not attached here and were not independently opened during filing. No production credentials, infrastructure endpoints, evaluation payloads, or request/user identifiers are included.

Activity

  1. self-assigned this
    on Nov 2, 2026
  2. added
    kind/bug
    on Nov 2, 2026
  3. XuPeng-SH commented on Nov 10, 2026

    @XuPeng-SH
    Contributor

    修复范围记录:#32458 已于 2026-11-10 20:12:59 UTC 合入 main,merge SHA 为 56ad29d。它覆盖事务工作区批次复制的 CN 内存准入、独立生命周期与失败原子性,并补上 clean-object republication 的计费路径。

    本 issue 继续保留研发:PR 明确只完成部分 workspace-admission 加固,尚未完成本问题要求的原事故内存归因、受影响发布线的同条件复现与修复验证,以及 16 GiB Linux/cgroup 混合负载和超过历史 63/93 分钟窗口的 soak。不能据此认定历史 OOM 已系统解决。

    证据边界:作者报告 disttae、聚焦 race、局部 SQL 回归通过;部分最终 SQL 使用 non-SIMD stripped 诊断服务,canonical SIMD 本地构建因磁盘不足未完成。审查者确认先前 clean-object 准入问题已解决;合并队列报告 CI Required 成功。以上为远端作者、审查及队列记录,本轮没有运行本地 Go/SQL 测试,也未独立审计原始运行日志。完整 PR 吞吐和 16 GiB 压力/soak 仍未验证。保留原有 assignee 和开放状态,不自动要求 4.2 backport。

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

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions