From 224a4ff62782356d4c82c71c3c9794bf37f95758 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Mon, 21 Aug 2023 16:32:44 +0800 Subject: [PATCH] crimson/osd/seastore: more logs for SeaStore::list_objects and OnodeManager::list_onodes Signed-off-by: Xuehan Xu --- .../staged-fltree/fltree_onode_manager.cc | 11 ++++++++++- src/crimson/os/seastore/seastore.cc | 9 +++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/fltree_onode_manager.cc b/src/crimson/os/seastore/onode_manager/staged-fltree/fltree_onode_manager.cc index ba78cbf0b0b3..99fe31bbb5e1 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/fltree_onode_manager.cc +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/fltree_onode_manager.cc @@ -130,6 +130,8 @@ FLTreeOnodeManager::list_onodes_ret FLTreeOnodeManager::list_onodes( const ghobject_t& end, uint64_t limit) { + LOG_PREFIX(FLTreeOnodeManager::list_onodes); + DEBUGT("start {}, end {}, limit {}", trans, start, end, limit); return tree.lower_bound(trans, start ).si_then([this, &trans, end, limit] (auto&& cursor) { using crimson::os::seastore::onode::full_key_t; @@ -141,21 +143,28 @@ FLTreeOnodeManager::list_onodes_ret FLTreeOnodeManager::list_onodes( return trans_intr::repeat( [this, &trans, end, &to_list, ¤t_cursor, &ret] () -> eagain_ifuture { + LOG_PREFIX(FLTreeOnodeManager::list_onodes); if (current_cursor.is_end()) { + DEBUGT("reached the onode tree end", trans); std::get<1>(ret) = ghobject_t::get_max(); return seastar::make_ready_future( seastar::stop_iteration::yes); } else if (current_cursor.get_ghobj() >= end) { + DEBUGT("reached the end {} > {}", + trans, current_cursor.get_ghobj(), end); std::get<1>(ret) = end; return seastar::make_ready_future( seastar::stop_iteration::yes); } if (to_list == 0) { + DEBUGT("reached the limit", trans); std::get<1>(ret) = current_cursor.get_ghobj(); return seastar::make_ready_future( seastar::stop_iteration::yes); } - std::get<0>(ret).emplace_back(current_cursor.get_ghobj()); + auto ghobj = current_cursor.get_ghobj(); + DEBUGT("found onode for {}", trans, ghobj); + std::get<0>(ret).emplace_back(std::move(ghobj)); return tree.get_next(trans, current_cursor ).si_then([&to_list, ¤t_cursor] (auto&& next_cursor) mutable { // we intentionally hold the current_cursor during get_next() to diff --git a/src/crimson/os/seastore/seastore.cc b/src/crimson/os/seastore/seastore.cc index 897a063e0fe6..1535ea84d78b 100644 --- a/src/crimson/os/seastore/seastore.cc +++ b/src/crimson/os/seastore/seastore.cc @@ -688,6 +688,9 @@ SeaStore::Shard::list_objects(CollectionRef ch, std::vector(), ghobject_t::get_max())); } else { + LOG_PREFIX(SeaStore::list_objects); + DEBUGT("start {}, end {}, limit {}, bits {}", + t, start, end, limit, *bits); auto filter = SeaStore::get_objs_range(ch, *bits); using list_iertr = OnodeManager::list_onodes_iertr; using repeat_ret = list_iertr::future; @@ -704,6 +707,8 @@ SeaStore::Shard::list_objects(CollectionRef ch, auto pstart = ite->first; auto pend = ite->second; ranges.pop_front(); + LOG_PREFIX(SeaStore::list_objects); + DEBUGT("pstart {}, pend {}, limit {}", t, pstart, pend, limit); return onode_manager->list_onodes( t, pstart, pend, limit ).si_then([&limit, &ret, pend](auto &&_ret) mutable { @@ -717,8 +722,8 @@ SeaStore::Shard::list_objects(CollectionRef ch, assert(limit >= next_objects.size()); limit -= next_objects.size(); assert(limit == 0 || - std::get<1>(_ret) == pend || - std::get<1>(_ret) == ghobject_t::get_max()); + std::get<1>(ret) == pend || + std::get<1>(ret) == ghobject_t::get_max()); return list_iertr::make_ready_future< seastar::stop_iteration >(seastar::stop_iteration::no);