Project

General

Profile

Actions

Bug #77633

closed
MS KC

OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2

Bug #77633: OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2

Added by Markus Schmidleitner 5 months ago. Updated 3 months ago.

Status:
Backporting
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
squid tentacle umbrella
Regression:
Yes
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-1311-ga4c43f6e50
Released In:
Upkeep Timestamp:
2026-08-27T18:42:41+00:00

Description

after upgrade from rook v1.19.7 to v1.20.1 and from ceph v20.2.1 to ceph v20.2.2 the standby mgr gets oom-killed repeatedly.
it seems 20.2.2 introduced a mem-leak.
please see https://github.com/rook/rook/issues/17786 for further informations.


Related issues 7 (2 open — 5 closed)

Related to Orchestrator - Bug #77538: Mgr logs are extremely verbose with list of pods in json output from the Rook moduleResolvedMatthew Heler

Actions
Related to mgr - Bug #79492: root logger left at NOTSET floods the Ceph log with third-party DEBUG records and OOMs ceph-mgrDuplicate

Actions
Has duplicate mgr - Bug #78165: mgr regression in v20.2.2: prometheus + rook OOM due to unbounded loggingDuplicate

Actions
Copied to mgr - Bug #78589: mgr/rook: a watcher thread and API connection leak on every orchestrator callResolvedKefu Chai

Actions
Copied to mgr - Backport #78590: umbrella: OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2NewKefu Chai

Actions
Copied to mgr - Backport #78591: tentacle: OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2ResolvedNitzan Mordechai

Actions
Copied to mgr - Backport #78592: squid: OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2NewKefu Chai

Actions

KC Updated by Kefu Chai 5 months ago Actions #2

I don't think this is a dup of #77538, at least not yet.

#77538 is the rook module logging ~228KB of kubernetes PodList JSON at DEBUG. Three reasons that doesn't transfer to the standby OOM:

  1. Rook doesn't run on the standby. It has no MgrStandbyModule subclass, and standby_start() only starts modules that provide a standby class, so the 228KB logging never happens there.
  2. #77538 is log volume. In a container the daemon log goes to stderr and the node's disk, not the pod's RSS. The only in-memory part is the recent-log ring (m_recent), a count-bounded circular_buffer(10000) that plateaus. Log volume can't produce an unbounded RSS climb to OOM.
  3. The two reports disagree on which pod grows: one sees the standby stable (~64MB) with the active growing, the other sees the standby growing.

KC Updated by Kefu Chai 5 months ago Actions #3

  • Status changed from New to Need More Info

NM Updated by Nitzan Mordechai 5 months ago Actions #4

  • Related to Bug #77538: Mgr logs are extremely verbose with list of pods in json output from the Rook module added

KC Updated by Kefu Chai 5 months ago Actions #5

  • Status changed from Need More Info to In Progress
  • Assignee set to Kefu Chai

KC Updated by Kefu Chai 5 months ago Actions #6

  • Status changed from In Progress to Fix Under Review
  • Backport set to squid tentacle umbrella
  • Pull request ID set to 70071

KC Updated by Kefu Chai 5 months ago Actions #7

  • Has duplicate Bug #78165: mgr regression in v20.2.2: prometheus + rook OOM due to unbounded logging added

KC Updated by Kefu Chai 5 months ago Actions #8

Kefu Chai wrote in #note-2:

I don't think this is a dup of #77538, at least not yet.

i was wrong. see the analysis in #78165, which is a dup of this issue.

KC Updated by Kefu Chai 5 months ago Actions #9

i am quoting Will Glynn's bug report at #78165 here for a better context and analysis:

Will Glynn wrote:

With Rook v1.20.1 and Ceph v20.2.2, the active mgr's Python heap grows without bound whenever the prometheus module's background collection loop is running (`mgr/prometheus/cache=true` + `scrape_interval=15`, both the default), even with zero scrapers polling the metrics endpoint at :9283.

Reverting the mgr component to v20.2.1 corrected the issue, confirming this is a regression. ceph mgr fail released the memory. Disabling prometheus released the memory. ceph config set mgr mgr/prometheus/cache false prevented it from growing at idle (but still grew each scrape).

This behavior is a combination of three things:

1. prometheus collect() calls orch_is_available() which lists all pods in the namespace.
2. The "list all pods" response body is logged verbatim, as described in #77538.
3. log_max_recent log entries are kept in a circular buffer, but despite the documentation claiming the default is 500, the effective limit here is daemon_default: 10000.

This cluster has 137 OSDs, so "list all pods in namespace" produces 6 MB of JSON. collect() is called every 15 seconds, so mgr footprint grows 24 MB/minute. The log buffer is willing to hold 10000 such entries; my mgr hit 30 GB in about a day.

My current workaround is ceph config set mgr log_max_recent 100, bounding the leak to 600 MB. This is effective and stable.

I propose:

1. Answering orch_is_available() with a lighter-weight query.
2. Backporting the #77538 fix as planned.
3. Causing log_max_recent to limit bytes in addition to limiting entries. (Perhaps also a documentation change.)

KC Updated by Kefu Chai 4 months ago Actions #10

  • Copied to Bug #78589: mgr/rook: a watcher thread and API connection leak on every orchestrator call added

KC Updated by Kefu Chai 4 months ago Actions #11

  • Pull request ID changed from 70071 to 70146

UB Updated by Upkeep Bot 4 months ago Actions #12

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to a4c43f6e50335fa14fe3953a9089cc85cc423e16
  • Fixed In set to v21.3.0-1311-ga4c43f6e50
  • Upkeep Timestamp set to 2026-07-23T03:04:35+00:00

UB Updated by Upkeep Bot 4 months ago Actions #13

  • Copied to Backport #78590: umbrella: OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2 added

UB Updated by Upkeep Bot 4 months ago Actions #14

  • Copied to Backport #78591: tentacle: OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2 added

UB Updated by Upkeep Bot 4 months ago Actions #15

  • Copied to Backport #78592: squid: OOM-Kills of standby MGR after Upgrade to rook v1.20.1 / ceph v20.2.2 added

UB Updated by Upkeep Bot 4 months ago Actions #16

  • Tags (freeform) set to backport_processed

NM Updated by Nitzan Mordechai 4 months ago Actions #17

  • Has duplicate Bug #79492: root logger left at NOTSET floods the Ceph log with third-party DEBUG records and OOMs ceph-mgr added

NM Updated by Nitzan Mordechai 4 months ago Actions #18

  • Has duplicate deleted (Bug #79492: root logger left at NOTSET floods the Ceph log with third-party DEBUG records and OOMs ceph-mgr)

NM Updated by Nitzan Mordechai 4 months ago Actions #19

  • Related to Bug #79492: root logger left at NOTSET floods the Ceph log with third-party DEBUG records and OOMs ceph-mgr added

UB Updated by Upkeep Bot 3 months ago Actions #20

  • Status changed from Pending Backport to Backporting
  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2026-07-23T03:04:35+00:00 to 2026-08-27T18:42:41+00:00
Actions

Also available in: PDF Atom