summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-08 17:46:40 -0700
committerSage Weil <sage@inktank.com>2013-07-08 21:10:02 -0700
commitbfc26c656d183fbcc90a352391e47f9f51c96052 (patch)
treeb8166e802b6789383bbcdfd9854640cb7e2414c9
parent7fb3804fb860dcd0340dd3f7c39eec4315f8e4b6 (diff)
downloadceph-bfc26c656d183fbcc90a352391e47f9f51c96052.tar.gz
mon/OSDMonitor: fix base case for loading full osdmap
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> (cherry picked from commit 43fa7aabf1f7e5deb844c1f52d451bab9e7d1006)
-rw-r--r--src/mon/OSDMonitor.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 857fca530c3..2751656a822 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -123,7 +123,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);