Skip to main content
RunBook Academy

CephXX · PG PeeringPG Peering

Stuck peering — diagnosis and resolution

Expert⏱ ~17 minceph

What you'll learn

  • Recognise stuck peering and distinguish it from slow peering
  • Enumerate the causes and their diagnostic signatures
  • Apply resolutions in order of risk
  • Prevent recurrence

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

A stuck PG serves nothing. If enough are stuck, an application is down while the cluster reports most of itself healthy.

Recognising it

ceph pg dump_stuck inactive
ceph pg stat
ceph health detail | grep -i 'stuck\|inactive\|peering'

Peering lasting more than a minute or two for the same PG is stuck. Check twice, sixty seconds apart, before concluding.

The causes and their signatures

CauseSignatureDiagnostic
Required OSD unreachableblocked_by names itceph pg query
OSD up but unresponsivesame OSD across several stuck PGsdump_ops_in_flight
Monitor quorum problemsno map updates progressingceph quorum_status
Insufficient historyincomplete rather than peeringdown_osds_we_would_probe
Network fault between OSDspeering across a host boundary failsinterface counters
OSD out of memoryOSD restarting repeatedlydmesg, OSD logs

The diagnostic sequence

# 1. scope
ceph pg dump_stuck inactive > /tmp/stuck.txt
wc -l /tmp/stuck.txt

# 2. per PG, what is it waiting for
for pg in $(awk 'NR>1 {print $1}' /tmp/stuck.txt | head -10); do
  echo "== $pg"
  ceph pg $pg query 2>/dev/null | jq -r '.recovery_state[0].name, (.blocked_by // [] | tostring)'
done

# 3. look for a common OSD
for pg in $(awk 'NR>1 {print $1}' /tmp/stuck.txt); do
  ceph pg map $pg -f json | jq -r '.up[]'
done | sort | uniq -c | sort -rn | head

# 4. check monitors
ceph quorum_status --format json-pretty | jq '.quorum_names'

Step three is usually decisive: one OSD appearing in most stuck PGs names the problem.

Resolutions in order of risk

  1. Wait sixty more seconds. Some peering is genuinely slow.
  2. Restart the implicated OSD. Low risk, resolves the common case.
  3. Restore an unreachable OSD or host. Whatever blocked_by or down_osds_we_would_probe names.
  4. Fix the network or monitor quorum, if those are implicated.
  5. ceph osd out an OSD that will not recover, allowing CRUSH to choose elsewhere.
  6. ceph osd lost — irreversible, and only when the hardware is confirmed unrecoverable.

Preventing recurrence

After resolution, establish which cause it was and address it: memory headroom, PG counts, network reliability, or a device that should have been replaced.

Quiz

Knowledge check · 4 questions

  1. Q1. Twenty PGs are stuck peering. What should be done before restarting any OSD?

  2. Q2. An OSD can pass heartbeats while being too stuck to complete peering.

  3. Q3. Peering is stuck across many PGs with no single OSD dominating. Monitors are in quorum. Diagnose.

    96-OSD cluster, 380 PGs stuck peering following a CRUSH weight batch change. No OSD appears in more than a handful of the stuck up sets. Monitors are in quorum with a stable election epoch. dmesg on several OSD hosts shows OOM killer entries. OSDs are restarting repeatedly. PGs per OSD is 340.

  4. Q4. List the resolutions for stuck peering in order of risk.

Passing score: 75%. Answers are checked in this browser.

Production discipline

Identify the common OSD across stuck PGs before restarting anything — speculative restarts each trigger another cluster-wide peering round and can keep a cluster in perpetual peering. When no OSD dominates, look at monitors, network, and memory rather than daemons. Remember that an OSD passing heartbeats can still be too stuck to peer, and ceph tell osd.N version is the quick test. And work the resolutions in risk order, with ceph osd lost last and only on confirmed dead hardware.

Cross-course references

  • Ceph: Part XIX (PG States) for inactive states generally.
  • Ceph: Part XXII (PG Investigation) for reading pg query.
  • Ceph: Part XI (OSD Architecture) for the memory pressure case.