From: Sage Weil Date: Fri, 25 Jul 2014 21:48:10 +0000 (-0700) Subject: osd/ReplicatedPG: requeue cache full waiters if no longer writeback X-Git-Tag: v0.84~48^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8fb761b660c268e2264d375a4db2f659a5c3a107;p=ceph.git osd/ReplicatedPG: requeue cache full waiters if no longer writeback 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index d38d7e13cf77..2d7f8d01d94b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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(); }