]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: newly created osd should not be wrongly marked in 11795/head
authorrunsisi <runsisi@zte.com.cn>
Sat, 5 Nov 2016 10:33:08 +0000 (18:33 +0800)
committerrunsisi <runsisi@zte.com.cn>
Sat, 5 Nov 2016 12:42:43 +0000 (20:42 +0800)
if we are creating an osd which has the same id as a previously
removed 'in' osd, we should not mark this newly created osd as 'in'

Signed-off-by: runsisi <runsisi@zte.com.cn>
src/mon/OSDMonitor.cc

index 972a60cf2529d5b3a1d589f41b643083bd6f89af..ac361f6003ad9144fe9191f30f5d565b14f75996 100644 (file)
@@ -6933,8 +6933,10 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       if (!osdmap.exists(i) &&
          pending_inc.new_up_client.count(i) == 0 &&
          (pending_inc.new_state.count(i) == 0 ||
-          (pending_inc.new_state[i] & CEPH_OSD_EXISTS) == 0))
+          (pending_inc.new_state[i] & CEPH_OSD_EXISTS) == 0)) {
+        pending_inc.new_weight[i] = CEPH_OSD_OUT;
        goto done;
+      }
     }
 
     // raise max_osd