]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: bypass readonly ops when osd full. 14181/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 5 May 2016 15:07:06 +0000 (23:07 +0800)
committerNing Yao <yaoning@unitedstack.com>
Tue, 28 Mar 2017 07:24:42 +0000 (07:24 +0000)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit e2a0ae8e88e6b7354b14adb503fd8ba8525bee39)
See: http://tracker.ceph.com/issues/19394

Signed-off-by: yaoning <yaoning@unitedstack.com>
src/osd/ReplicatedPG.cc

index dcc9860bc8c7a5da196ed8265a023b3021255033..e0d0ac7bd4131581da32fc85da0530f7e4fbfe9f 100644 (file)
@@ -1675,20 +1675,27 @@ void ReplicatedPG::do_op(OpRequestRef& op)
     return;
   }
 
+  // order this op as a write?
+  bool write_ordered =
+    op->may_write() ||
+    op->may_cache() ||
+    m->has_flag(CEPH_OSD_FLAG_RWORDERED);
+
   // discard due to cluster full transition?  (we discard any op that
   // originates before the cluster or pool is marked full; the client
   // will resend after the full flag is removed or if they expect the
   // op to succeed despite being full).  The except is FULL_FORCE ops,
   // which there is no reason to discard because they bypass all full
   // checks anyway.
+  // If this op isn't write or read-ordered, we skip
   // FIXME: we exclude mds writes for now.
-  if (!(m->get_source().is_mds() || m->has_flag(CEPH_OSD_FLAG_FULL_FORCE)) &&
+  if (write_ordered && !( m->get_source().is_mds() || m->has_flag(CEPH_OSD_FLAG_FULL_FORCE)) &&
       info.history.last_epoch_marked_full > m->get_map_epoch()) {
     dout(10) << __func__ << " discarding op sent before full " << m << " "
             << *m << dendl;
     return;
   }
-  if (!m->get_source().is_mds() && osd->check_failsafe_full()) {
+  if (!(m->get_source().is_mds()) && osd->check_failsafe_full() && write_ordered) {
     dout(10) << __func__ << " fail-safe full check failed, dropping request"
             << dendl;
     return;
@@ -1719,12 +1726,6 @@ void ReplicatedPG::do_op(OpRequestRef& op)
     }
   }
 
-  // order this op as a write?
-  bool write_ordered =
-    op->may_write() ||
-    op->may_cache() ||
-    m->has_flag(CEPH_OSD_FLAG_RWORDERED);
-
   dout(10) << "do_op " << *m
           << (op->may_write() ? " may_write" : "")
           << (op->may_read() ? " may_read" : "")