惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
H
Help Net Security
Jina AI
Jina AI
V
V2EX
G
Google Developers Blog
B
Blog
GbyAI
GbyAI
U
Unit 42
爱范儿
爱范儿
腾讯CDC
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
小众软件
小众软件
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
博客园 - 聂微东
The Cloudflare Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏

OneUptime Blog

How to Monitor Azure App Services (PaaS) with OpenTelemetry Grafana Stack vs OneUptime: DIY Observability or Unified Platform? Your AI Workloads Are About to Blow Up Your Observability Bill The Great Observability Consolidation Is Here How to Write Custom Object Classes for Ceph How to Write Custom Ceph Manager Modules How to Write a ceph.conf Configuration File How to Use Rook-Ceph with OpenShift How to Use Rook-Ceph with Longhorn for Comparison How to Configure Volume Snapshot Class for RBD in Rook How to Configure VolumeReplicationClass Scheduling Intervals in Rook How to Set Up Volume Replication with Rook-Ceph How to Create Volume Group Snapshots with Rook CSI How to Visualize Ceph Network Performance in Grafana How to Enable Virtual Host-Style Bucket Access in Rook How to View Runtime Configuration via Admin Socket How to View Quota Settings and Update Stats in Ceph RGW How to View PG Scaling Recommendations with autoscale-status How to View PG Distribution via Admin Socket How to View Performance Metrics in the Ceph Dashboard How to View OSD Performance Counters in Ceph How to View Connection Status via Admin Socket How to View Ceph Cluster Summary Dashboard via CLI How to Version Control Rook-Ceph Configuration How to Version Control Ceph Infrastructure with Terraform How to Verify Kubernetes Node Requirements for Rook-Ceph Deployment How to Verify Health Before and After Rook Upgrades How to Verify Data Integrity with Deep Scrubbing How to Verify Complete Rook-Ceph Cleanup How to Verify Backup Integrity from Ceph Snapshots
How to Understand the repair PG State in Ceph
Nawaz Dhandala · 2026-03-31 · via OneUptime Blog

The repair PG state indicates that Ceph is actively fixing object inconsistencies found during a scrub. It is a short-lived transitional state that follows the detection of an inconsistent PG.

What repair Means

When ceph pg repair <pg-id> is called, or when Ceph automatically repairs during a scrub (if osd_scrub_auto_repair is enabled), the PG enters the repair state. During repair:

  1. The primary OSD identifies the authoritative copy of each inconsistent object
  2. It overwrites the corrupt or incorrect copies on replica OSDs
  3. After all objects are repaired, the PG exits the repair state

Triggering Repair

Repair is triggered manually or automatically:

# Manual repair
ceph pg repair <pg-id>

# Repair all inconsistent PGs in a pool
for pg in $(ceph pg dump | grep inconsistent | awk '{print $1}'); do
  ceph pg repair $pg
done

Enable automatic repair:

ceph config set osd osd_scrub_auto_repair true
ceph config set osd osd_scrub_auto_repair_num_errors 5  # max errors to auto-repair

Monitoring Repair Progress

ceph pg stat | grep repair

# Watch the repair state clear
watch 'ceph health detail | grep -E "inconsistent|repair"'

For a specific PG:

ceph pg <pg-id> query | jq '.state'

The repair state should clear within minutes for small PGs.

How Ceph Chooses the Authoritative Copy

Ceph uses the primary OSD's copy as authoritative in most cases. The decision is based on:

  1. The acting primary's object version
  2. Which replica has the highest version number
  3. If versions are equal, the primary wins

You can inspect the decision:

ceph pg <pg-id> query | jq '.peer_info'

When Repair Succeeds

After successful repair:

ceph health detail
# No more inconsistent PG messages

ceph pg dump | grep <pg-id>
# State should show active+clean

Confirm the fix with another scrub:

ceph pg deep-scrub <pg-id>

When Repair Fails

If repair does not clear the inconsistency:

ceph health detail | grep "inconsistent"

Possible causes:

  • All copies are equally corrupt (no authoritative version)
  • The OSD containing the good copy is offline

In this case:

# Identify which objects are still inconsistent
rados list-inconsistent-obj <pg-id>

# If all copies are bad, the object may be unrecoverable
# Remove the corrupt object as a last resort
rados -p <pool-name> rm <object-name>

Repair During Scrub

When osd_scrub_auto_repair is enabled, repair happens inline during the scrub cycle. The PG will show scrubbing+repair or scrubbing+deep+repair:

ceph pg dump | grep "scrubbing"

Summary

The repair PG state is a positive indicator: Ceph has found inconsistencies and is actively correcting them. Repair is triggered manually via ceph pg repair or automatically via osd_scrub_auto_repair. Monitor its completion with ceph health detail and follow up with a deep scrub to verify the repair was successful. Persistent repair failures indicate hardware issues requiring physical inspection.