Skip to content

[Bug]: TAE Merge: transfer slab allocation failure can panic the TN process #26376

Closed

Description

@LeftHandCold

Baseline

  • Branch: main
  • Commit: 52ea9f874f492c368a20efef16b46ab8ced2de37

Summary

An ordinary transfer-enabled TAE data Merge can turn a recoverable off-heap allocation failure into a TN process panic.

Code location

Actual behavior

getTransferSlab allocates a dense off-heap transfer slab through mpool.MakeSlice. When the allocator returns an error, including the normal configured-global-cap OOM error, it calls panic(err).

Both sorted Merge and reshape call getTransferSlab without an error return at that boundary. A normal TN data Merge therefore bypasses DoMergeAndWrite's error path. The TN worker goroutine has no generic panic recovery, so the panic can terminate the process.

The slab pool is explicitly drained after checkpoint processing. Therefore an empty bucket requiring a fresh allocation is a normal runtime state, not only a cold-start condition.

The Merge scheduler's admission check reads the instantaneous Available() memory and reduces/rejects a task estimate, but it does not reserve global mpool capacity for the admitted task. Other allocators can consume the remaining capacity between that check and getTransferSlab, so scheduler admission cannot eliminate this allocation-failure path.

Expected behavior

Transfer slab acquisition should return an error through the existing Merge task/transaction error path. Memory pressure should fail the current Merge cleanly instead of panicking the TN process.

Production-reachable trigger

  1. A normal data Merge runs with transfer enabled.
  2. The relevant slab bucket is empty, for example after checkpoint pool draining or under normal reuse turnover.
  3. A fresh off-heap slab allocation exceeds the configured global mpool cap, including when memory availability changed after scheduler admission.
  4. mpool.MakeSlice returns OOM.
  5. getTransferSlab panics and the TN worker goroutine does not recover it.

Confirmed scope

  • The global mpool cap is a normal runtime memory constraint.
  • The OOM return path is reachable without test-only fault injection.
  • Scheduler admission is an estimate based on instantaneous availability, not a capacity reservation.
  • The panic occurs while constructing the Merge/reshape transfer structures, before Merge output Objects are written.
  • Therefore an earlier inference that this specific panic could leave already-published output Objects was inaccurate and has been removed. The confirmed consequence is TN availability loss.

Impact

A recoverable Merge allocation/admission failure can crash the TN process and interrupt unrelated transactions and maintenance work handled by that TN.

Suggested fix and validation

  • Make transfer slab acquisition return ([]api.TransferDestPos, error) or an equivalent error-bearing result.
  • Propagate the error through sorted Merge and reshape constructors into DoMergeAndWrite.
  • Add deterministic allocation-failure tests for both paths, including allocation failure after admission succeeds.
  • Assert that Merge returns an error, the process does not panic, and all acquired Merge resources are released exactly once.

Activity

  1. changed the title [-][Bug]: TAE Merge: transfer slab allocation failure panics the service[/-] [+][Bug]: TAE Merge: transfer slab allocation failure can panic the TN process[/+] on Jul 29, 2026
  2. added
    severity/s0
    and removed on Jul 29, 2026
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

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions