From 14ea8157eb2883b9f53c234044fe002153212ef8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 23 Feb 2014 18:23:55 -0800 Subject: [PATCH] mon/OSDMonitor: fix osdmap encode feature logic If we are encoding a full map based on an old Incremental that does not encode the features, fall back to the quorum features or (barring that) all features. Do *not* do no features or else we will end up with encode_client_old which does not even include the extended info and will cause the mon to crash when decoding. This was observed when upgading a 0.76 cluster to 0.77 (all mons stopped, upgraded, and then started) Reported-by: Aaron Ten Clay Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 6512099b9091..26c588d603e9 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -203,9 +203,17 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap) if (t == NULL) t = new MonitorDBStore::Transaction; - // write out the full map for all past epochs + // Write out the full map for all past epochs. Encode the full + // map with the same features as the incremental. If we don't + // know, use the quorum features. If we don't know those either, + // encode with all features. + uint64_t f = inc.encode_features; + if (!f) + f = mon->quorum_features; + if (!f) + f = -1; bufferlist full_bl; - osdmap.encode(full_bl, inc.encode_features); + osdmap.encode(full_bl, f); tx_size += full_bl.length(); put_version_full(t, osdmap.epoch, full_bl); -- 2.47.3