]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: fix global id alloc on peon monitors
authorSage Weil <sage@newdream.net>
Mon, 9 Nov 2009 23:52:11 +0000 (15:52 -0800)
committerSage Weil <sage@newdream.net>
Mon, 9 Nov 2009 23:52:11 +0000 (15:52 -0800)
src/mon/AuthMonitor.cc
src/mon/Paxos.cc

index f3392f13572f52b8047d3ffdace78b3dea3b1428..cb28aed5946b8ba92b37ee76704fb173748b3d75 100644 (file)
@@ -329,7 +329,7 @@ uint64_t AuthMonitor::assign_global_id(MAuth *m, bool should_increase_max)
 
   while (next_global_id >= max_global_id) {
     if (!mon->is_leader()) {
-      dout(10) << "not the leader, forwarding request to the leader" << dendl;
+      dout(10) << "not the leader, requesting more ids from leader" << dendl;
       int leader = mon->get_leader();
       MMonGlobalID *req = new MMonGlobalID();
       req->old_max_id = max_global_id;
@@ -373,7 +373,9 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable)
       s->global_id = assign_global_id(m, paxos_writable);
       if (!s->global_id) {
         s->put();
-        return false;
+       if (mon->is_leader())
+         return false;
+        return true;
       }
 
       set<__u32> supported;
index 110cbc0c9fe42c7df9ce7a4fe82e8faf3927fe04..d8ebac6b95af0699431e828afc18b1a258f5f661 100644 (file)
@@ -509,6 +509,8 @@ void Paxos::handle_commit(MMonPaxos *commit)
   mon->store->put_int(last_committed, machine_name, "last_committed");
   
   delete commit;
+
+  finish_contexts(waiting_for_commit);
 }
 
 void Paxos::extend_lease()