]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: allow addition of cache pool with non-empty snaps with config 5251/head
authorSamuel Just <sjust@redhat.com>
Tue, 7 Jul 2015 18:43:01 +0000 (11:43 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 9 Jul 2015 20:56:29 +0000 (13:56 -0700)
We need to be able to allow the version of ceph_test_* from earlier
versions of ceph to continue to work.  This patch also adjusts the
work unit to use a single rados snap to test the condition without
--force-nonempty to ensure that we don't need to be careful about
the config value when running that script.

Signed-off-by: Samuel Just <sjust@redhat.com>
qa/workunits/cephtool/test.sh
src/common/config_opts.h
src/mon/OSDMonitor.cc

index 07b9eedffa5712c7c3a4b5f63713a3fe95c34df9..4a93f5f80ea7520daa1175c9849c3d881b9e33c8 100755 (executable)
@@ -302,10 +302,8 @@ function test_tiering()
   # make sure we can't clobber snapshot state
   ceph osd pool create snap_base 2
   ceph osd pool create snap_cache 2
-  rbd -p snap_cache create foo --size 10
-  rbd -p snap_cache snap create foo --snap snap1
-  rbd -p snap_cache snap rm foo --snap snap1
-  expect_false ceph osd tier add snap_base snap_cache --force-nonempty
+  ceph osd pool mksnap snap_cache snapname
+  expect_false ceph osd tier add snap_base snap_cache
   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
 
index d762a2c9de3667b63dd1d0a1cb27718c0eeb53be..15ad25f62bf6e5f91ae72b8a0425aee99632336e 100644 (file)
@@ -266,6 +266,10 @@ OPTION(mon_sync_provider_kill_at, OPT_INT, 0)  // kill the sync provider at a sp
 OPTION(mon_sync_requester_kill_at, OPT_INT, 0) // kill the sync requester at a specific point in the work flow
 OPTION(mon_force_quorum_join, OPT_BOOL, false) // force monitor to join quorum even if it has been previously removed from the map
 OPTION(mon_keyvaluedb, OPT_STR, "leveldb")   // type of keyvaluedb backend
+
+// UNSAFE -- TESTING ONLY! Allows addition of a cache tier with preexisting snaps
+OPTION(mon_debug_unsafe_allow_tier_with_nonempty_snaps, OPT_BOOL, false)
+
 OPTION(paxos_stash_full_interval, OPT_INT, 25)   // how often (in commits) to stash a full copy of the PaxosService state
 OPTION(paxos_max_join_drift, OPT_INT, 10) // max paxos iterations before we must first sync the monitor stores
 OPTION(paxos_propose_interval, OPT_DOUBLE, 1.0)  // gather updates for this long before proposing a map update
index b432adb60d8d4f63102cda10778f62f80ba1e05d..3d0e5d25cba67820f4ba199b56d3c0746b7e6d35 100644 (file)
@@ -6497,7 +6497,9 @@ done:
       err = -ENOTSUP;
       goto reply;
     }
-    if (!tp->removed_snaps.empty() || !tp->snaps.empty()) {
+    if ((!tp->removed_snaps.empty() || !tp->snaps.empty()) &&
+       ((force_nonempty != "--force-nonempty") ||
+        (!g_conf->mon_debug_unsafe_allow_tier_with_nonempty_snaps))) {
       ss << "tier pool '" << tierpoolstr << "' has snapshot state; it cannot be added as a tier without breaking the pool";
       err = -ENOTEMPTY;
       goto reply;