Only set the NEW flag if it isn't already set.
Signed-off-by: Sage Weil <sage@redhat.com>
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