]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: retry PGStats message on EAGAIN
authorSage Weil <sage@inktank.com>
Fri, 8 Feb 2013 07:13:11 +0000 (23:13 -0800)
committerSage Weil <sage@inktank.com>
Fri, 8 Feb 2013 17:09:20 +0000 (09:09 -0800)
If we get EAGAIN from a paxos restart/election/whatever, we should
restart the message instead of just blindly acking it.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Luis <joao.luis@inktank.com>
src/mon/PGMonitor.h

index 2927c00453a6f8cb4d2bd8ca5a7ec1a8fd27ecd7..5db1744111d5cfd5ffc5a1b01139082d1aa9cfe1 100644 (file)
@@ -71,12 +71,15 @@ private:
     entity_inst_t who;
     C_Stats(PGMonitor *p, MPGStats *r, MPGStatsAck *a) : pgmon(p), req(r), ack(a) {}
     void finish(int r) {
-      if (r == -ECANCELED) {
+      if (r >= 0) {
+       pgmon->_updated_stats(req, ack);
+      } else if (r == -ECANCELED) {
        req->put();
        ack->put();
-       return;
+      } else {
+       ack->put();
+       dispatch(req);
       }
-      pgmon->_updated_stats(req, ack);
     }    
   };