mirror of
https://github.com/ceph/ceph
synced 2025-02-20 17:37:29 +00:00
crush: rebuild shadow tree on "crush create-or-move/move"
This patch solves the problem below: ./bin/ceph osd crush move osd.0 root=foo rack=foo-rack host=foo-host moved item id 0 name 'osd.0' to location {host=foo-host,rack=foo-rack,root=foo} in crush map ./bin/ceph osd crush rule create-replicated foo-rule foo host ssd Error EINVAL: root foo has no devices with class ssd Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
parent
10bf2a633f
commit
f3a3180cca
@ -162,6 +162,8 @@ function TEST_mon_classes() {
|
||||
if [ "$out" == "" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
ceph osd crush rule create-replicated foo-rule foo host abc || return 1
|
||||
}
|
||||
|
||||
main crush-classes "$@"
|
||||
|
@ -953,6 +953,12 @@ int CrushWrapper::insert_item(
|
||||
ldout(cct, 5) << "insert_item max_devices now " << crush->max_devices
|
||||
<< dendl;
|
||||
}
|
||||
r = rebuild_roots_with_classes();
|
||||
if (r < 0) {
|
||||
ldout(cct, 0) << __func__ << " unable to rebuild roots with classes: "
|
||||
<< cpp_strerror(r) << dendl;
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user