From 278186d750cf223193159b9d0a03c491b8be746e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 29 Apr 2013 11:11:24 -0700 Subject: [PATCH] mon: only map/send pg creations if osdmap is defined This avoids calculating new pg creation mappings if the osdmap isn't loaded yet, which currently happens when during Monitor::paxos_init() on startup. Assuming osdmap epoch is nonzero, it should always be safe to do this (although possibly unnecessary). More cleanup here is certainly possible, but this is one step toward fixing the bad behavior for #4675. Signed-off-by: Sage Weil --- src/mon/PGMonitor.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 5f325b9846c67..772b2a435a479 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -212,8 +212,10 @@ void PGMonitor::update_from_paxos() update_trim(); - map_pg_creates(); - send_pg_creates(); + if (mon->osdmon()->osdmap.get_epoch()) { + map_pg_creates(); + send_pg_creates(); + } update_logger(); } @@ -665,8 +667,10 @@ void PGMonitor::check_osd_map(epoch_t epoch) if (propose) propose_pending(); - map_pg_creates(); - send_pg_creates(); + if (mon->osdmon()->osdmap.get_epoch()) { + map_pg_creates(); + send_pg_creates(); + } } void PGMonitor::register_pg(pg_pool_t& pool, pg_t pgid, epoch_t epoch, bool new_pool) -- 2.39.5