From cfdb569ab291109f38712bccb1e8340f16cc4cd9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 9 Dec 2019 10:44:55 -0600 Subject: [PATCH] osd: use spg_t for pending_creates_from_osd Signed-off-by: Sage Weil --- src/osd/OSD.cc | 8 ++++---- src/osd/OSD.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 9f332d3b609..4770ef7e601 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4869,7 +4869,7 @@ bool OSD::maybe_wait_for_max_pg(const OSDMapRef& osdmap, pending_creates_from_mon++; } else { bool is_primary = osdmap->get_pg_acting_rank(pgid.pgid, whoami) == 0; - pending_creates_from_osd.emplace(pgid.pgid, is_primary); + pending_creates_from_osd.emplace(pgid, is_primary); } dout(1) << __func__ << " withhold creation of pg " << pgid << ": " << num_pgs << " >= "<< max_pgs_per_osd << dendl; @@ -4918,8 +4918,8 @@ void OSD::resume_creating_pg() while (spare_pgs > 0 && pg != pending_creates_from_osd.cend()) { dout(20) << __func__ << " pg " << pg->first << dendl; vector acting; - osdmap->pg_to_up_acting_osds(pg->first, nullptr, nullptr, &acting, nullptr); - service.queue_want_pg_temp(pg->first, twiddle(acting), true); + osdmap->pg_to_up_acting_osds(pg->first.pgid, nullptr, nullptr, &acting, nullptr); + service.queue_want_pg_temp(pg->first.pgid, twiddle(acting), true); pg = pending_creates_from_osd.erase(pg); do_sub_pg_creates = true; spare_pgs--; @@ -8725,7 +8725,7 @@ void OSD::consume_map() std::lock_guard l(pending_creates_lock); for (auto pg = pending_creates_from_osd.begin(); pg != pending_creates_from_osd.end();) { - if (osdmap->get_pg_acting_rank(pg->first, whoami) < 0) { + if (osdmap->get_pg_acting_rank(pg->first.pgid, whoami) < 0) { dout(10) << __func__ << " pg " << pg->first << " doesn't map here, " << "discarding pending_create_from_osd" << dendl; pg = pending_creates_from_osd.erase(pg); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 58ef72b7343..21c6e92e36f 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1766,7 +1766,7 @@ protected: std::atomic num_pgs = {0}; std::mutex pending_creates_lock; - using create_from_osd_t = std::pair; + using create_from_osd_t = std::pair; std::set pending_creates_from_osd; unsigned pending_creates_from_mon = 0; -- 2.39.5