]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: do not flush omap objects to an EC base pool
authorSage Weil <sage@inktank.com>
Sat, 8 Feb 2014 02:05:04 +0000 (18:05 -0800)
committerSage Weil <sage@inktank.com>
Sun, 16 Feb 2014 06:09:39 +0000 (22:09 -0800)
The EC pool does not support omap content.  If the caching/tiering agent
encounters such an object, just skip it.  Use the OMAP object_info_t flag
for this.

Although legacy pools will have objects with omap that do not have this
flag set, no *cache* pools yet exist, so we do not need to worry about the
agent running across legacy content.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc

index 30ccea276b70448eddaf86fe27cb4a85082f4621..7a9edd25da197c95f1526bf0717a68eb24ee4992 100644 (file)
@@ -10238,6 +10238,9 @@ void ReplicatedPG::agent_work(int start_max)
           << ", pos " << agent_state->position
           << dendl;
 
+  const pg_pool_t *base_pool = get_osdmap()->get_pg_pool(pool.info.tier_of);
+  assert(base_pool);
+
   int ls_min = 1;
   int ls_max = 10; // FIXME?
 
@@ -10281,6 +10284,13 @@ void ReplicatedPG::agent_work(int start_max)
       continue;
     }
 
+    // be careful flushing omap to an EC pool.
+    if (base_pool->is_erasure() &&
+       obc->obs.oi.test_flag(object_info_t::FLAG_OMAP)) {
+      dout(20) << __func__ << " skip (omap to EC) " << obc->obs.oi << dendl;
+      continue;
+    }
+
     if (agent_state->flush_mode != TierAgentState::FLUSH_MODE_IDLE &&
        agent_maybe_flush(obc))
       ++started;