diff options
author | Sage Weil <sage@inktank.com> | 2013-10-01 14:46:21 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-10-01 14:46:21 -0700 |
commit | 5da81bdb8d5c34900096052c822f1792bda92ba4 (patch) | |
tree | f0fa6ed8958b1b2c42faec6f976d3f75b78de122 | |
parent | 23087df13b092a6ac3b0cdf743f1bda73fef79bc (diff) | |
download | ceph-5da81bdb8d5c34900096052c822f1792bda92ba4.tar.gz |
debug get_pending_crush
-rw-r--r-- | src/mon/OSDMonitor.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 2bcee8261c5..0de3bbe36c9 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -73,13 +73,27 @@ CrushWrapper &OSDMonitor::_get_stable_crush() void OSDMonitor::_get_pending_crush(CrushWrapper& newcrush) { bufferlist bl; - if (pending_inc.crush.length()) + if (pending_inc.crush.length()) { bl = pending_inc.crush; - else + dout(20) << __func__ << " using pending_inc's " << bl.length() << " bytes" << dendl; + } else { osdmap.crush->encode(bl); + dout(20) << __func__ << " encoding the current e" << osdmap.get_epoch() << dendl; + } bufferlist::iterator p = bl.begin(); newcrush.decode(p); + + { + dout(30) << " crush dump: \n"; + Formatter *f = new_formatter("json"); + f->open_object_section("crush"); + newcrush.dump(f); + f->close_section(); + f->flush(*_dout); + delete f; + *_dout << dendl; + } } void OSDMonitor::create_initial() |