]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: disallow ec pools as tiers 5389/head
authorSamuel Just <sjust@redhat.com>
Fri, 15 May 2015 20:05:40 +0000 (13:05 -0700)
committerNathan Cutler <ncutler@suse.com>
Tue, 28 Jul 2015 19:01:23 +0000 (21:01 +0200)
Fixes: 11650
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 11b7801bb57cb25cd2d26d58722d49691747725b)

Conflicts:
qa/workunits/cephtool/test.sh
           no "# make sure we can't clobber snapshot state" tests in firefly
src/mon/OSDMonitor.cc
           no tp->removed_snaps.empty() in firefly

qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc

index efe7c12d1ad6fec02079cd2d66ce82f33d6d9985..5fd6a188c8b4503f0c02eecaf00b4415ddaf09e1 100755 (executable)
@@ -187,6 +187,13 @@ function test_tiering()
   ceph osd pool delete cache cache --yes-i-really-really-mean-it
   ceph osd pool delete cache2 cache2 --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 data cache3 1024000
index 9fac2c9aec53c798644ca6a08ad63741c58cbdd5..b65cbc5131a22477d9ae7344f8f5e5d96fee93e9 100644 (file)
@@ -5313,6 +5313,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;
+    }
     // go
     pg_pool_t *np = pending_inc.get_new_pool(pool_id, p);
     pg_pool_t *ntp = pending_inc.get_new_pool(tierpool_id, tp);