]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: disallow ec pools as tiers
authorSamuel Just <sjust@redhat.com>
Fri, 15 May 2015 20:05:40 +0000 (13:05 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 15 May 2015 20:20:00 +0000 (13:20 -0700)
Fixes: 11650
Signed-off-by: Samuel Just <sjust@redhat.com>
qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc

index b6fbabe08bced627ee1d400a775d4e0ca991f366..dd7823dedd69a9ab10d4ad4cfb5360bf517c0e9a 100755 (executable)
@@ -324,6 +324,13 @@ function test_tiering()
   ceph osd pool delete snap_base snap_base --yes-i-really-really-mean-it
   ceph osd pool delete snap_cache snap_cache --yes-i-really-really-mean-it
 
+  # make sure we can't create an ec pool tier
+  ceph osd pool create eccache 2 2 erasure
+  ceph osd pool create repbase 2
+  expect_false ceph osd tier add repbase eccache
+  ceph osd pool delete repbase repbase --yes-i-really-really-mean-it
+  ceph osd pool delete eccache eccache --yes-i-really-really-mean-it
+
   # convenient add-cache command
   ceph osd pool create cache3 2
   ceph osd tier add-cache slow cache3 1024000
index 9d3f6e4f744b54433ca84475e6874eaf46ce0e09..985a52c1b2f27cb573466dabecde6349ad392a1c 100644 (file)
@@ -6463,6 +6463,12 @@ done:
       err = -ENOTEMPTY;
       goto reply;
     }
+    if (tp->ec_pool()) {
+      ss << "tier pool '" << tierpoolstr
+        << "' is an ec pool, which cannot be a tier";
+      err = -ENOTSUP;
+      goto reply;
+    }
     if (!tp->removed_snaps.empty() || !tp->snaps.empty()) {
       ss << "tier pool '" << tierpoolstr << "' has snapshot state; it cannot be added as a tier without breaking the pool";
       err = -ENOTEMPTY;