Skip to content

Commit 2ee1884

Browse files
authored
Merge pull request ceph#65061 from zhscn/wip-replay-backref-retire
crimson/os/seastore: add retire alloc remarks for backref extents to skip replay invalid deltas Reviewed-by: Myoungwon Oh <[email protected]> Reviewed-by: Matan Breizman <[email protected]> Reviewed-by: Xuehan Xu <[email protected]>
2 parents 94bb77d + 56023c3 commit 2ee1884

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/crimson/os/seastore/cache.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,14 @@ record_t Cache::prepare_record(
14361436
extent->get_length(),
14371437
extent->get_type()));
14381438
} else if (is_backref_node(extent->get_type())) {
1439+
// The retire alloc deltas are used to identify the invalid backref extent
1440+
// deltas during replay when using CircularBoundedJournal, see
1441+
// build_paddr_seq_map in CBJournal::replay().
1442+
rel_delta.alloc_blk_ranges.emplace_back(
1443+
alloc_blk_t::create_retire(
1444+
extent->get_paddr(),
1445+
extent->get_length(),
1446+
extent->get_type()));
14391447
remove_backref_extent(extent->get_paddr());
14401448
} else {
14411449
ERRORT("Got unexpected extent type: {}", t, *extent);
@@ -2042,6 +2050,14 @@ Cache::replay_delta(
20422050
decode(alloc_delta, delta.bl);
20432051
backref_entry_refs_t backref_entries;
20442052
for (auto &alloc_blk : alloc_delta.alloc_blk_ranges) {
2053+
if (is_backref_node(alloc_blk.type)) {
2054+
// On startup, BackrefManager::scan_mapped_space() will scan all
2055+
// mappings and internal entries to rebuild the space management.
2056+
// It's unnecessary to apply the alloc deltas of backref extents
2057+
// to the cached backref entries and these deltas are only used
2058+
// to skip invalid deltas for RBM backends.
2059+
continue;
2060+
}
20452061
if (alloc_blk.paddr.is_record_relative()) {
20462062
alloc_blk.paddr = record_base.add_relative(alloc_blk.paddr);
20472063
} else {

src/crimson/os/seastore/seastore_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,6 +2107,7 @@ struct alloc_blk_t {
21072107
extent_len_t len,
21082108
extent_types_t type) {
21092109
assert(is_backref_mapped_type(type) ||
2110+
is_backref_node(type) ||
21102111
is_retired_placeholder_type(type));
21112112
return alloc_blk_t(paddr, L_ADDR_NULL, len, type);
21122113
}

0 commit comments

Comments
 (0)