From 8389c0f33b3cfcf9b96041bb3e172fdfc17ad241 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 15 Feb 2024 23:27:52 +0300 Subject: [PATCH] Fix PGs sometimes hanging in "starting" state on mass OSD restarts --- src/osd_cluster.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/osd_cluster.cpp b/src/osd_cluster.cpp index 180bd8804..b30cd9495 100644 --- a/src/osd_cluster.cpp +++ b/src/osd_cluster.cpp @@ -843,7 +843,13 @@ void osd_t::report_pg_states() pg_state_exists = true; if (pg.state == PG_OFFLINE && pg_it->second.cur_primary != this->osd_num) { - // Nothing to check or report, PG is already taken over by another OSD + // Nothing to report, PG is already taken over by another OSD + checks.push_back(json11::Json::object { + { "target", "MOD" }, + { "key", state_key_base64 }, + { "result", "LESS" }, + { "mod_revision", st_cli.etcd_watch_revision+1 }, + }); continue; } } @@ -851,11 +857,6 @@ void osd_t::report_pg_states() } if (!pg_state_exists) { - if (pg.state == PG_OFFLINE) - { - // Nothing to check or report, PG is already stopped - continue; - } // Check that the PG key does not exist // Failed check indicates an unsuccessful PG lock attempt in this case checks.push_back(json11::Json::object {