Skip to content

[Bug]: chaos test — DN OOM burst in 2 min under filesystem error injection (TransferPage retry storm) #24334

Closed

Description

@Ariznawlll

Environment

  • Branch: 3.0-dev
  • Commit: 4de4c6a (2026-05-09)
  • Cluster: mo-chaos-4de4c6a-202605101659
  • Pod: mo-chaos-regression-dis-dn-0, memory limit 10 GiB
  • Event: OOMKilled at UTC 2026-05-11 01:50 (kube_pod_container_status_last_terminated_reason=OOMKilled, restart count 0 → 1)

Current Behavior

Under chaos-mesh IOChaos filesystem error injection targeting the DN pod, DN-0 memory grows from 0.75 GB to 2.7 GB within 2 minutes and then gets OOMKilled at the 10 GiB cgroup limit. Post-restart the pod stabilizes at ~5 GB and does not crash again for the remainder of the injection window.

This is not a sustained leak. It is a 2-minute burst allocation storm triggered by DN's response to repeated write failures from the injected IO faults.

Timeline (UTC 2026-05-11)

01:42:27  dragonboat: "filesystem error injection mode" — injection window starts
01:40:00  [TransferPage] write transfer page error begins (1798 occurrences in 14h)
01:48:00  working_set 0.75 GB
01:49:00  1.10 GB
01:49:55-01:49:59  TransferPage write errors flood at ~11/sec
01:50:00  OOMKilled by cgroup
01:51:00  post-restart 1.88 GB
01:54:00  2.70 GB
02:00:00+ stabilizes at ~5 GB (no further crashes)
04:33:25  chaos-mesh "recover chaos" — injection window ends

Profile Evidence (pre-crash 10-minute window on DN-0)

Queried via Pyroscope SelectMergeStacktraces, service_name="mo-chaos-4de4c6a-202605101659/main", pod="mo-chaos-regression-dis-dn-0".

memory:inuse_space (Go heap, 29 GB reported across window due to sampling aggregation):

Self % Function
19.23% mpool.alloc
13.31% pb/logservice.NewLogRecord
11.07% fileservice/fifocache.New[...]
5.40% io.ReadAll
5.39% objectio.NewArena
5.03% goetty/v2/buf.(*nonReusableAllocator).Alloc
3.02% objectio.ReadBloomFilter

memory:alloc_space (cumulative, 93 GB in the same 10-min window):

Self % Function
35.33% io.ReadAll
32.93% mpool.alloc
7.75% bytes.growSlice
3.62% objectio.(*objectWriterV1).WriteWithCompress
2.03% objectio.NewArena
1.19% pb/api.(*Batch).Unmarshal

CPU profile is unremarkable (runtime/GC dominant, no business hot-function > 1%). This is an allocation problem, not a CPU spin.

Note: malloc profile (off-heap/mpool) is available in this cluster but returns no non-zero stacks — suspect the mpool region itself is sitting outside the profile sampling, or this namespace has not been rolled out with the /debug/malloc agent config. The Go-heap profile alone is still sufficient to locate the hot paths.

Root Cause Hypothesis

  1. IOChaos causes objectio/writer.go Sync() calls to fail on DN-0 with filesystem errors.
  2. The TransferPage write path retries aggressively when Sync() fails — observed as [TransferPage] write transfer page error, page count 1 flooding at ~11/sec for the last 5 seconds before OOM.
  3. Each retry re-reads source data via io.ReadAll (35.3% of alloc_space) and allocates through mpool (32.9%), with no bounded buffer / backpressure.
  4. The combined retry-fanout allocates ~93 GB cumulative in 10 minutes while Go GC cannot keep up, driving working_set from <1 GB to >10 GB in 2 minutes.

The problem is not that the injection happens (chaos tests are expected to inject faults). The problem is that DN's TransferPage-on-Sync-failure path has no bounded retry or memory-pressure-aware backoff, so a transient IO fault turns into an unrecoverable OOM burst within 2 minutes.

