]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: mark the shec plugin as experimental 3720/head
authorLoic Dachary <ldachary@redhat.com>
Thu, 12 Feb 2015 14:50:21 +0000 (15:50 +0100)
committerLoic Dachary <ldachary@redhat.com>
Fri, 13 Feb 2015 16:09:37 +0000 (17:09 +0100)
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 <ldachary@redhat.com>
src/mon/OSDMonitor.cc
src/test/erasure-code/test-erasure-code.sh
src/test/mon/osd-erasure-code-profile.sh

index a5c02d04858a9cd2f6e513e2c1eec8d5405706c5..76ff2d994e8a553b46ae8403a2b66b8601275509 100644 (file)
@@ -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);
index 04652d02e85a90cd806a34837ac32046a129e43d..0409aa6bd248d0ea01ba55c7b2a2ded0f677222f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
-# Copyright (C) 2014 Red Hat <contact@redhat.com>
+# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -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
index 5b9fc33dc4eac1c39ddfe02c1de387d95c456664..b16b6640a9c2608c74fd067ae8fc6a5920e90c16 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
-# Copyright (C) 2014 Red Hat <contact@redhat.com>
+# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -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