From 11b7801bb57cb25cd2d26d58722d49691747725b Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 15 May 2015 13:05:40 -0700 Subject: [PATCH] OSDMonitor: disallow ec pools as tiers Fixes: 11650 Signed-off-by: Samuel Just --- qa/workunits/cephtool/test.sh | 7 +++++++ src/mon/OSDMonitor.cc | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index b6fbabe08bced..dd7823dedd69a 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -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 diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9d3f6e4f744b5..985a52c1b2f27 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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; -- 2.39.5