]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: make is_readable debug output show result 2421/head
authorSage Weil <sage@redhat.com>
Mon, 8 Sep 2014 15:39:50 +0000 (08:39 -0700)
committerSage Weil <sage@redhat.com>
Mon, 8 Sep 2014 15:39:50 +0000 (08:39 -0700)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Paxos.cc

index 04644917c6193fdce24b1050b175b1d020fe68c9..ef745ff088f562e500b7a608041542a7610bad23 100644 (file)
@@ -1424,17 +1424,22 @@ void Paxos::dispatch(PaxosServiceMessage *m)
 
 bool Paxos::is_readable(version_t v)
 {
-  dout(5) << "is_readable now=" << ceph_clock_now(g_ceph_context)
-         << " lease_expire=" << lease_expire
-         << " has v" << v << " lc " << last_committed << dendl;
+  bool ret;
   if (v > last_committed)
-    return false;
-  return 
-    (mon->is_peon() || mon->is_leader()) &&
-    (is_active() || is_updating() || is_writing()) &&
-    last_committed > 0 &&           // must have a value
-    (mon->get_quorum().size() == 1 ||  // alone, or
-     is_lease_valid()); // have lease
+    ret = false;
+  else
+    ret =
+      (mon->is_peon() || mon->is_leader()) &&
+      (is_active() || is_updating() || is_writing()) &&
+      last_committed > 0 &&           // must have a value
+      (mon->get_quorum().size() == 1 ||  // alone, or
+       is_lease_valid()); // have lease
+  dout(5) << __func__ << " = " << (int)ret
+         << " - now=" << ceph_clock_now(g_ceph_context)
+         << " lease_expire=" << lease_expire
+         << " has v" << v << " lc " << last_committed
+         << dendl;
+  return ret;
 }
 
 bool Paxos::read(version_t v, bufferlist &bl)