






















The clean PG state indicates that all copies of a placement group's data are present and consistent across all acting OSDs. Together with active, it forms active+clean, which is the fully healthy state for a PG.
A PG is clean when:
Every PG should eventually reach active+clean. When ceph status shows all PGs in this state, the cluster is fully healthy:
ceph status
# pgmap: 256 pgs: 256 active+clean; ...Check the count:
ceph pg stat
# 256 pgs: 256 active+clean
# In JSON
ceph pg stat --format json | jq '.num_pgs_by_state[] | select(.state_name == "active+clean")'| State | Meaning |
|---|---|
active+clean | Fully healthy, all copies present |
active+degraded | Some copies missing |
active+clean+scrubbing | Healthy but currently being scrubbed |
active+clean+snaptrim | Healthy but trimming snapshots |
After an OSD failure and recovery, PGs transition through several states before reaching clean:
active+degraded -> active+degraded+recovering -> active+cleanWatch the transition:
watch ceph pg statRecovery time depends on:
osd_recovery_max_active settingEstimate using the bytes to recover:
ceph status | grep "degraded\|recovering"
# degraded (x%) objects, x/y bytesInspect a specific PG:
ceph pg <pg-id> query | jq '{state: .state, last_clean: .info.history.last_epoch_clean}'Check how many PGs per pool are clean:
ceph pg ls-by-pool mypool | awk '{print $1, $16}' | grep -v "active+clean" | head -20Even a clean PG might have silent data corruption. Verify by triggering a deep scrub:
ceph osd pool deep-scrub mypool
ceph health detail | grep -i "inconsistent\|error"The clean PG state confirms that all desired replicas are present and fully synchronized. The target healthy state for every PG is active+clean. When any PG deviates from this state, Ceph immediately begins recovery. Monitor how many PGs are in active+clean to track cluster health after OSD failures or maintenance events.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。