From: John Spray Date: Mon, 1 Jun 2015 12:54:25 +0000 (+0100) Subject: mon: forbid readonly cache tiers for CephFS X-Git-Tag: v9.0.2~42^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11e5faf3c1d4fa28a8b41e3a92f0f684a844e5f5;p=ceph.git mon: forbid readonly cache tiers for CephFS 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 --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 7dc6c92df8d2..3e201d81ff38 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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()) {