]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: drop command replies on paxos reset
authorSage Weil <sage@inktank.com>
Tue, 9 Oct 2012 00:14:22 +0000 (17:14 -0700)
committerSage Weil <sage@inktank.com>
Wed, 10 Oct 2012 21:19:58 +0000 (14:19 -0700)
If paxos resets, do not send the reply for the commit we were waiting for;
let the command be reprocessed and re-proposed.

Among other things, this could lead to nondeterministic results for
'ceph osd create <uuid>'.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.h

index 061ec6be79af58c5416dab8c8ab326afb4056b5d..49605fd4aa94d791e0a2f5e163742837c05dc6ab 100644 (file)
@@ -43,6 +43,8 @@
 
 #include "perfglue/heap_profiler.h"
 
+#include "messages/MMonCommand.h"
+
 #include <memory>
 
 
@@ -388,7 +390,10 @@ public:
     C_Command(Monitor *_mm, MMonCommand *_m, int r, string s, bufferlist rd, version_t v) :
       mon(_mm), m(_m), rc(r), rs(s), rdata(rd), version(v){}
     void finish(int r) {
-      mon->reply_command(m, rc, rs, rdata, version);
+      if (r >= 0)
+       mon->reply_command(m, rc, rs, rdata, version);
+      else
+       mon->_ms_dispatch(m);
     }
   };