From c2258991393fedf64f5747e44f03a04f3a853e88 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Jun 2017 17:48:40 -0400 Subject: [PATCH 1/2] mgr/ClusterState: dump pgmap and inc at dout 30 Signed-off-by: Sage Weil --- src/mgr/ClusterState.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/mgr/ClusterState.cc b/src/mgr/ClusterState.cc index 60612cb90b5..6b3b800a143 100644 --- a/src/mgr/ClusterState.cc +++ b/src/mgr/ClusterState.cc @@ -95,6 +95,18 @@ void ClusterState::update_delta_stats() pending_inc.stamp = ceph_clock_now(); pending_inc.version = pg_map.version + 1; // to make apply_incremental happy dout(10) << " v" << pending_inc.version << dendl; + + dout(30) << " pg_map before:\n"; + JSONFormatter jf(true); + jf.dump_object("pg_map", pg_map); + jf.flush(*_dout); + *_dout << dendl; + dout(30) << " incremental:\n"; + JSONFormatter jf(true); + jf.dump_object("pending_inc", pending_inc); + jf.flush(*_dout); + *_dout << dendl; + pg_map.apply_incremental(g_ceph_context, pending_inc); pending_inc = PGMap::Incremental(); } @@ -122,6 +134,17 @@ void ClusterState::notify_osdmap(const OSDMap &osd_map) PGMapUpdater::check_down_pgs(osd_map, pg_map, true, need_check_down_pg_osds, &pending_inc); + dout(30) << " pg_map before:\n"; + JSONFormatter jf(true); + jf.dump_object("pg_map", pg_map); + jf.flush(*_dout); + *_dout << dendl; + dout(30) << " incremental:\n"; + JSONFormatter jf(true); + jf.dump_object("pending_inc", pending_inc); + jf.flush(*_dout); + *_dout << dendl; + pg_map.apply_incremental(g_ceph_context, pending_inc); pending_inc = PGMap::Incremental(); // TODO: Complete the separation of PG state handling so From a883bac077ae8f3f332aeb711bce45c046f65672 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Jun 2017 22:49:23 -0400 Subject: [PATCH 2/2] mon/PGMap: erase osd_epochs entry too when we erase osd_stat entry Signed-off-by: Sage Weil --- src/mon/PGMap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index a623e20b2ea..b39b6a3d186 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -1130,6 +1130,7 @@ void PGMap::apply_incremental(CephContext *cct, const Incremental& inc) if (t != osd_stat.end()) { stat_osd_sub(t->first, t->second); osd_stat.erase(t); + osd_epochs.erase(*p); } // remove these old osds from full/nearfull set(s), too