]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: verify that client ops are targeted correctly in the current epoch 1839/head
authorGreg Farnum <greg@inktank.com>
Mon, 12 May 2014 23:37:16 +0000 (16:37 -0700)
committerGreg Farnum <greg@inktank.com>
Tue, 13 May 2014 00:22:12 +0000 (17:22 -0700)
We were previously only looking at the epoch the op was sent in, which meant
that if we had dropped responsibility somewhere between send_epoch and our
current epoch, we would queue up the op until a new osdmap came along. If it
never did, we could block all client IO against us...

Fixes: #8338
Signed-off-by: Greg Farnum <greg@inktank.com>
src/osd/OSD.cc

index 220eac652723e8ee5e3968b27b6cfe41257afa59..143d992048d1715b9f2bbba1dd32bdc61adf342b 100644 (file)
@@ -7857,6 +7857,13 @@ void OSD::handle_op(OpRequestRef op, OSDMapRef osdmap)
     return;
   }
 
+  // check against current map too
+  if (!osdmap->have_pg_pool(pgid.pool()) ||
+      osdmap->get_pg_acting_role(pgid.pgid, whoami) < 0) {
+    dout(7) << "dropping; no longer have PG (or pool); client will retarget" << dendl;
+    return;
+  }
+
   PG *pg = get_pg_or_queue_for_pg(pgid, op);
   if (pg) {
     op->send_map_update = share_map.should_send;