From: Loic Dachary Date: Thu, 12 Feb 2015 14:50:21 +0000 (+0100) Subject: erasure-code: mark the shec plugin as experimental X-Git-Tag: v0.93~19^2~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=62dd0c206004bbfec7d863ccbab297b6bdeaa785;p=ceph.git erasure-code: mark the shec plugin as experimental Reject the creation of an erasure code profile including plugin=shec unless --enable-experimental-unrecoverable-data-corrupting-features=shec is set. http://tracker.ceph.com/issues/10800 Fixes: #10800 Signed-off-by: Loic Dachary --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a5c02d04858a..76ff2d994e8a 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -5119,6 +5119,11 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m, goto wait; if (err) goto reply; + } else if (plugin == "shec") { + if (!g_ceph_context->check_experimental_feature_enabled("shec", &ss)) { + err = -EINVAL; + goto reply; + } } dout(20) << "erasure code profile " << name << " set" << dendl; pending_inc.set_erasure_code_profile(name, profile_map); diff --git a/src/test/erasure-code/test-erasure-code.sh b/src/test/erasure-code/test-erasure-code.sh index 04652d02e85a..0409aa6bd248 100755 --- a/src/test/erasure-code/test-erasure-code.sh +++ b/src/test/erasure-code/test-erasure-code.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Copyright (C) 2014 Cloudwatt -# Copyright (C) 2014 Red Hat +# Copyright (C) 2014, 2015 Red Hat # # Author: Loic Dachary # @@ -25,6 +25,7 @@ function run() { export CEPH_MON="127.0.0.1:7101" export CEPH_ARGS CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none " + CEPH_ARGS+="--enable-experimental-unrecoverable-data-corrupting-features=shec " CEPH_ARGS+="--mon-host=$CEPH_MON " setup $dir || return 1 @@ -190,6 +191,25 @@ function TEST_rados_put_get_jerasure() { ./ceph osd erasure-code-profile rm $profile } +function TEST_rados_put_get_shec() { + local dir=$1 + + local poolname=pool-shec + local profile=profile-shec + + ./ceph osd erasure-code-profile set $profile \ + plugin=shec \ + k=2 m=1 c=1 \ + ruleset-failure-domain=osd || return 1 + ./ceph osd pool create $poolname 12 12 erasure $profile \ + || return 1 + + rados_put_get $dir $poolname || return 1 + + delete_pool $poolname + ./ceph osd erasure-code-profile rm $profile +} + function TEST_alignment_constraints() { local payload=ABC echo "$payload" > $dir/ORIGINAL diff --git a/src/test/mon/osd-erasure-code-profile.sh b/src/test/mon/osd-erasure-code-profile.sh index 5b9fc33dc4ea..b16b6640a9c2 100755 --- a/src/test/mon/osd-erasure-code-profile.sh +++ b/src/test/mon/osd-erasure-code-profile.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Copyright (C) 2014 Cloudwatt -# Copyright (C) 2014 Red Hat +# Copyright (C) 2014, 2015 Red Hat # # Author: Loic Dachary # @@ -109,6 +109,17 @@ function SHARE_MON_TEST_get() { grep -q "unknown erasure code profile 'WRONG'" $dir/out || return 1 } +function SHARE_MON_TEST_experimental_shec() { + local dir=$1 + local id=$2 + + local profile=shec-profile + + ! ./ceph osd erasure-code-profile set $profile plugin=shec > $dir/out 2>&1 || return 1 + grep "experimental feature 'shec'" $dir/out || return 1 + ! ./ceph osd erasure-code-profile ls | grep $profile || return 1 +} + function TEST_format_invalid() { local dir=$1