From: Sage Weil Date: Fri, 31 Aug 2018 20:35:59 +0000 (-0500) Subject: mon/OSDMonitor: set new_last_{up,in}_change X-Git-Tag: v14.0.1~357^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f90fb41cdc2118f711369c768f5006ed1193b705;p=ceph.git mon/OSDMonitor: set new_last_{up,in}_change Capture up/down and in/out changes in encode_pending() so we don't have to worry about the zillions of places and ways pending_inc can get updated. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7403a9a903c6..9c77f9fe751e 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1059,9 +1059,26 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) dout(10) << "new_state for osd." << p->first << " is 0, removing" << dendl; p = pending_inc.new_state.erase(p); } else { + if (p->second & CEPH_OSD_UP) { + pending_inc.new_last_up_change = pending_inc.modified; + } ++p; } } + if (!pending_inc.new_up_client.empty()) { + pending_inc.new_last_up_change = pending_inc.modified; + } + for (auto& i : pending_inc.new_weight) { + if (i.first > osdmap.max_osd) { + if (i.second) { + // new osd is already marked in + pending_inc.new_last_in_change = pending_inc.modified; + } + } else if (!!i.second != !!osdmap.osd_weight[i.first]) { + // existing osd marked in or out + pending_inc.new_last_in_change = pending_inc.modified; + } + } { OSDMap tmp;