]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crush: update device classes where relevant
authorLoic Dachary <ldachary@redhat.com>
Sat, 18 Feb 2017 22:42:59 +0000 (23:42 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 1 Mar 2017 16:24:09 +0000 (17:24 +0100)
commitf9eb20694387437bce7b27e17868fbe17ec5c18a
treea559266a48a0d9f171c07c50b44d5b3fb1a5aa6f
parent57e66c6f2d313a22fa5fb5bdd06cdcc5eaaff2ea
crush: update device classes where relevant

The device classes are implemented by modifying:

- the argument of step TAKE in rules
- cloning bucket trees when required by a rule step

This happens (via populate_classes):

- before compiling a rule step TAKE

When the crush map is encoded, the device class information is stored
with it, independently from the rules and the buckets, as a map of
classes for each device & bucket and a map of classes for each rule step
TAKE.

The extra buckets created but not used by any rule do not need to be
preserved and they are removed (via cleanup_classes):

- before decompilation
- after compilation
- after decoding

The client and daemons that are not aware of the device classes are
compatible because the crushmap modified with the new buckets is fully
functional. The invalid names used in the for the generated
buckets (bucket~class) can be CrushWrapper::decode by any existing
client because there is no verification of the name validity during
decoding. It can also be CrushWrapper::dump or CrushCompiler::decompile
via ceph osd dump or crushtool. It cannot, however, be compiled again
because CrushCompiler::compile will try to set the name with
CrushWrapper::set_item_name and it will fail with EINVAL because of the
~.

Fixes: http://tracker.ceph.com/issues/18943
Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/crush/CrushCompiler.cc
src/crush/CrushWrapper.cc