return get_root(t).safe_then([this, &t](auto croot) {
duplicate_for_write(t, croot);
return mkfs_ertr::now();
- });
+ }).handle_error(
+ mkfs_ertr::pass_further{},
+ crimson::ct_error::assert_all{}
+ );
}
Cache::close_ertr::future<> Cache::close()
return replay_delta_ertr::now();
} else {
auto get_extent_if_cached = [this](paddr_t addr)
- -> replay_delta_ertr::future<CachedExtentRef> {
+ -> get_extent_ertr::future<CachedExtentRef> {
auto retiter = extents.find_offset(addr);
if (retiter != extents.end()) {
- return replay_delta_ertr::make_ready_future<CachedExtentRef>(&*retiter);
+ return seastar::make_ready_future<CachedExtentRef>(&*retiter);
} else {
- return replay_delta_ertr::make_ready_future<CachedExtentRef>();
+ return seastar::make_ready_future<CachedExtentRef>();
}
};
- auto extent_fut = delta.pversion == 0 ?
+ auto extent_fut = (delta.pversion == 0 ?
get_extent_by_type(
delta.type,
delta.paddr,
delta.laddr,
delta.length) :
get_extent_if_cached(
- delta.paddr);
+ delta.paddr)
+ ).handle_error(
+ replay_delta_ertr::pass_further{},
+ crimson::ct_error::assert_all{}
+ );
return extent_fut.safe_then([=, &delta](auto extent) {
if (!extent) {
assert(delta.pversion > 0);
*/
class Cache {
public:
+ using base_ertr = crimson::errorator<
+ crimson::ct_error::input_output_error,
+ crimson::ct_error::eagain>;
+
Cache(SegmentManager &segment_manager);
~Cache();
}
/// Declare paddr retired in t, noop if not cached
- using retire_extent_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using retire_extent_ertr = base_ertr;
using retire_extent_ret = retire_extent_ertr::future<>;
retire_extent_ret retire_extent_if_cached(
Transaction &t, paddr_t addr);
*
* returns ref to current root or t.root if modified in t
*/
- using get_root_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using get_root_ertr = base_ertr;
using get_root_ret = get_root_ertr::future<RootBlockRef>;
get_root_ret get_root(Transaction &t);
* - extent_set if already in cache
* - disk
*/
- using get_extent_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using get_extent_ertr = base_ertr;
template <typename T>
get_extent_ertr::future<TCachedExtentRef<T>> get_extent(
paddr_t offset, ///< [in] starting addr
return crimson::do_for_each(
refs,
[&t, &f](auto &e) { return f(t, e); });
- });
+ }).handle_error(
+ init_cached_extents_ertr::pass_further{},
+ crimson::ct_error::assert_all{}
+ );
}
/**
});
}
- using retire_ertr = crimson::errorator<
- crimson::ct_error::enoent,
- crimson::ct_error::input_output_error>;
+ using retire_ertr = TransactionManager::ref_ertr;
using retire_ret = retire_ertr::future<std::list<unsigned>>;
retire_ret
extmap_retire_node(ext_context_t ec, std::list<laddr_t> dec_laddrs) {
*/
class LBAManager {
public:
+ using base_ertr = Cache::get_extent_ertr;
+
using mkfs_ertr = crimson::errorator<
crimson::ct_error::input_output_error>;
using mkfs_ret = mkfs_ertr::future<>;
*
* Future will not resolve until all pins have resolved (set_paddr called)
*/
- using get_mapping_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using get_mapping_ertr = base_ertr;
using get_mapping_ret = get_mapping_ertr::future<lba_pin_list_t>;
virtual get_mapping_ret get_mapping(
Transaction &t,
*
* Future will not result until all pins have resolved (set_paddr called)
*/
- using get_mappings_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using get_mappings_ertr = base_ertr;
using get_mappings_ret = get_mapping_ertr::future<lba_pin_list_t>;
virtual get_mappings_ret get_mappings(
Transaction &t,
* This mapping will block from transaction submission until set_paddr
* is called on the LBAPin.
*/
- using alloc_extent_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using alloc_extent_ertr = base_ertr;
using alloc_extent_ret = alloc_extent_ertr::future<LBAPinRef>;
virtual alloc_extent_ret alloc_extent(
Transaction &t,
*
* off~len must be unreferenced
*/
- using set_extent_ertr = crimson::errorator<
- crimson::ct_error::input_output_error,
+ using set_extent_ertr = base_ertr::extend<
crimson::ct_error::invarg>;
using set_extent_ret = set_extent_ertr::future<LBAPinRef>;
virtual set_extent_ret set_extent(
unsigned refcount = 0;
paddr_t addr;
};
- using ref_ertr = crimson::errorator<
- crimson::ct_error::enoent,
- crimson::ct_error::input_output_error>;
+ using ref_ertr = base_ertr::extend<
+ crimson::ct_error::enoent>;
using ref_ret = ref_ertr::future<ref_update_result_t>;
/**
Transaction &t,
laddr_t addr) = 0;
- using complete_transaction_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using complete_transaction_ertr = base_ertr;
using complete_transaction_ret = complete_transaction_ertr::future<>;
virtual complete_transaction_ret complete_transaction(
Transaction &t) = 0;
* LogicalCachedExtent's and may also read in any dependent
* structures, etc.
*/
- using init_cached_extent_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using init_cached_extent_ertr = base_ertr;
using init_cached_extent_ret = init_cached_extent_ertr::future<>;
virtual init_cached_extent_ret init_cached_extent(
Transaction &t,
/**
* Calls f for each mapping in [begin, end)
*/
- using scan_mappings_ertr = SegmentManager::read_ertr;
+ using scan_mappings_ertr = base_ertr;
using scan_mappings_ret = scan_mappings_ertr::future<>;
using scan_mappings_func_t = std::function<
void(laddr_t, paddr_t, extent_len_t)>;
/**
* Calls f for each mapped space usage in [begin, end)
*/
- using scan_mapped_space_ertr = SegmentManager::read_ertr;
+ using scan_mapped_space_ertr = base_ertr::extend_ertr<
+ SegmentManager::read_ertr>;
using scan_mapped_space_ret = scan_mapped_space_ertr::future<>;
using scan_mapped_space_func_t = std::function<
void(paddr_t, extent_len_t)>;
*
* rewrite extent into passed transaction
*/
- using rewrite_extent_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using rewrite_extent_ertr = base_ertr;
using rewrite_extent_ret = rewrite_extent_ertr::future<>;
virtual rewrite_extent_ret rewrite_extent(
Transaction &t,
*
* Returns a null CachedExtentRef if extent is not live.
*/
- using get_physical_extent_if_live_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using get_physical_extent_if_live_ertr = base_ertr;
using get_physical_extent_if_live_ret =
get_physical_extent_if_live_ertr::future<CachedExtentRef>;
virtual get_physical_extent_if_live_ret get_physical_extent_if_live(
make_record_relative_paddr(0),
L_ADDR_NULL};
return mkfs_ertr::now();
- });
+ }).handle_error(
+ mkfs_ertr::pass_further{},
+ crimson::ct_error::assert_all{}
+ );
}
BtreeLBAManager::get_root_ret
*
* Get a reference to the root LBANode.
*/
- using get_root_ertr = Cache::get_extent_ertr;
+ using get_root_ertr = base_ertr;
using get_root_ret = get_root_ertr::future<LBANodeRef>;
get_root_ret get_root(Transaction &);
*
* Insert a lba mapping into the tree
*/
- using insert_mapping_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using insert_mapping_ertr = base_ertr;
using insert_mapping_ret = insert_mapping_ertr::future<LBAPinRef>;
insert_mapping_ret insert_mapping(
Transaction &t, ///< [in,out] transaction
namespace crimson::os::seastore::lba_manager::btree {
+using base_ertr = LBAManager::base_ertr;
+
struct op_context_t {
Cache &cache;
btree_pin_set_t &pins;
* Returns the node at the specified depth responsible
* for laddr
*/
- using lookup_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using lookup_ertr = base_ertr;
using lookup_ret = lookup_ertr::future<LBANodeRef>;
virtual lookup_ret lookup(
op_context_t c,
*
* Precondition: !at_max_capacity()
*/
- using insert_ertr = crimson::errorator<
- crimson::ct_error::input_output_error
- >;
+ using insert_ertr = base_ertr;
using insert_ret = insert_ertr::future<LBAPinRef>;
virtual insert_ret insert(
op_context_t c,
*
* @return addr of hole, L_ADDR_NULL if unfound
*/
- using find_hole_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using find_hole_ertr = base_ertr;
using find_hole_ret = find_hole_ertr::future<laddr_t>;
virtual find_hole_ret find_hole(
op_context_t c,
*
* Precondition: !at_min_capacity()
*/
- using mutate_mapping_ertr = crimson::errorator<
- crimson::ct_error::enoent, ///< mapping does not exist
- crimson::ct_error::input_output_error
+ using mutate_mapping_ertr = base_ertr::extend<
+ crimson::ct_error::enoent ///< mapping does not exist
>;
using mutate_mapping_ret = mutate_mapping_ertr::future<
lba_map_val_t>;
* updates the mapping to paddr. Returns previous paddr
* (for debugging purposes).
*/
- using mutate_internal_address_ertr = crimson::errorator<
- crimson::ct_error::enoent, ///< mapping does not exist
- crimson::ct_error::input_output_error
+ using mutate_internal_address_ertr = base_ertr::extend<
+ crimson::ct_error::enoent ///< mapping does not exist
>;
using mutate_internal_address_ret = mutate_internal_address_ertr::future<
paddr_t>;
*
* Fetches node at depth of the appropriate type.
*/
-Cache::get_extent_ertr::future<LBANodeRef> get_lba_btree_extent(
+using get_lba_node_ertr = base_ertr;
+using get_lba_node_ret = get_lba_node_ertr::future<LBANodeRef>;
+get_lba_node_ret get_lba_btree_extent(
op_context_t c, ///< [in] context structure
depth_t depth, ///< [in] depth of node to fetch
paddr_t offset, ///< [in] physical addr of node
return bound(addr, addr + len);
}
-Cache::get_extent_ertr::future<LBANodeRef> get_lba_btree_extent(
+get_lba_node_ertr::future<LBANodeRef> get_lba_btree_extent(
op_context_t c,
depth_t depth,
paddr_t offset,
return std::make_pair(retl, retr);
}
- using split_ertr = crimson::errorator<
- crimson::ct_error::input_output_error
- >;
+ using split_ertr = base_ertr;
using split_ret = split_ertr::future<LBANodeRef>;
split_ret split_entry(
op_context_t c,
internal_iterator_t,
LBANodeRef entry);
- using merge_ertr = crimson::errorator<
- crimson::ct_error::input_output_error
- >;
+ using merge_ertr = base_ertr;
using merge_ret = merge_ertr::future<LBANodeRef>;
merge_ret merge_entry(
op_context_t c,
* until these functions future resolved.
*/
public:
+ using base_ertr = TransactionManager::base_ertr;
+
/**
* allocate omap tree root node
*
* @param Transaction &t, current transaction
* @retval return the omap_root_t structure.
*/
- using initialize_omap_ertr = TransactionManager::alloc_extent_ertr;
+ using initialize_omap_ertr = base_ertr;
using initialize_omap_ret = initialize_omap_ertr::future<omap_root_t>;
virtual initialize_omap_ret initialize_omap(Transaction &t) = 0;
* @param string &key, omap string key
* @retval return string key->string value mapping pair.
*/
- using omap_get_value_ertr = TransactionManager::read_extent_ertr;
+ using omap_get_value_ertr = base_ertr;
using omap_get_value_ret = omap_get_value_ertr::future<std::pair<std::string, std::string>>;
virtual omap_get_value_ret omap_get_value(const omap_root_t &omap_root, Transaction &t,
const std::string &key) = 0;
* @param string &value, mapped value corresponding key
* @retval mutation_result_t, status should be success.
*/
- using omap_set_key_ertr = TransactionManager::read_extent_ertr;
+ using omap_set_key_ertr = base_ertr;
using omap_set_key_ret = omap_set_key_ertr::future<bool>;
virtual omap_set_key_ret omap_set_key(omap_root_t &omap_root, Transaction &t,
const std::string &key, const std::string &value) = 0;
* @param string &key, omap string key
* @retval remove success return true, else return false.
*/
- using omap_rm_key_ertr = TransactionManager::read_extent_ertr;
+ using omap_rm_key_ertr = base_ertr;
using omap_rm_key_ret = omap_rm_key_ertr::future<bool>;
virtual omap_rm_key_ret omap_rm_key(omap_root_t &omap_root, Transaction &t,
const std::string &key) = 0;
* it it is not set, list all keys after string start
* @retval list_keys_result_t, listed keys and next key
*/
- using omap_list_keys_ertr = TransactionManager::read_extent_ertr;
+ using omap_list_keys_ertr = base_ertr;
using omap_list_keys_ret = omap_list_keys_ertr::future<list_keys_result_t>;
virtual omap_list_keys_ret omap_list_keys(const omap_root_t &omap_root, Transaction &t,
std::string &start,
* it it is not set, list all keys after string start.
* @retval list_kvs_result_t, listed key->value mapping and next key.
*/
- using omap_list_ertr = TransactionManager::read_extent_ertr;
+ using omap_list_ertr = base_ertr;
using omap_list_ret = omap_list_ertr::future<list_kvs_result_t>;
virtual omap_list_ret omap_list(const omap_root_t &omap_root, Transaction &t,
std::string &start,
* @param omap_root_t &omap_root, omap btree root information
* @param Transaction &t, current transaction
*/
- using omap_clear_ertr = TransactionManager::read_extent_ertr;
+ using omap_clear_ertr = base_ertr;
using omap_clear_ret = omap_clear_ertr::future<>;
virtual omap_clear_ret omap_clear(omap_root_t &omap_root, Transaction &t) = 0;
omap_root.omap_root_laddr = iter->get_node_key().laddr;
omap_root.depth -= 1;
omap_root.state = omap_root_state_t::MUTATED;
- return oc.tm.dec_ref(oc.t, root->get_laddr()).safe_then([] (auto &&ret) {
+ return oc.tm.dec_ref(oc.t, root->get_laddr()
+ ).safe_then([] (auto &&ret) {
return handle_root_merge_ertr::make_ready_future<bool>(true);
- });
+ }).handle_error(
+ handle_root_merge_ertr::pass_further{},
+ crimson::ct_error::assert_all{
+ "Invalid error in handle_root_merge"
+ }
+ );
}
omap_root.omap_root_laddr = L_ADDR_NULL;
return omap_clear_ertr::now();
});
- });
+ }).handle_error(
+ omap_clear_ertr::pass_further{},
+ crimson::ct_error::assert_all{
+ "Invalid error in BtreeOMapManager::omap_clear"
+ }
+ );
}
}
*
* load omap tree root node
*/
- using get_root_ertr = TransactionManager::read_extent_ertr;
+ using get_root_ertr = base_ertr;
using get_root_ret = get_root_ertr::future<OMapNodeRef>;
get_root_ret get_omap_root(const omap_root_t &omap_root, Transaction &t);
*
* root has been splitted and need update omap_root_t
*/
- using handle_root_split_ertr = TransactionManager::read_extent_ertr;
+ using handle_root_split_ertr = base_ertr;
using handle_root_split_ret = handle_root_split_ertr::future<bool>;
handle_root_split_ret handle_root_split(omap_root_t &omap_root, omap_context_t oc,
OMapNode:: mutation_result_t mresult);
*
* root node has only one item and it is not leaf node, need remove a layer
*/
- using handle_root_merge_ertr = TransactionManager::read_extent_ertr;
+ using handle_root_merge_ertr = base_ertr;
using handle_root_merge_ret = handle_root_merge_ertr::future<bool>;
handle_root_merge_ret handle_root_merge(omap_root_t &omap_root, omap_context_t oc,
OMapNode:: mutation_result_t mresult);
};
struct OMapNode : LogicalCachedExtent {
+ using base_ertr = OMapManager::base_ertr;
+
using OMapNodeRef = TCachedExtentRef<OMapNode>;
struct mutation_result_t {
OMapNode(const OMapNode &other)
: LogicalCachedExtent(other) {}
- using get_value_ertr = OMapManager::omap_get_value_ertr;
+ using get_value_ertr = base_ertr;
using get_value_ret = OMapManager::omap_get_value_ret;
virtual get_value_ret get_value(omap_context_t oc, const std::string &key) = 0;
- using insert_ertr = TransactionManager::alloc_extent_ertr;
+ using insert_ertr = base_ertr;
using insert_ret = insert_ertr::future<mutation_result_t>;
virtual insert_ret insert(omap_context_t oc, const std::string &key, const std::string &value) = 0;
- using rm_key_ertr = TransactionManager::alloc_extent_ertr;
+ using rm_key_ertr = base_ertr;
using rm_key_ret = rm_key_ertr::future<mutation_result_t>;
virtual rm_key_ret rm_key(omap_context_t oc, const std::string &key) = 0;
virtual list_keys_ret list_keys(omap_context_t oc, std::string &start,
size_t max_result_size) = 0;
- using list_ertr = OMapManager::omap_list_ertr;
+ using list_ertr = base_ertr;
using list_ret = OMapManager::omap_list_ret;
virtual list_ret list(omap_context_t oc, std::string &start, size_t max_result_size) = 0;
- using clear_ertr = OMapManager::omap_clear_ertr;
+ using clear_ertr = base_ertr;
using clear_ret = clear_ertr::future<>;
virtual clear_ret clear(omap_context_t oc) = 0;
- using full_merge_ertr = TransactionManager::alloc_extent_ertr;
+ using full_merge_ertr = base_ertr;
using full_merge_ret = full_merge_ertr::future<OMapNodeRef>;
virtual full_merge_ret make_full_merge(omap_context_t oc, OMapNodeRef right) = 0;
- using make_balanced_ertr = TransactionManager::alloc_extent_ertr;
+ using make_balanced_ertr = base_ertr;
using make_balanced_ret = make_balanced_ertr::future
<std::tuple<OMapNodeRef, OMapNodeRef, std::string>>;
virtual make_balanced_ret make_balanced(omap_context_t oc, OMapNodeRef _right) = 0;
using OMapNodeRef = OMapNode::OMapNodeRef;
-TransactionManager::read_extent_ertr::future<OMapNodeRef>
+using omap_load_extent_ertr = OMapNode::base_ertr;
+omap_load_extent_ertr::future<OMapNodeRef>
omap_load_extent(omap_context_t oc, laddr_t laddr, depth_t depth);
}
<< ", depth=" << get_meta().depth;
}
+using dec_ref_ertr = OMapInnerNode::base_ertr;
+using dec_ref_ret = dec_ref_ertr::future<>;
+template <typename... T>
+dec_ref_ret dec_ref(omap_context_t oc, T&&... addr) {
+ return oc.tm.dec_ref(oc.t, std::forward<T>(addr)...
+ ).handle_error(
+ dec_ref_ertr::pass_further{},
+ crimson::ct_error::assert_all{
+ "Invalid error in OMapInnerNode helper dec_ref"
+ }
+ ).safe_then([](auto &&e) {});
+}
+
/**
* make_split_insert
*
} else {
return make_split_insert(oc, iter + 1, pivot, right->get_laddr())
.safe_then([this, oc] (auto m_result) {
- return oc.tm.dec_ref(oc.t, get_laddr())
- .safe_then([m_result = std::move(m_result)] (auto ret) {
+ return dec_ref(oc, get_laddr())
+ .safe_then([m_result = std::move(m_result)] {
return insert_ret(
insert_ertr::ready_future_marker{},
m_result);
[oc] (auto &&extent) {
return extent->clear(oc);
}).safe_then([oc, laddr] {
- return oc.tm.dec_ref(oc.t, laddr);
- }).safe_then([ref = OMapNodeRef(this)] (auto ret){
+ return dec_ref(oc, laddr);
+ }).safe_then([ref = OMapNodeRef(this)] {
return clear_ertr::now();
});
});
journal_inner_remove(riter, maybe_get_delta_buffer());
//retire extent
std::vector<laddr_t> dec_laddrs {l->get_laddr(), r->get_laddr()};
- return oc.tm.dec_ref(oc.t, dec_laddrs).safe_then([this, oc] (auto &&ret) {
+ return dec_ref(oc, dec_laddrs).safe_then([this, oc] {
if (extent_is_below_min()) {
return merge_entry_ret(
merge_entry_ertr::ready_future_marker{},
journal_inner_replace(riter, replacement_r->get_laddr(),
replacement_pivot, maybe_get_delta_buffer());
std::vector<laddr_t> dec_laddrs{l->get_laddr(), r->get_laddr()};
- return oc.tm.dec_ref(oc.t, dec_laddrs).safe_then([] (auto &&ret) {
+ return dec_ref(oc, dec_laddrs).safe_then([] {
return merge_entry_ret(
merge_entry_ertr::ready_future_marker{},
mutation_result_t(mutation_status_t::SUCCESS, std::nullopt, std::nullopt));
return make_split_insert(oc, riter, replacement_pivot, replacement_r->get_laddr())
.safe_then([this, oc, l = l, r = r] (auto mresult) {
std::vector<laddr_t> dec_laddrs{l->get_laddr(), r->get_laddr(), get_laddr()};
- return oc.tm.dec_ref(oc.t, dec_laddrs)
- .safe_then([mresult = std::move(mresult)] (auto &&ret){
+ return dec_ref(oc, dec_laddrs)
+ .safe_then([mresult = std::move(mresult)] {
return merge_entry_ret(
merge_entry_ertr::ready_future_marker{},
mresult);
right->journal_leaf_insert(mut_iter, key, value, right->maybe_get_delta_buffer());
}
}
- return oc.tm.dec_ref(oc.t, get_laddr())
- .safe_then([tuple = std::move(tuple)] (auto ret) {
+ return dec_ref(oc, get_laddr())
+ .safe_then([tuple = std::move(tuple)] {
return insert_ret(
insert_ertr::ready_future_marker{},
mutation_result_t(mutation_status_t::WAS_SPLIT, tuple, std::nullopt));
}
-TransactionManager::read_extent_ertr::future<OMapNodeRef>
+omap_load_extent_ertr::future<OMapNodeRef>
omap_load_extent(omap_context_t oc, laddr_t laddr, depth_t depth)
{
ceph_assert(depth > 0);
if (depth > 1) {
- return oc.tm.read_extents<OMapInnerNode>(oc.t, laddr, OMAP_BLOCK_SIZE).safe_then(
+ return oc.tm.read_extents<OMapInnerNode>(oc.t, laddr, OMAP_BLOCK_SIZE
+ ).handle_error(
+ omap_load_extent_ertr::pass_further{},
+ crimson::ct_error::assert_all{ "Invalid error in omap_load_extent" }
+ ).safe_then(
[](auto&& extents) {
assert(extents.size() == 1);
[[maybe_unused]] auto [laddr, e] = extents.front();
- return TransactionManager::read_extent_ertr::make_ready_future<OMapNodeRef>(std::move(e));
+ return seastar::make_ready_future<OMapNodeRef>(std::move(e));
});
} else {
- return oc.tm.read_extents<OMapLeafNode>(oc.t, laddr, OMAP_BLOCK_SIZE).safe_then(
+ return oc.tm.read_extents<OMapLeafNode>(oc.t, laddr, OMAP_BLOCK_SIZE
+ ).handle_error(
+ omap_load_extent_ertr::pass_further{},
+ crimson::ct_error::assert_all{ "Invalid error in omap_load_extent" }
+ ).safe_then(
[](auto&& extents) {
assert(extents.size() == 1);
[[maybe_unused]] auto [laddr, e] = extents.front();
- return TransactionManager::read_extent_ertr::make_ready_future<OMapNodeRef>(std::move(e));
+ return seastar::make_ready_future<OMapNodeRef>(std::move(e));
});
}
}
clear_ret clear(omap_context_t oc) final;
- using split_children_ertr = TransactionManager::alloc_extent_ertr;
+ using split_children_ertr = base_ertr;
using split_children_ret = split_children_ertr::future
<std::tuple<OMapInnerNodeRef, OMapInnerNodeRef, std::string>>;
split_children_ret make_split_children(omap_context_t oc);
make_balanced_ret
make_balanced(omap_context_t oc, OMapNodeRef right) final;
- using make_split_insert_ertr = TransactionManager::alloc_extent_ertr;
+ using make_split_insert_ertr = base_ertr;
using make_split_insert_ret = make_split_insert_ertr::future<mutation_result_t>;
make_split_insert_ret make_split_insert(omap_context_t oc, internal_iterator_t iter,
std::string key, laddr_t laddr);
- using merge_entry_ertr = TransactionManager::read_extent_ertr;
+ using merge_entry_ertr = base_ertr;
using merge_entry_ret = merge_entry_ertr::future<mutation_result_t>;
merge_entry_ret merge_entry(omap_context_t oc,
internal_iterator_t iter, OMapNodeRef entry);
- using handle_split_ertr = TransactionManager::read_extent_ertr;
+ using handle_split_ertr = base_ertr;
using handle_split_ret = handle_split_ertr::future<mutation_result_t>;
handle_split_ret handle_split(omap_context_t oc, internal_iterator_t iter,
mutation_result_t mresult);
clear_ret clear(omap_context_t oc) final;
- using split_children_ertr = TransactionManager::alloc_extent_ertr;
+ using split_children_ertr = base_ertr;
using split_children_ret = split_children_ertr::future
<std::tuple<OMapLeafNodeRef, OMapLeafNodeRef, std::string>>;
split_children_ret make_split_children(omap_context_t oc);
crimson::ct_error::input_output_error,
crimson::ct_error::invarg,
crimson::ct_error::enoent,
- crimson::ct_error::erange>;
+ crimson::ct_error::erange,
+ crimson::ct_error::eagain>;
template <class ValueT=void>
using node_future = node_ertr::future<ValueT>;
crimson::ct_error::input_output_error,
crimson::ct_error::invarg,
crimson::ct_error::enoent,
- crimson::ct_error::erange>;
+ crimson::ct_error::erange,
+ crimson::ct_error::eagain>;
template <class ValueT=void>
using tm_future = tm_ertr::future<ValueT>;
crimson::ct_error::input_output_error,
crimson::ct_error::invarg,
crimson::ct_error::enoent,
- crimson::ct_error::erange>;
+ crimson::ct_error::erange,
+ crimson::ct_error::eagain
+ >;
virtual ~NodeImpl() = default;
virtual field_type_t field_type() const = 0;
crimson::ct_error::input_output_error,
crimson::ct_error::invarg,
crimson::ct_error::enoent,
- crimson::ct_error::erange>;
+ crimson::ct_error::erange,
+ crimson::ct_error::eagain>;
template <class ValueT=void>
using btree_future = btree_ertr::future<ValueT>;
limit
).then([=, &t](auto dirty_list) {
if (dirty_list.empty()) {
- return do_immediate_work_ertr::now();
+ return rewrite_dirty_ertr::now();
} else {
update_journal_tail_target(dirty_list.front()->get_dirty_from());
}
journal_seq_t bound ///< [in] return extents with dirty_from < bound
) = 0;
+ using extent_mapping_ertr = crimson::errorator<
+ crimson::ct_error::input_output_error,
+ crimson::ct_error::eagain>;
+
/**
* rewrite_extent
*
* handle finding the current instance if it is still alive and
* otherwise ignore it.
*/
- using rewrite_extent_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using rewrite_extent_ertr = extent_mapping_ertr;
using rewrite_extent_ret = rewrite_extent_ertr::future<>;
virtual rewrite_extent_ret rewrite_extent(
Transaction &t,
* See TransactionManager::get_extent_if_live and
* LBAManager::get_physical_extent_if_live.
*/
- using get_extent_if_live_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using get_extent_if_live_ertr = extent_mapping_ertr;
using get_extent_if_live_ret = get_extent_if_live_ertr::future<
CachedExtentRef>;
virtual get_extent_if_live_ret get_extent_if_live(
return space_tracker->equals(tracker);
}
+ using work_ertr = ExtentCallbackInterface::extent_mapping_ertr;
+
/**
* do_immediate_work
*
* will piggy-back work required to maintain deferred work
* constraints.
*/
- using do_immediate_work_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using do_immediate_work_ertr = work_ertr;
using do_immediate_work_ret = do_immediate_work_ertr::future<>;
do_immediate_work_ret do_immediate_work(
Transaction &t);
* back into do_deferred_work before returned timespan has elapsed,
* or a foreground operation occurs.
*/
- using do_deferred_work_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using do_deferred_work_ertr = work_ertr;
using do_deferred_work_ret = do_deferred_work_ertr::future<
ceph::timespan
>;
*
* Writes out dirty blocks dirtied earlier than limit.
*/
- using rewrite_dirty_ertr = crimson::errorator<
- crimson::ct_error::input_output_error>;
+ using rewrite_dirty_ertr = ExtentCallbackInterface::extent_mapping_ertr;
using rewrite_dirty_ret = rewrite_dirty_ertr::future<>;
rewrite_dirty_ret rewrite_dirty(
Transaction &t,
*
* Performs bytes worth of gc work on t.
*/
- using do_gc_ertr = SegmentManager::read_ertr;
+ using do_gc_ertr = ExtentCallbackInterface::extent_mapping_ertr::extend_ertr<
+ ExtentCallbackInterface::scan_extents_ertr>;
using do_gc_ret = do_gc_ertr::future<>;
do_gc_ret do_gc(
Transaction &t,
*/
class TransactionManager : public SegmentCleaner::ExtentCallbackInterface {
public:
+ using base_ertr = Cache::base_ertr;
+
TransactionManager(
SegmentManager &segment_manager,
SegmentCleaner &segment_cleaner,
/**
* Read extents corresponding to specified lba range
*/
- using read_extent_ertr = SegmentManager::read_ertr;
+ using read_extent_ertr = LBAManager::get_mapping_ertr::extend_ertr<
+ SegmentManager::read_ertr>;
template <typename T>
using read_extent_ret = read_extent_ertr::future<lextent_list_t<T>>;
template <typename T>
* Allocates a new block of type T with the minimum lba range of size len
* greater than hint.
*/
- using alloc_extent_ertr = SegmentManager::read_ertr;
+ using alloc_extent_ertr = LBAManager::alloc_extent_ertr;
template <typename T>
using alloc_extent_ret = alloc_extent_ertr::future<TCachedExtentRef<T>>;
template <typename T>
*
* Get onode-tree root logical address
*/
- using read_onode_root_ertr = crimson::errorator<
- crimson::ct_error::input_output_error
- >;
+ using read_onode_root_ertr = read_extent_ertr;
using read_onode_root_ret = read_onode_root_ertr::future<laddr_t>;
read_onode_root_ret read_onode_root(Transaction &t) {
return cache.get_root(t).safe_then([](auto croot) {