Project

General

Profile

Actions

Bug #81929

open
KB

mgr/cephadm: a spec change redeploys a second OSD while the PGs of the first one still peer, and PGs go down

Bug #81929: mgr/cephadm: a spec change redeploys a second OSD while the PGs of the first one still peer, and PGs go down

Added by Kyle Bader about 1 month ago. Updated about 3 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
cephadm/osd
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

When a change to an OSD service specification makes cephadm redeploy
its OSDs, cephadm checks osd ok-to-stop before each OSD (18bb15c2f70,
"mgr/cephadm: check ok-to-stop before OSD redeploy/reconfig"). It runs
the check for the next OSD a few seconds after it restarts the previous
one, in the same serve loop. The mgr's PG statistics do not show the
restart yet, so the check can pass. Then two OSDs of the same PGs are
down at the same time. In our test, PGs went down for 4 to 6 seconds:

13:58:19 [cephadm INFO cephadm.serve] Deploying daemon osd.0 on dev
13:58:25 [cephadm INFO cephadm.serve] Deploying daemon osd.1 on dev
13:58:31 [cephadm INFO cephadm.serve] Skipping redeploy of osd.2 (not ok-to-stop: unsafe to stop osd(s) at this time (85 PGs are or would become offline)); will retry next serve loop
13:58:34 cluster [WRN] Health check failed: Reduced data availability: 114 pgs down (PG_AVAILABILITY)
13:58:38 cluster [INF] Health check cleared: PG_AVAILABILITY (was: Reduced data availability: 114 pgs down)

A second run gave the same result with another order. cephadm
redeployed osd.0, refused osd.1, and redeployed osd.2 in the same
second. osd.0 was down from 13:47:03 to 13:47:07, and osd.2 stopped at
13:47:07. Then 74 PGs were down from 13:47:12 to 13:47:18.

Reproducer

We used one host and three OSDs on LVs. The image is a ceph-ci build
of main at c88dbd7d8f4. Its patches do not touch mgr/cephadm or the mgr.

cephadm bootstrap --mon-ip IP --single-host-defaults --skip-dashboard --skip-monitoring-stack
ceph orch apply -i osd.yaml     # service_type: osd, data_devices paths: three LVs
# wait for HEALTH_OK, then add to osd.yaml:
#   extra_container_args:
#     - "--env=TEST=1" 
ceph orch apply -i osd.yaml
ceph log last 300 cluster | grep PG_AVAILABILITY

--single-host-defaults gives pools of size 2 and min_size 1. With
size 3 and min_size 2, two OSDs down at the same time also make PGs
inactive.

Cause

osd ok-to-stop judges from the PG statistics in the mgr. These come
from the OSDs every few seconds. Right after an OSD restarts, its PGs
can still show the old acting set and the state active. So for the next
OSD, the check counts the restarted OSD as a live copy.

#81468 also affects this check. Since cf54988c504, osd ok-to-stop N
looks only at the PGs whose last acting OSD is N. On this cluster,
ceph osd ok-to-stop 0 checked 90 PGs, but osd.0 has about 190 PGs.
With size 2 and min_size 1, that bug does not change the result, so the
stale statistics are enough to cause this one.

A smaller issue: an OSD that is not ok to stop waits for the next serve
loop. With the default intervals, that is 10 minutes (osd.2 above was
redeployed at 14:08:37). A host with many OSDs then needs a serve loop for
each OSD.

Fix options

  • In _check_daemons, after a redeploy or reconfig of an OSD, defer the
    OSD actions that need ok-to-stop to a later serve loop. Wake that loop
    soon, for example in 30 seconds, instead of after the full sleep.
  • Or, before the next check, wait until each OSD that this loop
    restarted is up and its PGs are active again, as the upgrade does
    between batches.
  • Or check ok-to-stop once for all the OSDs that need the action, with
    max, as the upgrade does, and redeploy only the set that the mgr
    returns.

Affected versions: main (since PR #70716, 18bb15c2f70)

YA Updated by Yasir Alnuwasir about 6 hours ago Actions #1

Fix proposed in ceph/ceph#74801 · mgr/cephadm: wait after an OSD…

It records when cephadm last restarted an OSD, and defers the next autonomous OSD redeploy/reconfig for mgr/cephadm/osd_restart_settle_time (default 30s) without asking ok-to-stop. It also retries deferred OSDs after the settle time instead of the full serve interval.

Could someone set the Pull request ID to 74801 and the status to Fix Under Review? My account can't edit those fields.

JB Updated by Joshua Blanch about 6 hours ago Actions #2

  • Pull request ID set to 74801

JB Updated by Joshua Blanch about 5 hours ago Actions #3

@Yasir what version were you seeing these issues? It looks similar to this issue https://tracker.ceph.com/issues/80440

YA Updated by Yasir Alnuwasir about 3 hours ago Actions #4

Thanks for linking the PR. To clarify, Kyle Bader reported this one; his reproducer used a ceph-ci build of main at c88dbd7d8f4, so it already includes the #80399 ok-to-stop check (18bb15c2, https://github.com/ceph/ceph/pull/71640).

It's related to #80440 but a separate problem. #80440 was OSDs being restarted on reconfig when they didn't need to be. Here the restarts are needed (an extra_container_args change in Kyle's test), and the #80399 check is what runs. It passes for the next OSD a few seconds after the previous one restarts, because the mgr's PG stats still show that OSD's PGs as active. So two OSDs of the same PGs end up down together. 74801 makes cephadm wait osd_restart_settle_time (default 30s) after any OSD restart before checking ok-to-stop for the next one.

Actions

Also available in: PDF Atom