Skip to content

Commit

Permalink
Merge pull request ceph#57035 from xxhdx1985126/wip-65610
Browse files Browse the repository at this point in the history
test/crimson/seastore/test_object_data_handler: remap pins through the transaction that created the pins

Reviewed-by: Yingxin Cheng <[email protected]>
  • Loading branch information
cyx1231st authored Apr 26, 2024
2 parents 96bb73a + 02acc0a commit 8e9f5c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/crimson/os/seastore/btree/btree_range_pin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BtreeNodeMapping<key_t, val_t>::get_logical_extent(
assert(parent);
assert(parent->is_valid());
assert(pos != std::numeric_limits<uint16_t>::max());
ceph_assert(t.get_trans_id() == ctx.trans.get_trans_id());
auto &p = (FixedKVNode<key_t>&)*parent;
auto k = this->is_indirect()
? this->get_intermediate_base()
Expand Down
11 changes: 10 additions & 1 deletion src/test/crimson/seastore/test_object_data_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ struct object_data_handler_test_t:
}
}
}
std::list<LBAMappingRef> get_mappings(
Transaction &t,
objaddr_t offset,
extent_len_t length) {
auto ret = with_trans_intr(t, [&](auto &t) {
return tm->get_pins(t, offset, length);
}).unsafe_get0();
return ret;
}
std::list<LBAMappingRef> get_mappings(objaddr_t offset, extent_len_t length) {
auto t = create_mutate_transaction();
auto ret = with_trans_intr(*t, [&](auto &t) {
Expand Down Expand Up @@ -758,7 +767,7 @@ TEST_P(object_data_handler_test_t, overwrite_then_read_within_transaction) {

t = create_mutate_transaction();
{
auto pins = get_mappings(base, len);
auto pins = get_mappings(*t, base, len);
assert(pins.size() == 1);
auto pin1 = remap_pin(*t, std::move(pins.front()), 4096, 8192);
auto ext = get_extent(*t, base + 4096, 4096 * 2);
Expand Down

0 comments on commit 8e9f5c5

Please sign in to comment.