1
0
mirror of https://github.com/ceph/ceph synced 2025-04-01 23:02:17 +00:00

mon/OSDMonitor: respect crush node flags for can_mark_*()

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-04-12 11:50:22 -05:00
parent 6578ce0539
commit 79f0043208

View File

@ -2454,6 +2454,13 @@ bool OSDMonitor::can_mark_down(int i)
return false;
}
if (osdmap.get_crush_node_flags(i) & CEPH_OSD_NODOWN) {
dout(5) << __func__ << " osd." << i
<< " is marked as nodown via a crush node flag, "
<< "will not mark it down" << dendl;
return false;
}
int num_osds = osdmap.get_num_osds();
if (num_osds == 0) {
dout(5) << __func__ << " no osds" << dendl;
@ -2484,6 +2491,13 @@ bool OSDMonitor::can_mark_up(int i)
return false;
}
if (osdmap.get_crush_node_flags(i) & CEPH_OSD_NOUP) {
dout(5) << __func__ << " osd." << i
<< " is marked as noup via a crush node flag, "
<< "will not mark it up" << dendl;
return false;
}
return true;
}
@ -2504,6 +2518,13 @@ bool OSDMonitor::can_mark_out(int i)
return false;
}
if (osdmap.get_crush_node_flags(i) & CEPH_OSD_NOOUT) {
dout(5) << __func__ << " osd." << i
<< " is marked as noout via a crush node flag, "
<< "will not mark it out" << dendl;
return false;
}
int num_osds = osdmap.get_num_osds();
if (num_osds == 0) {
dout(5) << __func__ << " no osds" << dendl;
@ -2540,6 +2561,13 @@ bool OSDMonitor::can_mark_in(int i)
return false;
}
if (osdmap.get_crush_node_flags(i) & CEPH_OSD_NOIN) {
dout(5) << __func__ << " osd." << i
<< " is marked as noin via a crush node flag, "
<< "will not mark it in" << dendl;
return false;
}
return true;
}