]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: normalize erasure-code profile for storage and comparison
authorLoic Dachary <ldachary@redhat.com>
Sun, 17 May 2015 21:53:42 +0000 (23:53 +0200)
committerLoic Dachary <ldachary@redhat.com>
Mon, 1 Jun 2015 19:52:14 +0000 (21:52 +0200)
commit8e61a99d0d1bc53277bbe12720f27755eba82025
treec2df8501967365d1fbfae40778b87effd4c80697
parent77e5330da193a1a05e1daf73a8a07aa692f2c6bb
mon: normalize erasure-code profile for storage and comparison

An erasure-code profile set by the user may be modified by the erasure
code plugin, most of the time to add default values for domain failure,
techniques etc.

Whenever the monitor gets an erasure code profile from the user or the
configuration file, it uses it to initialize the corresponding erasure
code plugin and:

 * validate the profile and get an error if it is invalid

 * get a normalized profile

The normalized profile is stored in the OSDMap. Should the user try
to set the same erasure code profile with the different values that lead
to the same normalized form, the modification will be accepted as a
noop, as if the same values were given. For instance:

   ceph osd erasure-code-profile set myprofile k=2

   ceph osd erasure-code-profile set myprofile k=2 m=1

are the same because the default value for m is 1 for the default
jerasure plugin.

If the normalized form is not used for storage and comparison, the
second call with m=1 will fail and require --force to override
myprofile, although the user can read from the documentation that it
matches the default value.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h
src/test/mon/osd-crush.sh