Why this is NOT a duplicate

  • #24319 (open, my earlier filing 2026-05-09): DN nil-pointer panic in ToCNBatch under MinIO S3 throttling — different trigger (503 SlowDown, not filesystem error), different crash mode (panic vs OOM), different code path (flushObjTask vs TransferPage).
  • #24307 (closed today, fixed by #24309): CN OOM under sysbench 1000w insert-ignore on main TKE regression — different pod type (CN vs DN), different load, different cluster, different branch.
  • No existing issue matches "DN OOM burst under IOChaos filesystem injection driven by TransferPage retry fanout".

Suggested investigation direction

The TransferPage / objectio/writer.Sync retry path on DN should:

  1. Enforce a bounded retry count for filesystem errors rather than unbounded tight-loop retry
  2. Release or cap io.ReadAll-buffered source data between retries instead of holding it all in memory
  3. Consult mpool pressure / working_set headroom before scheduling another retry

Evidence Archive

  • Namespace: mo-chaos-4de4c6a-202605101659
  • Loki: {namespace="mo-chaos-4de4c6a-202605101659", pod="mo-chaos-regression-dis-dn-0"} |= "TransferPage"
  • Pyroscope host: https://shanghai.idc.matrixorigin.cn:30001
  • Pre-crash window: start=1746931800000, end=1746932430000 (UTC 2026-05-11 01:40 → 01:50:30)
  • Peak working_set: ~5.2 GB sustained post-restart; limit 10 GiB

