Skip to content

Commit

Permalink
mon/OSDMonitor: fix NEW flag adjustment in destroy[-new]
Browse files Browse the repository at this point in the history
Only set the NEW flag if it isn't already set.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 13393f6)
  • Loading branch information
liewegas committed Jul 26, 2018
1 parent f1d0cdd commit 223aa4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mon/OSDMonitor.cc
Expand Up @@ -7774,7 +7774,10 @@ int OSDMonitor::prepare_command_osd_new(
assert(id >= 0);
assert(osdmap.is_destroyed(id));
pending_inc.new_weight[id] = CEPH_OSD_OUT;
pending_inc.new_state[id] |= CEPH_OSD_DESTROYED | CEPH_OSD_NEW;
pending_inc.new_state[id] |= CEPH_OSD_DESTROYED;
if ((osdmap.get_state(id) & CEPH_OSD_NEW) == 0) {
pending_inc.new_state[id] |= 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
Expand Down

0 comments on commit 223aa4d

Please sign in to comment.