Skip to content

Commit

Permalink
crimson/osd/seastore: more logs for SeaStore::list_objects and
Browse files Browse the repository at this point in the history
OnodeManager::list_onodes

Signed-off-by: Xuehan Xu <[email protected]>
  • Loading branch information
xxhdx1985126 committed Aug 21, 2023
1 parent 83ab48a commit 224a4ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -141,21 +143,28 @@ FLTreeOnodeManager::list_onodes_ret FLTreeOnodeManager::list_onodes(
return trans_intr::repeat(
[this, &trans, end, &to_list, &current_cursor, &ret] ()
-> eagain_ifuture<seastar::stop_iteration> {
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>(
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>(
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>(
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, &current_cursor] (auto&& next_cursor) mutable {
// we intentionally hold the current_cursor during get_next() to
Expand Down
9 changes: 7 additions & 2 deletions src/crimson/os/seastore/seastore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,9 @@ SeaStore::Shard::list_objects(CollectionRef ch,
std::vector<ghobject_t>(),
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<seastar::stop_iteration>;
Expand All @@ -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 {
Expand All @@ -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);
Expand Down

0 comments on commit 224a4ff

Please sign in to comment.