]> git.proxmox.com Git - ceph.git/blame - ceph/doc/dev/osd_internals/recovery_reservation.rst
import ceph 14.2.5
[ceph.git] / ceph / doc / dev / osd_internals / recovery_reservation.rst
CommitLineData
7c673cae
FG
1====================
2Recovery Reservation
3====================
4
5Recovery reservation extends and subsumes backfill reservation. The
6reservation system from backfill recovery is used for local and remote
7reservations.
8
9When a PG goes active, first it determines what type of recovery is
10necessary, if any. It may need log-based recovery, backfill recovery,
11both, or neither.
12
13In log-based recovery, the primary first acquires a local reservation
14from the OSDService's local_reserver. Then a MRemoteReservationRequest
15message is sent to each replica in order of OSD number. These requests
16will always be granted (i.e., cannot be rejected), but they may take
17some time to be granted if the remotes have already granted all their
18remote reservation slots.
19
20After all reservations are acquired, log-based recovery proceeds as it
21would without the reservation system.
22
23After log-based recovery completes, the primary releases all remote
24reservations. The local reservation remains held. The primary then
25determines whether backfill is necessary. If it is not necessary, the
26primary releases its local reservation and waits in the Recovered state
27for all OSDs to indicate that they are clean.
28
29If backfill recovery occurs after log-based recovery, the local
30reservation does not need to be reacquired since it is still held from
31before. If it occurs immediately after activation (log-based recovery
32not possible/necessary), the local reservation is acquired according to
33the typical process.
34
35Once the primary has its local reservation, it requests a remote
36reservation from the backfill target. This reservation CAN be rejected,
37for instance if the OSD is too full (backfillfull_ratio osd setting).
38If the reservation is rejected, the primary drops its local
39reservation, waits (osd_backfill_retry_interval), and then retries. It
40will retry indefinitely.
41
42Once the primary has the local and remote reservations, backfill
43proceeds as usual. After backfill completes the remote reservation is
44dropped.
45
46Finally, after backfill (or log-based recovery if backfill was not
47necessary), the primary drops the local reservation and enters the
48Recovered state. Once all the PGs have reported they are clean, the
49primary enters the Clean state and marks itself active+clean.
50
eafe8130
TL
51-----------------
52Dump Reservations
53-----------------
54
55An OSD daemon command dumps total local and remote reservations::
56
57 ceph daemon osd.<id> dump_recovery_reservations
58
7c673cae
FG
59
60--------------
61Things to Note
62--------------
63
64We always grab the local reservation first, to prevent a circular
65dependency. We grab remote reservations in order of OSD number for the
66same reason.
67
68The recovery reservation state chart controls the PG state as reported
69to the monitor. The state chart can set:
70
71 - recovery_wait: waiting for local/remote reservations
72 - recovering: recovering
73 - recovery_toofull: recovery stopped, OSD(s) above full ratio
74 - backfill_wait: waiting for remote backfill reservations
75 - backfilling: backfilling
76 - backfill_toofull: backfill stopped, OSD(s) above backfillfull ratio
77
78
79--------
80See Also
81--------
82
83The Active substate of the automatically generated OSD state diagram.