]> 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:20:45 +0000 (14:20 -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 2d7f8818c56d4dd7fbf78ce4c187009c2829b2bf..5592589e0abf9d4f8343c96eb6ea4d1efc46c734 100644 (file)
@@ -43,6 +43,8 @@
 
 #include "perfglue/heap_profiler.h"
 
+#include "messages/MMonCommand.h"
+
 #include <memory>
 
 
@@ -369,7 +371,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);
     }
   };