]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/: s/is_degraded_object/is_degraded_or_backfilling_object
authorSamuel Just <sjust@redhat.com>
Tue, 17 Feb 2015 18:16:57 +0000 (10:16 -0800)
committerSamuel Just <sjust@redhat.com>
Tue, 17 Feb 2015 23:09:54 +0000 (15:09 -0800)
Currently, this method also returns true if the object is backfilling.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index d41d6e738845790cb3cc780d068ecb1edb611720..6ab9c5d07b0739d92fb7d61dbc7fdd2382d366f8 100644 (file)
@@ -440,7 +440,7 @@ void ReplicatedPG::wait_for_all_missing(OpRequestRef op)
   op->mark_delayed("waiting for all missing");
 }
 
-bool ReplicatedPG::is_degraded_object(const hobject_t& soid)
+bool ReplicatedPG::is_degraded_or_backfilling_object(const hobject_t& soid)
 {
   if (pg_log.get_missing().missing.count(soid))
     return true;
@@ -467,7 +467,7 @@ bool ReplicatedPG::is_degraded_object(const hobject_t& soid)
 
 void ReplicatedPG::wait_for_degraded_object(const hobject_t& soid, OpRequestRef op)
 {
-  assert(is_degraded_object(soid));
+  assert(is_degraded_or_backfilling_object(soid));
 
   // we don't have it (yet).
   if (recovering.count(soid)) {
@@ -1456,7 +1456,7 @@ void ReplicatedPG::do_op(OpRequestRef& op)
   if ((pool.info.ec_pool() ||
        !(get_min_peer_features() & CEPH_FEATURE_OSD_DEGRADED_WRITES)) &&
       write_ordered &&
-      is_degraded_object(head)) {
+      is_degraded_or_backfilling_object(head)) {
     wait_for_degraded_object(head, op);
     return;
   }
@@ -1471,7 +1471,7 @@ void ReplicatedPG::do_op(OpRequestRef& op)
   }
 
   // degraded object?
-  if (write_ordered && is_degraded_object(snapdir)) {
+  if (write_ordered && is_degraded_or_backfilling_object(snapdir)) {
     wait_for_degraded_object(snapdir, op);
     return;
   }
@@ -1563,7 +1563,7 @@ void ReplicatedPG::do_op(OpRequestRef& op)
     // degraded object?  (the check above was for head; this could be a clone)
     if (write_ordered &&
        obc->obs.oi.soid.snap != CEPH_NOSNAP &&
-       is_degraded_object(obc->obs.oi.soid)) {
+       is_degraded_or_backfilling_object(obc->obs.oi.soid)) {
       dout(10) << __func__ << ": clone " << obc->obs.oi.soid
               << " is degraded, waiting" << dendl;
       wait_for_degraded_object(obc->obs.oi.soid, op);
@@ -1667,9 +1667,9 @@ void ReplicatedPG::do_op(OpRequestRef& op)
            dout(1) << " src_oid " << sobc->obs.oi.soid << " != "
                  << obc->obs.oi.soid << dendl;
            osd->reply_op_error(op, -EINVAL);
-         } else if (is_degraded_object(sobc->obs.oi.soid) ||
+         } else if (is_degraded_or_backfilling_object(sobc->obs.oi.soid) ||
                   (check_src_targ(sobc->obs.oi.soid, obc->obs.oi.soid))) {
-           if (is_degraded_object(sobc->obs.oi.soid)) {
+           if (is_degraded_or_backfilling_object(sobc->obs.oi.soid)) {
              wait_for_degraded_object(sobc->obs.oi.soid, op);
            } else {
              waiting_for_degraded_object[sobc->obs.oi.soid].push_back(op);
@@ -5394,7 +5394,7 @@ int ReplicatedPG::_rollback_to(OpContext *ctx, ceph_osd_op& op)
     assert(0 == "unexpected error code in _rollback_to");
   } else { //we got our context, let's use it to do the rollback!
     hobject_t& rollback_to_sobject = rollback_to->obs.oi.soid;
-    if (is_degraded_object(rollback_to_sobject)) {
+    if (is_degraded_or_backfilling_object(rollback_to_sobject)) {
       dout(20) << "_rollback_to attempted to roll back to a degraded object "
               << rollback_to_sobject << " (requested snapid: ) " << snapid << dendl;
       wait_for_degraded_object(rollback_to_sobject, ctx->op);
@@ -7608,7 +7608,7 @@ void ReplicatedPG::issue_repop(RepGather *repop, utime_t now)
     repop->ctx->op);
   repop->ctx->op_t = NULL;
 
-  if (is_degraded_object(soid)) {
+  if (is_degraded_or_backfilling_object(soid)) {
     dout(10) << __func__ << ": " << soid
             << " degraded, maintaining missing sets"
             << dendl;
@@ -7932,7 +7932,7 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch)
   ObjectContextRef obc = watch->get_obc(); // handle_watch_timeout owns this ref
   dout(10) << "handle_watch_timeout obc " << obc << dendl;
 
-  if (is_degraded_object(obc->obs.oi.soid)) {
+  if (is_degraded_or_backfilling_object(obc->obs.oi.soid)) {
     callbacks_for_degraded_object[obc->obs.oi.soid].push_back(
       watch->get_delayed_cb()
       );
@@ -11857,13 +11857,13 @@ void ReplicatedPG::hit_set_persist()
     hobject_t aoid = get_hit_set_archive_object(p->begin, p->end);
 
     // Once we hit a degraded object just skip further trim
-    if (is_degraded_object(aoid))
+    if (is_degraded_or_backfilling_object(aoid))
       return;
   }
 
   oid = get_hit_set_archive_object(start, now);
   // If the current object is degraded we skip this persist request
-  if (is_degraded_object(oid))
+  if (is_degraded_or_backfilling_object(oid))
     return;
 
   // If backfill is in progress and we could possibly overlap with the
@@ -12014,7 +12014,7 @@ void ReplicatedPG::hit_set_trim(RepGather *repop, unsigned max)
     assert(p != updated_hit_set_hist.history.end());
     hobject_t oid = get_hit_set_archive_object(p->begin, p->end);
 
-    assert(!is_degraded_object(oid));
+    assert(!is_degraded_or_backfilling_object(oid));
 
     dout(20) << __func__ << " removing " << oid << dendl;
     ++repop->ctx->at_version.version;
@@ -12164,7 +12164,7 @@ bool ReplicatedPG::agent_work(int start_max)
       osd->logger->inc(l_osd_agent_skip);
       continue;
     }
-    if (is_degraded_object(*p)) {
+    if (is_degraded_or_backfilling_object(*p)) {
       dout(20) << __func__ << " skip (degraded) " << *p << dendl;
       osd->logger->inc(l_osd_agent_skip);
       continue;
index f02c287e56fc40d21033305e1b75d268f7579956..50190a7fd0b7c91d35a02f73054f5a4ec02e866a 100644 (file)
@@ -1510,7 +1510,7 @@ public:
   void wait_for_unreadable_object(const hobject_t& oid, OpRequestRef op);
   void wait_for_all_missing(OpRequestRef op);
 
-  bool is_degraded_object(const hobject_t& oid);
+  bool is_degraded_or_backfilling_object(const hobject_t& oid);
   void wait_for_degraded_object(const hobject_t& oid, OpRequestRef op);
 
   bool maybe_await_blocked_snapset(const hobject_t &soid, OpRequestRef op);