From: Sage Weil Date: Tue, 20 Feb 2018 21:49:46 +0000 (-0600) Subject: osd: update numpg_* counters when removing a pg X-Git-Tag: v13.1.0~390^2~48 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf503610665089a80cb463a81f8f92834eaf7c56;p=ceph.git osd: update numpg_* counters when removing a pg Usually on a pg create we see an OSDMap update; on PG removal completion we may not. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 52b30975f602..6b95be762f46 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1617,6 +1617,14 @@ void OSDService::queue_for_pg_delete(spg_t pgid, epoch_t e) void OSDService::finish_pg_delete(PG *pg, unsigned old_pg_num) { + // update pg count now since we might not get an osdmap any time soon. + if (pg->is_primary()) + logger->dec(l_osd_pg_primary); + else if (pg->is_replica()) + logger->dec(l_osd_pg_replica); + else + logger->dec(l_osd_pg_stray); + osd->unregister_pg(pg); for (auto shard : osd->shards) { shard->unprime_split_children(pg->pg_id, old_pg_num);