]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: create default profile if necessary 1990/head
authorLoic Dachary <loic@dachary.org>
Wed, 18 Jun 2014 22:49:13 +0000 (00:49 +0200)
committerLoic Dachary <loic@dachary.org>
Wed, 30 Jul 2014 17:12:20 +0000 (23:12 +0600)
commit4e1405e7720eda71a872c991045ac8ead6f3e7d8
tree13462219da14fb33af22239c9175b46a57f5fe04
parent3cfda577b15039cb5c678b79bef3e561df826ed1
erasure-code: create default profile if necessary

After an upgrade to firefly, the existing Ceph clusters do not have the
default erasure code profile. Although it may be created with

   ceph osd erasure-code-profile set default

it was not included in the release notes and is confusing for the
administrator.

The *osd pool create* and *osd crush rule create-erasure* commands are
modified to implicitly create the default erasure code profile if it is
not found.

In order to avoid code duplication, the default erasure code profile
code creation that happens when a new firefly ceph cluster is created is
encapsulated in the OSDMap::get_erasure_code_profile_default method.

Conversely, handling the pending change in OSDMonitor is not
encapsulated in a function but duplicated instead. If it was a function
the caller would need a switch to distinguish between the case when goto
wait is needed, or goto reply or proceed because nothing needs to be
done. It is unclear if having a function would lead to smaller or more
maintainable code.

http://tracker.ceph.com/issues/8601 Fixes: #8601

Backport: firefly
Signed-off-by: Loic Dachary <loic@dachary.org>
src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/test/mon/osd-crush.sh
src/test/mon/osd-pool-create.sh