Skip to content

Commit

Permalink
OSDMonitor: disallow ec pools as tiers
Browse files Browse the repository at this point in the history
Fixes: 11650
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 11b7801)
  • Loading branch information
athanatos authored and liewegas committed Jun 15, 2015
1 parent 13c8d58 commit f68bf94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qa/workunits/cephtool/test.sh
Expand Up @@ -325,6 +325,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
Expand Down
6 changes: 6 additions & 0 deletions src/mon/OSDMonitor.cc
Expand Up @@ -6112,6 +6112,12 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
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;
Expand Down

0 comments on commit f68bf94

Please sign in to comment.