]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: force op resend when pool overlay changes
authorSage Weil <sage@inktank.com>
Thu, 8 May 2014 17:42:42 +0000 (10:42 -0700)
committerSage Weil <sage@inktank.com>
Sat, 10 May 2014 16:12:26 +0000 (09:12 -0700)
If a client is sending a sequence of ops (say, a, b, c, d) and partway
through that sequence it receives an OSDMap update that changes the
overlay, the ops will get send to different pools, and the replies will
come back completely out of order.

To fix this, force a resend of all outstanding ops any time the overlay
changes.

Fixes: #8305
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/OSDMonitor.cc

index af93d0714c8f4b66b1d90bb6642cb27f5513d857..6785f904d5eb78a35378ba5b5cfbd826c4ca377e 100644 (file)
@@ -5077,8 +5077,10 @@ done:
       goto reply;
     }
     // go
-    pending_inc.get_new_pool(pool_id, p)->read_tier = overlaypool_id;
-    pending_inc.get_new_pool(pool_id, p)->write_tier = overlaypool_id;
+    pg_pool_t *np = pending_inc.get_new_pool(pool_id, p);
+    np->read_tier = overlaypool_id;
+    np->write_tier = overlaypool_id;
+    np->last_force_op_resend = pending_inc.epoch;
     ss << "overlay for '" << poolstr << "' is now (or already was) '" << overlaypoolstr << "'";
     wait_for_finished_proposal(new Monitor::C_Command(mon, m, 0, ss.str(),
                                              get_last_committed() + 1));
@@ -5100,8 +5102,10 @@ done:
       goto reply;
     }
     // go
-    pending_inc.get_new_pool(pool_id, p)->clear_read_tier();
-    pending_inc.get_new_pool(pool_id, p)->clear_write_tier();
+    pg_pool_t *np = pending_inc.get_new_pool(pool_id, p);
+    np->clear_read_tier();
+    np->clear_write_tier();
+    np->last_force_op_resend = pending_inc.epoch;
     ss << "there is now (or already was) no overlay for '" << poolstr << "'";
     wait_for_finished_proposal(new Monitor::C_Command(mon, m, 0, ss.str(),
                                              get_last_committed() + 1));