]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: only calculate op crush mapping if we don't have the PG 6371/head
authorSage Weil <sage@redhat.com>
Sat, 24 Oct 2015 22:01:06 +0000 (18:01 -0400)
committerSage Weil <sage@redhat.com>
Sat, 24 Oct 2015 22:01:06 +0000 (18:01 -0400)
We were pessimistically calculating the request mapping to ensure
that it is really meant for us before looking up the PG.  Instead,
look up the PG, and queue it there if we have it--the PG already
does the necessary checks in PG::can_discard_op().  If we
don't have the PG, *then* do the crush mapping and extra checks.

Reported-by: Somnath Roy <somnath.roy@sandisk.com>
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index a8c9588c45bc92aed7bbacd1f16a99dde44d7b41..f242898c17410bdfc5ac6d44b5117aced48d9f44 100644 (file)
@@ -8123,6 +8123,17 @@ void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)
     return;
   }
 
+  PG *pg = get_pg_or_queue_for_pg(pgid, op);
+  if (pg) {
+    op->send_map_update = share_map.should_send;
+    op->sent_epoch = m->get_map_epoch();
+    enqueue_op(pg, op);
+    share_map.should_send = false;
+    return;
+  }
+
+  // ok, we didn't have the PG.  let's see if it's our fault or the client's.
+
   OSDMapRef send_map = service.try_get_map(m->get_map_epoch());
   // check send epoch
   if (!send_map) {
@@ -8162,14 +8173,6 @@ void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)
            << dendl;
     return;
   }
-
-  PG *pg = get_pg_or_queue_for_pg(pgid, op);
-  if (pg) {
-    op->send_map_update = share_map.should_send;
-    op->sent_epoch = m->get_map_epoch();
-    enqueue_op(pg, op);
-    share_map.should_send = false;
-  }
 }
 
 template<typename T, int MSGTYPE>