]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: fix base case for loading full osdmap
authorSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 00:46:40 +0000 (17:46 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 00:47:11 +0000 (17:47 -0700)
Right after cluster creation, first_committed is 1 and latest stashed in 0,
but we don't have the initial full map yet.  Thereafter, we do (because we
write it with trim).  Fixes afd6c7d8247075003e5be439ad59976c3d123218.

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

index 3669486605c38cabae591349a047bc3c8271f63b..d6426e4e49323e45436765c0a869e1d7613d2a11 100644 (file)
@@ -122,7 +122,9 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
    * due to encode_trim_extra(), which includes the oldest full map in the trim
    * transaction.  Start with whichever is newer.
    */
-  version_t latest_full = MAX(get_version_latest_full(), get_first_committed());
+  version_t latest_full = get_version_latest_full();
+  if (latest_full == 0 && get_first_committed() > 1)
+    latest_full = get_first_committed();
   if ((latest_full > 0) && (latest_full > osdmap.epoch)) {
     bufferlist latest_bl;
     get_version_full(latest_full, latest_bl);