Activity

  1. added
    kind/bug
    on May 11, 2026
  2. added
    severity/s0
    on May 11, 2026
  3. added theissue type on May 11, 2026
  4. added this to the MO-2506 milestone on May 11, 2026
  5. added a commit that references this issue on May 11, 2026
    3d30f62
  6. Ariznawlll commented on May 12, 2026

    @Ariznawlll
    CollaboratorAuthor

    Recurrence — 2026-05-12

    Cluster mo-chaos-4de4c6a-202605101659 was left running on the same commit. DN-0 OOMKilled a second time at UTC 2026-05-11 18:00:00 (restart count 1 → 2), ~16 hours after the first OOM reported in the issue body.

    Second OOM evidence

    • kube_pod_container_status_last_terminated_reason=OOMKilled (both samples return OOMKilled)
    • kube_pod_container_status_restarts_total timeline:
      2026-05-11 02:00 UTC  restart_total=1   ← first OOM (from original report)
      2026-05-11 18:00 UTC  restart_total=2   ← second OOM
      2026-05-12 00:00 UTC  restart_total=2   (stable)
      2026-05-12 03:00 UTC  restart_total=2   (stable)
      
    • [TransferPage] write transfer page error is still flooding at ~1000–1200 occurrences per 10-minute window at file time (2026-05-12 03:30 UTC), indicating chaos-mesh IOChaos is continuing to cycle and the retry-storm pattern is reproducing deterministically when injection hits DN-0.

    What it tells us

    • The original OOM is not a one-off chaos quirk. Same code path, same cluster, same 4de4c6a build, same failure mode 16h apart.

    • Post-restart DN-0 stabilizes at ~2–4 GB working_set (limit 10 GB) between injection windows, which rules out a cumulative leak — this really is a per-injection burst allocation storm as hypothesized in the original filing.

    • Business-level fallout is also reproducing consistently across the two windows:

      • 128-chaos-cdc: 218 errors today vs 216 in original window
      • 128-chaos-tpcc: 199 vs 195
      • 128-chaos-insert-auto-incre: 80 vs 84

      Numbers are near-identical, reinforcing that the test harness sees the same OOM as a steady-state consequence of the injection schedule — this will not self-recover.

    Ask

    If the fix direction is the bounded-retry + memory-pressure-aware backoff in TransferPage/objectio.Sync path suggested in the issue body, this cluster is a stable reproducer — the next IOChaos injection cycle will almost certainly OOM DN-0 again and I can capture a fresh heap profile from inside the 2-minute burst window if that would help locate the exact retry loop to bound.

  7. Ariznawlll commented on May 14, 2026

    @Ariznawlll
    CollaboratorAuthor

    Post-fix recurrence — 2026-05-14

    Environment

    Evidence that #24337 is included

    88ac20a is identical to 3.0-dev HEAD. git log confirms #24337 merge commit ac939ff48 (2026-05-12T16:12) is an ancestor.

    Current behavior

    • Loki shows [TransferPage] load transfer page INFO logs still present, but no write transfer page error infinite retry — the bounded retry from fix: bounded retry for TransferPage write to prevent DN OOM under IO faults #24337 is working.
    • However, DN still OOMs every ~11 minutes. Each restart is confirmed by MO logger init entries spaced 10-11 min apart (20+ occurrences in 24h).
    • kube_pod_container_status_last_terminated_reason = OOMKilled (cgroup kill).

    Pyroscope memory profile (Go heap, 2h window)

    Total DN inuse: 270.16 GB (cumulative across samples)
    Top leaf allocators:
      61.27 GB (22.7%)  pkg/common/mpool.alloc
      37.43 GB (13.9%)  pkg/pb/logservice.NewLogRecord
      33.58 GB (12.4%)  pkg/fileservice/fifocache.New[...]
       8.58 GB ( 3.2%)  pkg/vm/engine/tae/txn/txnbase.NewTxnCtx
       7.57 GB ( 2.8%)  bytes.growSlice
       5.89 GB ( 2.2%)  pkg/vm/engine/tae/logstore/sm.NewSafeQueue
       5.71 GB ( 2.1%)  pkg/vm/engine/tae/txn/txnimpl.newStore
    

    Analysis

    The original TransferPage retry storm (burst from 0.75→2.7 GB in 2 min) is mitigated. The current OOM has a different profile:

    1. mpool.alloc (22.7%) — sustained mpool allocation, not a burst pattern
    2. logservice.NewLogRecord (13.9%) — WAL record allocation during replay after each restart
    3. fifocache.New (12.4%) — cache initialization on restart

    Hypothesis: each DN restart triggers WAL replay which allocates heavily via mpool + logservice records. Under continuous chaos IO fault injection, the DN accumulates memory faster than it can reclaim, hitting the 10 GiB cgroup limit within ~11 minutes of each restart.

    Conclusion

    #24337 fixed the specific TransferPage infinite-retry OOM burst, but a second OOM path exists under sustained chaos injection: restart → WAL replay memory pressure → OOM → restart (vicious cycle). This may require:

    • Limiting WAL replay memory budget
    • Or gracefully degrading under sustained IO faults instead of full replay on each restart
  8. Ariznawlll commented on May 26, 2026

    @Ariznawlll
    CollaboratorAuthor

    Post-fix verification — 2026-05-26

    Checked the background chaos run started by mo-nightly-regression run 26397438910:

    Result

    #24334 did not reproduce on DN in this run.

    Evidence

    DN pod checked: mo-chaos-regression-dis-dn-0

    • kube_pod_container_status_restarts_total: 0
    • No OOMKilled last terminated reason for DN
    • Loki DN OOM scan returned no matches for:
      • OOMKill
      • OOMKilled
      • CrashLoopBackOff
      • exit code 137
      • SIGKILL
      • Out of memory
      • runtime: out of memory
    • Loki DN query for write transfer page error returned 0 matches
    • Loki DN query for TransferPage only returned 2 normal load transfer page INFO logs, not a retry storm
    • DN current memory usage is about 20% of limit
    • DN 24h max memory usage is about 82% of limit, with no OOM/restart

    Note

    There was an OOMKilled signal on mo-chaos-regression-dis-tp-cn-5ths7, but that is a TP-CN pod and is not the DN TransferPage OOM pattern described in this issue.

    Conclusion

    For commit-58ad528 / namespace mo-chaos-58ad528-202605251911, the DN TransferPage retry-storm OOM from this issue appears fixed: DN had no OOM, no restart, and no write transfer page error storm during the checked window.

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

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions