]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: create default profile if necessary 2178/head
authorLoic Dachary <loic@dachary.org>
Wed, 18 Jun 2014 22:49:13 +0000 (00:49 +0200)
committerLoic Dachary <loic@dachary.org>
Thu, 31 Jul 2014 12:47:06 +0000 (18:32 +0545)
commitb6d8feab85fda97bf3a68980249a71846778a157
tree1ece3a4c2bb34b3bd06eb47165151ce18c68a1ea
parent2fff5f031b2cc00b55bd1ada4f83e4838fe59ddd
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>
(cherry picked from commit 4e1405e7720eda71a872c991045ac8ead6f3e7d8)
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