summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-04-29 11:11:24 -0700
committerSage Weil <sage@inktank.com>2013-04-29 11:11:24 -0700
commit278186d750cf223193159b9d0a03c491b8be746e (patch)
tree3945490d5b9d28adf13e3b84c90ea6131ddf86a2
parent28d495a37157faaefe699f1de5e1675a914f7118 (diff)
downloadceph-278186d750cf223193159b9d0a03c491b8be746e.tar.gz
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 <sage@inktank.com>
-rw-r--r--src/mon/PGMonitor.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc
index 5f325b9846c..772b2a435a4 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)