Skip to content

Commit 763f990

Browse files
authored
Merge pull request ceph#44748 from cyx1231st/wip-crimson-improve-log-tm
crimson/os/seastore/transaction_manager: cleanups and logs Reviewed-by: Samuel Just <sjust@redhat.com>
2 parents 531c8e3 + 98169ee commit 763f990

File tree

6 files changed

+167
-120
lines changed

6 files changed

+167
-120
lines changed

src/crimson/os/seastore/onode_manager/staged-fltree/node.cc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,10 @@ Node::try_merge_adjacent(
599599
} else {
600600
update_index_after_merge = update_parent_index;
601601
}
602-
INFOT("merge {} and {} at merge_stage={}, merge_size={}B, "
603-
"update_index={}, is_left={} ...",
604-
c.t, left_for_merge->get_name(), right_for_merge->get_name(),
605-
merge_stage, merge_size, update_index_after_merge, is_left);
602+
DEBUGT("merge {} and {} at merge_stage={}, merge_size={}B, "
603+
"update_index={}, is_left={} ...",
604+
c.t, left_for_merge->get_name(), right_for_merge->get_name(),
605+
merge_stage, merge_size, update_index_after_merge, is_left);
606606
// we currently cannot generate delta depends on another extent content,
607607
// so use rebuild_extent() as a workaround to rebuild the node from a
608608
// fresh extent, thus no need to generate delta.
@@ -907,10 +907,10 @@ eagain_ifuture<> InternalNode::erase_child(context_t c, Ref<Node>&& child_ref)
907907
(auto&& new_tail_child) mutable {
908908
auto child_pos = child_ref->parent_info().position;
909909
if (new_tail_child) {
910-
INFOT("erase {}'s child {} at pos({}), "
911-
"and fix new child tail {} at pos({}) ...",
912-
c.t, get_name(), child_ref->get_name(), child_pos,
913-
new_tail_child->get_name(), new_tail_child->parent_info().position);
910+
DEBUGT("erase {}'s child {} at pos({}), "
911+
"and fix new child tail {} at pos({}) ...",
912+
c.t, get_name(), child_ref->get_name(), child_pos,
913+
new_tail_child->get_name(), new_tail_child->parent_info().position);
914914
assert(!new_tail_child->impl->is_level_tail());
915915
new_tail_child->make_tail(c);
916916
assert(new_tail_child->impl->is_level_tail());
@@ -919,8 +919,8 @@ eagain_ifuture<> InternalNode::erase_child(context_t c, Ref<Node>&& child_ref)
919919
new_tail_child.reset();
920920
}
921921
} else {
922-
INFOT("erase {}'s child {} at pos({}) ...",
923-
c.t, get_name(), child_ref->get_name(), child_pos);
922+
DEBUGT("erase {}'s child {} at pos({}) ...",
923+
c.t, get_name(), child_ref->get_name(), child_pos);
924924
}
925925

926926
Ref<Node> this_ref = child_ref->deref_parent();
@@ -1510,11 +1510,11 @@ eagain_ifuture<Ref<InternalNode>> InternalNode::insert_or_split(
15101510
outdated_child, c, FNAME](auto fresh_right) mutable {
15111511
// I'm the left_node and need to split into the right_node
15121512
auto right_node = fresh_right.node;
1513-
INFOT("proceed split {} to fresh {} with insert_child={},"
1514-
" outdated_child={} ...",
1515-
c.t, get_name(), right_node->get_name(),
1516-
insert_child->get_name(),
1517-
(outdated_child ? outdated_child->get_name() : "N/A"));
1513+
DEBUGT("proceed split {} to fresh {} with insert_child={},"
1514+
" outdated_child={} ...",
1515+
c.t, get_name(), right_node->get_name(),
1516+
insert_child->get_name(),
1517+
(outdated_child ? outdated_child->get_name() : "N/A"));
15181518
auto insert_value = insert_child->impl->laddr();
15191519
auto [split_pos, is_insert_left, p_value] = impl->split_insert(
15201520
fresh_right.mut, *right_node->impl, insert_key, insert_value,
@@ -2089,8 +2089,8 @@ eagain_ifuture<Ref<tree_cursor_t>> LeafNode::insert_value(
20892089
}).si_then([this_ref = std::move(this_ref), this, c, &key, vconf, FNAME,
20902090
insert_pos, insert_stage=insert_stage, insert_size=insert_size](auto fresh_right) mutable {
20912091
auto right_node = fresh_right.node;
2092-
INFOT("proceed split {} to fresh {} ...",
2093-
c.t, get_name(), right_node->get_name());
2092+
DEBUGT("proceed split {} to fresh {} ...",
2093+
c.t, get_name(), right_node->get_name());
20942094
// no need to bump version for right node, as it is fresh
20952095
on_layout_change();
20962096
impl->prepare_mutate(c);

src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl {
608608
assert(_right_impl.node_type() == NODE_TYPE);
609609
assert(_right_impl.field_type() == FIELD_TYPE);
610610
auto& right_impl = dynamic_cast<NodeLayoutT&>(_right_impl);
611-
SUBINFO(seastore_onode,
611+
SUBDEBUG(seastore_onode,
612612
"begin at insert_pos({}), insert_stage={}, insert_size={}B ...",
613613
_insert_pos, insert_stage, insert_size);
614614
if (unlikely(LOGGER(seastore_onode).is_enabled(seastar::log_level::debug))) {
@@ -798,7 +798,7 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl {
798798
assert(p_value);
799799

800800
auto split_pos = normalize(split_at.get_pos());
801-
SUBINFO(seastore_onode,
801+
SUBDEBUG(seastore_onode,
802802
"done at insert_pos({}), insert_stage={}, insert_size={}B, "
803803
"split_at({}), is_insert_left={}, split_size={}B(target={}B)",
804804
_insert_pos, insert_stage, insert_size, split_pos,

src/crimson/os/seastore/seastore_types.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,20 @@ try_decode_deltas(
518518
return record_deltas;
519519
}
520520

521+
std::ostream& operator<<(std::ostream& out, placement_hint_t h)
522+
{
523+
switch (h) {
524+
case placement_hint_t::HOT:
525+
return out << "HOT";
526+
case placement_hint_t::COLD:
527+
return out << "COLD";
528+
case placement_hint_t::REWRITE:
529+
return out << "REWRITE";
530+
default:
531+
return out << "INVALID_PLACEMENT_HINT_TYPE!";
532+
}
533+
}
534+
521535
bool can_delay_allocation(device_type_t type) {
522536
// Some types of device may not support delayed allocation, for example PMEM.
523537
return type <= device_type_t::RANDOM_BLOCK;

src/crimson/os/seastore/seastore_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,8 @@ enum class placement_hint_t {
698698
NUM_HINTS // Constant for number of hints
699699
};
700700

701+
std::ostream& operator<<(std::ostream& out, placement_hint_t h);
702+
701703
enum class device_type_t {
702704
NONE = 0,
703705
SEGMENTED, // i.e. Hard_Disk, SATA_SSD, NAND_NVME

0 commit comments

Comments
 (0)