mirror of
https://github.com/ceph/ceph
synced 2025-02-21 09:57:26 +00:00
crimson/os/seastore: differentiate cleaner trim/reclaim transactions
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
parent
3304a82bfd
commit
4a6dd67f62
@ -106,7 +106,8 @@ void Cache::register_metrics()
|
||||
std::map<src_t, sm::label_instance> labels_by_src {
|
||||
{src_t::MUTATE, src_label("MUTATE")},
|
||||
{src_t::READ, src_label("READ")},
|
||||
{src_t::CLEANER, src_label("CLEANER")},
|
||||
{src_t::CLEANER_TRIM, src_label("CLEANER_TRIM")},
|
||||
{src_t::CLEANER_RECLAIM, src_label("CLEANER_RECLAIM")},
|
||||
};
|
||||
|
||||
auto ext_label = sm::label("ext");
|
||||
@ -514,7 +515,9 @@ void Cache::register_metrics()
|
||||
// READ transaction won't contain any tree inserts and erases
|
||||
continue;
|
||||
}
|
||||
if (src == src_t::CLEANER && tree_label == onode_label) {
|
||||
if ((src == src_t::CLEANER_TRIM ||
|
||||
src == src_t::CLEANER_RECLAIM) &&
|
||||
tree_label == onode_label) {
|
||||
// CLEANER transaction won't contain any onode tree operations
|
||||
continue;
|
||||
}
|
||||
@ -730,7 +733,8 @@ void Cache::mark_transaction_conflicted(
|
||||
record_header_fullness.ool_stats.filled_bytes += ool_stats.header_raw_bytes;
|
||||
record_header_fullness.ool_stats.total_bytes += ool_stats.header_bytes;
|
||||
|
||||
if (t.get_src() == Transaction::src_t::CLEANER) {
|
||||
if (t.get_src() == Transaction::src_t::CLEANER_TRIM ||
|
||||
t.get_src() == Transaction::src_t::CLEANER_RECLAIM) {
|
||||
// CLEANER transaction won't contain any onode tree operations
|
||||
assert(t.onode_tree_stats.is_clear());
|
||||
} else {
|
||||
@ -846,7 +850,8 @@ record_t Cache::prepare_record(Transaction &t)
|
||||
assert(!t.is_weak());
|
||||
assert(t.get_src() != Transaction::src_t::READ);
|
||||
|
||||
if (t.get_src() == Transaction::src_t::CLEANER) {
|
||||
if (t.get_src() == Transaction::src_t::CLEANER_TRIM ||
|
||||
t.get_src() == Transaction::src_t::CLEANER_RECLAIM) {
|
||||
// CLEANER transaction won't contain any onode tree operations
|
||||
assert(t.onode_tree_stats.is_clear());
|
||||
} else {
|
||||
|
@ -309,7 +309,7 @@ SegmentCleaner::gc_trim_journal_ret SegmentCleaner::gc_trim_journal()
|
||||
{
|
||||
return repeat_eagain([this] {
|
||||
return ecb->with_transaction_intr(
|
||||
Transaction::src_t::CLEANER, [this](auto& t) {
|
||||
Transaction::src_t::CLEANER_TRIM, [this](auto& t) {
|
||||
return rewrite_dirty(t, get_dirty_tail()
|
||||
).si_then([this, &t] {
|
||||
return ecb->submit_transaction_direct(t);
|
||||
@ -349,7 +349,7 @@ SegmentCleaner::gc_reclaim_space_ret SegmentCleaner::gc_reclaim_space()
|
||||
"SegmentCleaner::gc_reclaim_space: processing {} extents",
|
||||
extents.size());
|
||||
return ecb->with_transaction_intr(
|
||||
Transaction::src_t::CLEANER,
|
||||
Transaction::src_t::CLEANER_RECLAIM,
|
||||
[this, &extents](auto& t) {
|
||||
return trans_intr::do_for_each(
|
||||
extents,
|
||||
|
@ -204,7 +204,8 @@ public:
|
||||
enum class src_t : uint8_t {
|
||||
MUTATE = 0,
|
||||
READ, // including weak and non-weak read transactions
|
||||
CLEANER,
|
||||
CLEANER_TRIM,
|
||||
CLEANER_RECLAIM,
|
||||
MAX
|
||||
};
|
||||
static constexpr auto SRC_MAX = static_cast<std::size_t>(src_t::MAX);
|
||||
@ -410,8 +411,10 @@ inline std::ostream& operator<<(std::ostream& os,
|
||||
return os << "MUTATE";
|
||||
case Transaction::src_t::READ:
|
||||
return os << "READ";
|
||||
case Transaction::src_t::CLEANER:
|
||||
return os << "CLEANER";
|
||||
case Transaction::src_t::CLEANER_TRIM:
|
||||
return os << "CLEANER_TRIM";
|
||||
case Transaction::src_t::CLEANER_RECLAIM:
|
||||
return os << "CLEANER_RECLAIM";
|
||||
default:
|
||||
ceph_abort("impossible");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user