]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: requeue cache full waiters if no longer writeback 2147/head
authorSage Weil <sage@redhat.com>
Fri, 25 Jul 2014 21:48:10 +0000 (14:48 -0700)
committerSage Weil <sage@redhat.com>
Fri, 25 Jul 2014 21:50:52 +0000 (14:50 -0700)
If the cache is full, we block some requests, and then we change the
cache_mode to something else (say, forward), the full waiters don't get
requeued until the cache becomes un-full.  In the meantime, however, later
requests will get processed and redirected, breaking the op ordering.

Fix this by requeueing any full waiters if we see that the cache_mode is
not writeback.

Fixes: #8931
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc

index d38d7e13cf771b6fdbc1a6b162d95aade0ea9602..2d7f8d01d94bdfc8d817f64291e5dc502f166dc7 100644 (file)
@@ -9507,6 +9507,17 @@ void ReplicatedPG::on_role_change()
 void ReplicatedPG::on_pool_change()
 {
   dout(10) << __func__ << dendl;
+  // requeue cache full waiters just in case the cache_mode is
+  // changing away from writeback mode.  note that if we are not
+  // active the normal requeuing machinery is sufficient (and properly
+  // ordered).
+  if (is_active() &&
+      pool.info.cache_mode != pg_pool_t::CACHEMODE_WRITEBACK &&
+      !waiting_for_cache_not_full.empty()) {
+    dout(10) << __func__ << " requeuing full waiters (not in writeback) "
+            << dendl;
+    requeue_ops(waiting_for_cache_not_full);
+  }
   hit_set_setup();
   agent_setup();
 }