Skip to content

Commit 59df66b

Browse files
authored
Merge pull request ceph#59692 from cyx1231st/wip-seastore-improve-log
crimson/os/seastore: refine seastore and transaction_manager logs, cleanups Reviewed-by: Matan Breizman <[email protected]>
2 parents ce24f23 + ec5c6c5 commit 59df66b

File tree

11 files changed

+802
-584
lines changed

11 files changed

+802
-584
lines changed

src/crimson/os/futurized_store.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,15 @@ class FuturizedStore {
7575
CollectionRef c,
7676
const ghobject_t& oid) = 0;
7777

78-
using omap_values_t = std::map<std::string, ceph::bufferlist, std::less<>>;
78+
using omap_values_t = attrs_t;
7979
using omap_keys_t = std::set<std::string>;
8080
virtual read_errorator::future<omap_values_t> omap_get_values(
8181
CollectionRef c,
8282
const ghobject_t& oid,
8383
const omap_keys_t& keys) = 0;
8484

85-
virtual read_errorator::future<std::tuple<bool, omap_values_t>> omap_get_values(
85+
using omap_values_paged_t = std::tuple<bool, omap_values_t>;
86+
virtual read_errorator::future<omap_values_paged_t> omap_get_values(
8687
CollectionRef c, ///< [in] collection
8788
const ghobject_t &oid, ///< [in] oid
8889
const std::optional<std::string> &start ///< [in] start, empty for begin
@@ -147,7 +148,8 @@ class FuturizedStore {
147148
return seastar::now();
148149
}
149150

150-
virtual read_errorator::future<std::map<uint64_t, uint64_t>> fiemap(
151+
using fiemap_ret_t = std::map<uint64_t, uint64_t>;
152+
virtual read_errorator::future<fiemap_ret_t> fiemap(
151153
CollectionRef ch,
152154
const ghobject_t& oid,
153155
uint64_t off,

src/crimson/os/seastore/cached_extent.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,14 @@ parent_tracker_t::~parent_tracker_t() {
158158

159159
std::ostream &operator<<(std::ostream &out, const LBAMapping &rhs)
160160
{
161-
out << "LBAMapping(" << rhs.get_key() << "~" << rhs.get_length()
161+
out << "LBAMapping(" << rhs.get_key()
162+
<< "~0x" << std::hex << rhs.get_length() << std::dec
162163
<< "->" << rhs.get_val();
163164
if (rhs.is_indirect()) {
164-
out << " indirect(" << rhs.get_intermediate_base() << "~"
165-
<< rhs.get_intermediate_key() << "~"
166-
<< rhs.get_intermediate_length() << ")";
165+
out << ",indirect(" << rhs.get_intermediate_base()
166+
<< "~0x" << std::hex << rhs.get_intermediate_length()
167+
<< "@0x" << rhs.get_intermediate_offset() << std::dec
168+
<< ")";
167169
}
168170
out << ")";
169171
return out;

src/crimson/os/seastore/cached_extent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ class CachedExtent
350350
<< ", modify_time=" << sea_time_point_printer_t{modify_time}
351351
<< ", paddr=" << get_paddr()
352352
<< ", prior_paddr=" << prior_poffset_str
353-
<< ", length=" << get_length()
353+
<< std::hex << ", length=0x" << get_length() << std::dec
354354
<< ", state=" << state
355355
<< ", last_committed_crc=" << last_committed_crc
356356
<< ", refcount=" << use_count()

src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,22 @@ class BtreeLBAMapping : public BtreeNodeMapping<laddr_t, paddr_t> {
173173
if (!parent_modified()) {
174174
return;
175175
}
176+
LOG_PREFIX(BtreeLBAMapping::maybe_fix_pos);
176177
auto &p = static_cast<LBALeafNode&>(*parent);
177178
p.maybe_fix_mapping_pos(*this);
179+
SUBDEBUGT(seastore_lba, "fixed pin {}",
180+
ctx.trans, static_cast<LBAMapping&>(*this));
178181
}
179182

180183
LBAMappingRef refresh_with_pending_parent() final {
184+
LOG_PREFIX(BtreeLBAMapping::refresh_with_pending_parent);
181185
assert(is_parent_valid() && !is_parent_viewable());
182186
auto &p = static_cast<LBALeafNode&>(*parent);
183187
auto &viewable_p = static_cast<LBALeafNode&>(
184188
*p.find_pending_version(ctx.trans, get_key()));
185-
return viewable_p.get_mapping(ctx, get_key());
189+
auto new_pin = viewable_p.get_mapping(ctx, get_key());
190+
SUBDEBUGT(seastore_lba, "new pin {}", ctx.trans, static_cast<LBAMapping&>(*new_pin));
191+
return new_pin;
186192
}
187193
protected:
188194
std::unique_ptr<BtreeNodeMapping<laddr_t, paddr_t>> _duplicate(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl {
925925
std::ostringstream sos;
926926
sos << "Node" << NODE_TYPE << FIELD_TYPE
927927
<< "@" << extent.get_laddr()
928-
<< "+" << std::hex << extent.get_length() << std::dec
928+
<< "+0x" << std::hex << extent.get_length() << std::dec
929929
<< "Lv" << (unsigned)level()
930930
<< (is_level_tail() ? "$" : "");
931931
name = sos.str();

0 commit comments

Comments
 (0)