From 462110a05885de62c42ca8bf0c39fcda46eac84f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 2 Dec 2016 11:52:02 -0500 Subject: [PATCH] os/bluestore: dump allocator state on allocation failure This is probably noisy for an *actual* ENOSPC, but the OSD should actually prevent those from happening in general, and we are very interested in fixing spurious allocation failures due to allocator problems. See http://tracker.ceph.com/issues/18054 Signed-off-by: Sage Weil --- src/os/bluestore/BlueFS.cc | 3 +++ src/os/bluestore/BlueStore.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 8df7e712903..130fb16bfe6 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -1754,6 +1754,9 @@ int BlueFS::_allocate(uint8_t id, uint64_t len, r = alloc[id]->alloc_extents(left, min_alloc_size, hint, &extents, &count); if (r < 0) { + derr << __func__ << " allocate failed on 0x" << std::hex << left + << " min_alloc_size 0x" << min_alloc_size << std::dec << dendl; + alloc[id]->dump(); assert(0 == "allocate failed... wtf"); return r; } diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d80ca2ca201..8804ac74318 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3573,6 +3573,9 @@ int BlueStore::_balance_bluefs_freespace(vector *extents) uint32_t elength; r = alloc->allocate(gift, min_alloc_size, hint, &eoffset, &elength); if (r < 0) { + derr << __func__ << " allocate failed on 0x" << std::hex << gift + << " min_alloc_size 0x" << min_alloc_size << std::dec << dendl; + alloc->dump(); assert(0 == "allocate failed, wtf"); return r; } -- 2.39.5