Project

General

Profile

Actions

Enhancement #80967

closed
SS SS

[RFE-Full-Soln] Use 'last_degraded' and 'last_clean' timestamps in metadata to track total rebuild time for PG

Enhancement #80967: [RFE-Full-Soln] Use 'last_degraded' and 'last_clean' timestamps in metadata to track total rebuild time for PG

Added by Sridhar Seshasayee 2 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Category:
Introspection/Control
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
umbrella
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
OSD
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-4439-gff2f4a0d98
Released In:
Upkeep Timestamp:
2026-10-14T13:10:45+00:00

Description

This is a successor to the interim solution to determine a more accurate PG vulnerability duration.

The earlier interim solution leveraged existing fields of pg_stats_t to determine the vulnerability
duration. The associated perf counter rs_pg_vulnerability_duration did not have the min/max fields
because the min field was not concurrent-safe.

See the following trackers for a full background on the work done for the interim solution:
  1. https://tracker.ceph.com/issues/77493
  2. https://tracker.ceph.com/issues/79028
  3. https://tracker.ceph.com/issues/80117

The full solution uses the new last_degraded field (which will be peered & persisted) along
with last_clean and overcomes the following limitations of the interim solution:

  • in-memory latch wiped on same-primary interval restart
  • mid-peering false completion (degraded count momentarily reads 0)
  • PG-split latch inheritance / delta_recovered-goes-negative on split
  • multi-handover episode split into N avgcount samples (interim solution trade-off)
  • rebuild record lost on OSD restart (in-memory only)
  • no min/max (whole-second gauges removed for a race)
  • empty / dataless vulnerability window silently discarded (delta_recovered filter)
  • recorded duration conflates silent exposure with active rebuild time
  • crash in the close -> publish gap could lose or double-count one window

The following limitations are not scoped for this RFE:
rebalance-vs-failure ambiguity - a benign CRUSH rebalance (pg_num/pgp_num catch-up, reweight, adding an OSD) with zero redundancy loss is still counted the same as a failure-driven rebuild. last_degraded keys on the same signals the interim is_vulnerable did; persisting it more reliably does not make it more correct. A real fix needs OSDMap change - which is not scoped for this RFE considering the unknowns. This will be a separate future work. This would remain a documented limitation.

not a true union-of-intervals - sum is still a sum over per-PG episodes on one OSD-wide counter; many PGs recovering concurrently from one OSD departure inflate sum past the true elapsed exposure. Reading it as cumulative PG-exposure-seconds rather than wall-clock exposure is correct; documented.

OSD-wide aggregate, not per-PG - The aggregate counters in scope answer "how much / how often / how bad" cluster- and OSD-wide.
Per-PG answers "which PG / why" - a drill-down capability, valuable but independently shippable later. Deferred to a future release because:

  • it is in-memory only (lost on mgr restart/failover) and capped at ~10 records/PG — making it durable (persisting the last ~N events per PG) is its own body of work;
  • it needs the mon to relay stats accurately (reports from a concurrently-out-marked primary do not reliably reach the mgr; brief intermediate clean windows get smoothed over) to be trustworthy;
  • The number of per-PG labels for Prometheus to scrape has to be bounded - handled in the draft PR by emitting only for rebuild-active OSDs, but still needs validation at scale.

Related issues 1 (0 open — 1 closed)

Copied to RADOS - Backport #81548: umbrella: [RFE-Full-Soln] Use 'last_degraded' and 'last_clean' timestamps in metadata to track total rebuild time for PGResolvedSridhar Seshasayee

Actions

SS Updated by Sridhar Seshasayee 2 months ago Actions #1

  • Description updated (diff)

SS Updated by Sridhar Seshasayee 2 months ago Actions #2

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 72144

SS Updated by Sridhar Seshasayee 2 months ago Actions #3

  • Backport set to umbrella

LF Updated by Laura Flores 2 months ago Actions #4

PR is under review

KS Updated by Kamoltat (Junior) Sirivadhna about 2 months ago Actions #5

PR under review.

RZ Updated by Radoslaw Zarzynski about 2 months ago Actions #6

PR sent to QA.

RZ Updated by Radoslaw Zarzynski about 2 months ago Actions #7

  • Copied to Backport #81548: umbrella: [RFE-Full-Soln] Use 'last_degraded' and 'last_clean' timestamps in metadata to track total rebuild time for PG added

UB Updated by Upkeep Bot about 2 months ago Actions #8

  • Status changed from Fix Under Review to Backporting
  • Merge Commit set to ff2f4a0d988c7377e27f2c20f57caf87da4dcf78
  • Fixed In set to v21.3.0-4439-gff2f4a0d98
  • Upkeep Timestamp set to 2026-10-14T12:41:20+00:00

UB Updated by Upkeep Bot about 2 months ago Actions #9

  • Status changed from Backporting to Resolved
  • Upkeep Timestamp changed from 2026-10-14T12:41:20+00:00 to 2026-10-14T13:10:45+00:00
Actions

Also available in: PDF Atom