]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: forbid readonly cache tiers for CephFS
authorJohn Spray <john.spray@redhat.com>
Mon, 1 Jun 2015 12:54:25 +0000 (13:54 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 1 Jun 2015 13:16:15 +0000 (14:16 +0100)
For EC pools, we need a tier that is not just forwarding
writes, in order to provide the ops required
by CephFS.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mon/MDSMonitor.cc

index 7dc6c92df8d26cf67ff7a88cc4e55492c82f6cfd..3e201d81ff38d575404b8a2058a6cc7bfbf93d6b 100644 (file)
@@ -1124,6 +1124,21 @@ int MDSMonitor::_check_pool(
          << " is an erasure-code pool";
       return -EINVAL;
     }
+
+    // That cache tier overlay must be writeback, not readonly (it's the
+    // write operations like modify+truncate we care about support for)
+    const pg_pool_t *write_tier = mon->osdmon()->osdmap.get_pg_pool(
+        pool->write_tier);
+    assert(write_tier != NULL);  // OSDMonitor shouldn't allow DNE tier
+    if (write_tier->cache_mode == pg_pool_t::CACHEMODE_FORWARD
+        || write_tier->cache_mode == pg_pool_t::CACHEMODE_READONLY) {
+      *ss << "EC pool '" << pool_name << "' has a write tier ("
+          << mon->osdmon()->osdmap.get_pool_name(pool->write_tier)
+          << ") that is configured "
+             "to forward writes.  Use a cache mode such as 'writeback' for "
+             "CephFS";
+      return -EINVAL;
+    }
   }
 
   if (pool->is_tier()) {