]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: requeue cache full waiters if no longer writeback
authorSage Weil <sage@redhat.com>
Fri, 25 Jul 2014 21:48:10 +0000 (14:48 -0700)
committerSage Weil <sage@redhat.com>
Sat, 2 Aug 2014 00:06:47 +0000 (17:06 -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>
(cherry picked from commit 8fb761b660c268e2264d375a4db2f659a5c3a107)

src/osd/ReplicatedPG.cc

index 4e342e92e63223b9283b44307f6ce4b5b6419fd5..b5dc110c9595ed47ef40f9d1fcc84731889eb1ec 100644 (file)
@@ -9473,6 +9473,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();
 }