summaryrefslogtreecommitdiff
path: root/src/mon/OSDMonitor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mon/OSDMonitor.cc')
-rw-r--r--src/mon/OSDMonitor.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 39e3fe9bbe0..338b5195af2 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -926,7 +926,8 @@ bool OSDMonitor::check_failure(utime_t now, int target_osd, failure_info_t& fi)
<< dendl;
// already pending failure?
- if (pending_inc.new_state[target_osd] & CEPH_OSD_UP) {
+ if (pending_inc.new_state.count(target_osd) &&
+ pending_inc.new_state[target_osd] & CEPH_OSD_UP) {
dout(10) << " already pending failure" << dendl;
return true;
}
@@ -3174,6 +3175,8 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
done:
dout(10) << " creating osd." << i << dendl;
+ if (pending_inc.new_state.count(i) == 0)
+ pending_inc.new_state[i] = 0;
pending_inc.new_state[i] |= CEPH_OSD_EXISTS | CEPH_OSD_NEW;
if (!uuid.is_zero())
pending_inc.new_uuid[i] = uuid;