From: Sage Weil Date: Thu, 7 Sep 2017 21:11:30 +0000 (-0400) Subject: os/bluestore: dump stray cache content on shutdown X-Git-Tag: v13.0.1~818^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=28d9b6b0e92cf51996a12a43c81f7ac2abcaecaa;p=ceph.git os/bluestore: dump stray cache content on shutdown Tracking down http://tracker.ceph.com/issues/21259. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 302921d79f1..fe18a504182 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1615,6 +1615,12 @@ bool BlueStore::OnodeSpace::map_any(std::function f) return false; } +void BlueStore::OnodeSpace::dump(CephContext *cct, int lvl) +{ + for (auto& i : onode_map) { + ldout(cct, lvl) << i.first << " : " << i.second << dendl; + } +} // SharedBlob @@ -1692,6 +1698,19 @@ void BlueStore::SharedBlob::put_ref(uint64_t offset, uint32_t length, } } +// SharedBlobSet + +#undef dout_prefix +#define dout_prefix *_dout << "bluestore.sharedblobset(" << this << ") " + +void BlueStore::SharedBlobSet::dump(CephContext *cct, int lvl) +{ + std::lock_guard l(lock); + for (auto& i : sb_map) { + ldout(cct, lvl) << i.first << " : " << *i.second << dendl; + } +} + // Blob #undef dout_prefix @@ -11530,6 +11549,14 @@ void BlueStore::_flush_cache() assert(i->empty()); } for (auto& p : coll_map) { + if (!p.second->onode_map.empty()) { + derr << __func__ << "stray onodes on " << p.first << dendl; + p.second->onode_map.dump(cct, 0); + } + if (!p.second->shared_blob_set.empty()) { + derr << __func__ << " stray shared blobs on " << p.first << dendl; + p.second->shared_blob_set.dump(cct, 0); + } assert(p.second->onode_map.empty()); assert(p.second->shared_blob_set.empty()); } diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 2353141db98..d64e08f7f7e 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -456,6 +456,8 @@ public: std::lock_guard l(lock); return sb_map.empty(); } + + void dump(CephContext *cct, int lvl); }; //#define CACHE_BLOB_BL // not sure if this is a win yet or not... :/ @@ -1318,6 +1320,8 @@ public: void clear(); bool empty(); + void dump(CephContext *cct, int lvl); + /// return true if f true for any item bool map_any(std::function f); };