mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
crimson/os/seastore/transaction_manager: indicate the extents as COLD
when demoting them Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
This commit is contained in:
parent
43f048c81e
commit
f18fe72baa
@ -1395,7 +1395,7 @@ do_reclaim_space_ret do_reclaim_space(
|
||||
reclaimed += ext->get_length();
|
||||
}
|
||||
return extent_callback.rewrite_extents(
|
||||
t, extents, target_generation, modify_time);
|
||||
t, extents, target_generation, PLACEMENT_HINT_NULL, modify_time);
|
||||
});
|
||||
}).si_then([&extent_callback, &t] {
|
||||
return extent_callback.submit_transaction_direct(t);
|
||||
|
||||
@ -357,6 +357,7 @@ public:
|
||||
Transaction &t,
|
||||
std::vector<CachedExtentRef> &extents,
|
||||
rewrite_gen_t target_generation,
|
||||
placement_hint_t hint,
|
||||
sea_time_point modify_time) = 0;
|
||||
|
||||
/**
|
||||
|
||||
@ -776,8 +776,14 @@ public:
|
||||
}
|
||||
|
||||
/// assign the target rewrite generation for the followup rewrite
|
||||
void set_target_rewrite_generation(rewrite_gen_t gen) {
|
||||
user_hint = placement_hint_t::REWRITE;
|
||||
void set_target_rewrite_generation(
|
||||
rewrite_gen_t gen,
|
||||
placement_hint_t hint = PLACEMENT_HINT_NULL) {
|
||||
if (hint != PLACEMENT_HINT_NULL) {
|
||||
user_hint = hint;
|
||||
} else {
|
||||
user_hint = placement_hint_t::REWRITE;
|
||||
}
|
||||
rewrite_generation = gen;
|
||||
}
|
||||
|
||||
|
||||
@ -488,7 +488,9 @@ public:
|
||||
) {
|
||||
assert(opt.hint < placement_hint_t::NUM_HINTS);
|
||||
assert(is_target_rewrite_generation(opt.gen, dynamic_max_rewrite_generation));
|
||||
assert(opt.gen == INIT_GENERATION || opt.hint == placement_hint_t::REWRITE);
|
||||
assert(opt.gen == INIT_GENERATION ||
|
||||
opt.hint == placement_hint_t::REWRITE ||
|
||||
opt.hint == placement_hint_t::COLD);
|
||||
|
||||
data_category_t category = get_extent_category(type);
|
||||
opt.gen = adjust_generation(
|
||||
@ -529,7 +531,9 @@ public:
|
||||
LOG_PREFIX(ExtentPlacementManager::alloc_new_data_extents);
|
||||
assert(opt.hint < placement_hint_t::NUM_HINTS);
|
||||
assert(is_target_rewrite_generation(opt.gen, dynamic_max_rewrite_generation));
|
||||
assert(opt.gen == INIT_GENERATION || opt.hint == placement_hint_t::REWRITE);
|
||||
assert(opt.gen == INIT_GENERATION ||
|
||||
opt.hint == placement_hint_t::REWRITE ||
|
||||
opt.hint == placement_hint_t::COLD);
|
||||
|
||||
data_category_t category = get_extent_category(type);
|
||||
opt.gen = adjust_generation(
|
||||
@ -768,7 +772,6 @@ private:
|
||||
is_lba_backref_node(type)) {
|
||||
gen = INLINE_GENERATION;
|
||||
} else if (hint == placement_hint_t::COLD) {
|
||||
assert(gen == INIT_GENERATION);
|
||||
if (background_process.has_cold_tier()) {
|
||||
gen = hot_tier_generations;
|
||||
} else {
|
||||
@ -806,7 +809,8 @@ private:
|
||||
}
|
||||
|
||||
if (is_tracked && gen >= hot_tier_generations &&
|
||||
hint != placement_hint_t::REWRITE) {
|
||||
hint != placement_hint_t::REWRITE &&
|
||||
hint != placement_hint_t::COLD) {
|
||||
gen = hot_tier_generations - 1;
|
||||
}
|
||||
|
||||
|
||||
@ -1493,18 +1493,19 @@ TransactionManager::rewrite_extents_ret TransactionManager::rewrite_extents(
|
||||
Transaction &t,
|
||||
std::vector<CachedExtentRef> &extents,
|
||||
rewrite_gen_t target_generation,
|
||||
placement_hint_t hint,
|
||||
sea_time_point modify_time)
|
||||
{
|
||||
LOG_PREFIX(TransactionManager::rewrite_extents);
|
||||
return seastar::do_with(
|
||||
P_ADDR_NULL,
|
||||
L_ADDR_NULL,
|
||||
[this, &t, target_generation, modify_time, &extents, FNAME]
|
||||
[this, &t, target_generation, modify_time, &extents, FNAME, hint]
|
||||
(auto &paddr_hint, auto &next_laddr) {
|
||||
return trans_intr::do_for_each(
|
||||
extents,
|
||||
[this, &t, target_generation, modify_time, FNAME,
|
||||
&paddr_hint, &next_laddr](auto &extent) {
|
||||
&paddr_hint, &next_laddr, hint](auto &extent) {
|
||||
{
|
||||
auto updated = cache->update_extent_from_transaction(t, extent);
|
||||
if (!updated) {
|
||||
@ -1531,7 +1532,7 @@ TransactionManager::rewrite_extents_ret TransactionManager::rewrite_extents(
|
||||
}
|
||||
extent->set_target_rewrite_generation(INIT_GENERATION);
|
||||
} else {
|
||||
extent->set_target_rewrite_generation(target_generation);
|
||||
extent->set_target_rewrite_generation(target_generation, hint);
|
||||
ceph_assert(modify_time != NULL_TIME);
|
||||
extent->set_modify_time(modify_time);
|
||||
}
|
||||
@ -1616,6 +1617,7 @@ TransactionManager::demote_region(
|
||||
|
||||
co_await rewrite_extents(
|
||||
t, extents, epm->get_max_hot_gen() + 1,
|
||||
placement_hint_t::COLD,
|
||||
seastar::lowres_system_clock::now());
|
||||
|
||||
co_return ret;
|
||||
|
||||
@ -975,6 +975,7 @@ public:
|
||||
Transaction &t,
|
||||
std::vector<CachedExtentRef> &extents,
|
||||
rewrite_gen_t target_generation,
|
||||
placement_hint_t hint,
|
||||
sea_time_point modify_time) final;
|
||||
|
||||
using ExtentCallbackInterface::promote_extent_ret;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user