]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: ensure UP is not set for newly-created OSDs 16534/head
authorSage Weil <sage@redhat.com>
Mon, 24 Jul 2017 14:08:56 +0000 (10:08 -0400)
committerSage Weil <sage@redhat.com>
Mon, 24 Jul 2017 14:08:56 +0000 (10:08 -0400)
Due to http://tracker.ceph.com/issues/20751 it is possible for the UP
state bit to be set for OSDs without EXISTS.  Make sure it is cleared as
needed when the OSD id is reused.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index 9ab39128cb2999b4186fe2eb5761a8a3a9189527..5dacd744f9508156965c072966f2e8c01c1d36ca 100644 (file)
@@ -6967,6 +6967,12 @@ int OSDMonitor::prepare_command_osd_new(
     assert(osdmap.is_destroyed(id));
     pending_inc.new_weight[id] = CEPH_OSD_OUT;
     pending_inc.new_state[id] |= CEPH_OSD_DESTROYED | CEPH_OSD_NEW;
+    if (osdmap.get_state(id) & CEPH_OSD_UP) {
+      // due to http://tracker.ceph.com/issues/20751 some clusters may
+      // have UP set for non-existent OSDs; make sure it is cleared
+      // for a newly created osd.
+      pending_inc.new_state[id] |= CEPH_OSD_UP;
+    }
     pending_inc.new_uuid[id] = uuid;
   } else {
     assert(id >= 0);