return shard_stores.invoke_on_all(
[](auto &local_store) {
return local_store.mount().handle_error(
- crimson::stateful_ec::assert_failure([](const auto& ec) {
- crimson::get_logger(ceph_subsys_cyanstore).error(
- "error mounting cyanstore: ({}) {}",
- ec.value(), ec.message());
- }));
+ crimson::stateful_ec::assert_failure(
+ fmt::format("error mounting cyanstore").c_str()));
});
}
return c.nm.get_super(c.t, root_tracker
).handle_error_interruptible(
eagain_iertr::pass_further{},
- crimson::ct_error::input_output_error::assert_failure([FNAME, c] {
- ERRORT("EIO during get_super()", c.t);
- })
+ crimson::ct_error::input_output_error::assert_failure(fmt::format(
+ "{} EIO during get_super()", FNAME).c_str())
).si_then([c, &root_tracker, FNAME](auto&& _super) {
assert(_super);
auto root_addr = _super->get_root_laddr();
return c.nm.read_extent(c.t, addr
).handle_error_interruptible(
eagain_iertr::pass_further{},
- crimson::ct_error::input_output_error::assert_failure(
- [FNAME, c, addr, expect_is_level_tail] {
- ERRORT("EIO -- addr={}, is_level_tail={}",
- c.t, addr, expect_is_level_tail);
- }),
- crimson::ct_error::invarg::assert_failure(
- [FNAME, c, addr, expect_is_level_tail] {
- ERRORT("EINVAL -- addr={}, is_level_tail={}",
- c.t, addr, expect_is_level_tail);
- }),
- crimson::ct_error::enoent::assert_failure(
- [FNAME, c, addr, expect_is_level_tail] {
- ERRORT("ENOENT -- addr={}, is_level_tail={}",
- c.t, addr, expect_is_level_tail);
- }),
- crimson::ct_error::erange::assert_failure(
- [FNAME, c, addr, expect_is_level_tail] {
- ERRORT("ERANGE -- addr={}, is_level_tail={}",
- c.t, addr, expect_is_level_tail);
- })
+ crimson::ct_error::assert_all(fmt::format(
+ "{} -- addr={}, is_level_tail={}", FNAME, addr, expect_is_level_tail).c_str())
).si_then([FNAME, c, addr, expect_is_level_tail](auto extent)
-> eagain_ifuture<Ref<Node>> {
assert(extent);
return c.nm.get_super(c.t, root_tracker
).handle_error_interruptible(
eagain_iertr::pass_further{},
- crimson::ct_error::input_output_error::assert_failure([FNAME, c] {
- ERRORT("EIO during get_super()", c.t);
- })
+ crimson::ct_error::input_output_error::assert_failure(fmt::format(
+ "{} EIO during get_super()", FNAME).c_str())
).si_then([c, root](auto&& super) {
assert(super);
root->make_root_new(c, std::move(super));
return c.nm.alloc_extent(c.t, hint, alloc_size
).handle_error_interruptible(
eagain_iertr::pass_further{},
- crimson::ct_error::input_output_error::assert_failure(
- [FNAME, c, alloc_size, l_to_discard = extent->get_laddr()] {
- SUBERRORT(seastore_onode,
- "EIO during allocate -- node_size={}, to_discard={}",
- c.t, alloc_size, l_to_discard);
- })
+ crimson::ct_error::input_output_error::assert_failure(fmt::format(
+ "{} during allocate -- node_size={}, to_discard={}",
+ FNAME, alloc_size, extent->get_laddr()).c_str())
).si_then([this, c, FNAME] (auto fresh_extent) {
SUBDEBUGT(seastore_onode,
"update addr from {} to {} ...",
return c.nm.retire_extent(c.t, to_discard
).handle_error_interruptible(
eagain_iertr::pass_further{},
- crimson::ct_error::input_output_error::assert_failure(
- [FNAME, c, l_to_discard = to_discard->get_laddr(),
- l_fresh = fresh_extent->get_laddr()] {
- SUBERRORT(seastore_onode,
- "EIO during retire -- to_disgard={}, fresh={}",
- c.t, l_to_discard, l_fresh);
- }),
- crimson::ct_error::enoent::assert_failure(
- [FNAME, c, l_to_discard = to_discard->get_laddr(),
- l_fresh = fresh_extent->get_laddr()] {
- SUBERRORT(seastore_onode,
- "ENOENT during retire -- to_disgard={}, fresh={}",
- c.t, l_to_discard, l_fresh);
- })
+ crimson::ct_error::assert_all(fmt::format(
+ "{} during retire -- to_disgard={}, fresh={}",
+ FNAME, to_discard->get_laddr(), fresh_extent->get_laddr()).c_str())
);
}).si_then([this, c] {
boost::ignore_unused(c); // avoid clang warning;
return c.nm.retire_extent(c.t, std::move(extent)
).handle_error_interruptible(
eagain_iertr::pass_further{},
- crimson::ct_error::input_output_error::assert_failure(
- [FNAME, c, addr] {
- SUBERRORT(seastore_onode, "EIO -- addr={}", c.t, addr);
- }),
- crimson::ct_error::enoent::assert_failure(
- [FNAME, c, addr] {
- SUBERRORT(seastore_onode, "ENOENT -- addr={}", c.t, addr);
- })
+ crimson::ct_error::assert_all(fmt::format(
+ "{} addr={}", FNAME, addr).c_str())
#ifndef NDEBUG
).si_then([c] {
assert(!c.t.is_conflicted());
return c.nm.alloc_extent(c.t, hint, extent_size
).handle_error_interruptible(
eagain_iertr::pass_further{},
- crimson::ct_error::input_output_error::assert_failure(
- [FNAME, c, extent_size, is_level_tail, level] {
- SUBERRORT(seastore_onode,
- "EIO -- extent_size={}, is_level_tail={}, level={}",
- c.t, extent_size, is_level_tail, level);
- })
+ crimson::ct_error::input_output_error::assert_failure(fmt::format(
+ "{} extent_size={}, is_level_tail={}, level={}",
+ FNAME, extent_size, is_level_tail, level).c_str())
).si_then([is_level_tail, level](auto extent) {
assert(extent);
assert(extent->is_initial_pending());
co_await store.start();
co_await store.mkfs(osd_uuid).handle_error(
- crimson::stateful_ec::assert_failure([FNAME] (const auto& ec) {
- ERROR("error creating empty object store in {}: ({}) {}",
- local_conf().get_val<std::string>("osd_data"),
- ec.value(), ec.message());
- }));
+ crimson::stateful_ec::assert_failure(fmt::format(
+ "{} error creating empty object store in {}",
+ FNAME, local_conf().get_val<std::string>("osd_data")).c_str())
+ );
co_await store.mount().handle_error(
- crimson::stateful_ec::assert_failure([FNAME](const auto& ec) {
- ERROR("error mounting object store in {}: ({}) {}",
- local_conf().get_val<std::string>("osd_data"),
- ec.value(), ec.message());
- }));
+ crimson::stateful_ec::assert_failure(fmt::format(
+ "{} error mounting object store in {}",
+ FNAME, local_conf().get_val<std::string>("osd_data")).c_str())
+ );
{
auto meta_coll = co_await open_or_create_meta_coll(store);
whoami, get_shard_services(),
*monc, *hb_front_msgr, *hb_back_msgr});
return store.mount().handle_error(
- crimson::stateful_ec::assert_failure([FNAME] (const auto& ec) {
- ERROR("error mounting object store in {}: ({}) {}",
- local_conf().get_val<std::string>("osd_data"),
- ec.value(), ec.message());
- }));
+ crimson::stateful_ec::assert_failure(fmt::format(
+ "{} error mounting object store in {}",
+ FNAME, local_conf().get_val<std::string>("osd_data")).c_str())
+ );
}).then([this, FNAME] {
auto stats_seconds = local_conf().get_val<int64_t>("crimson_osd_stat_interval");
if (stats_seconds > 0) {
uuid_d uuid;
uuid.generate_random();
return fs->mkfs(uuid).handle_error(
- crimson::stateful_ec::assert_failure([] (const auto& ec) {
- crimson::get_logger(ceph_subsys_test)
- .error("error creating empty object store in {}: ({}) {}",
- crimson::common::local_conf().get_val<std::string>("osd_data"),
- ec.value(), ec.message());
- }));
+ crimson::stateful_ec::assert_failure(fmt::format(
+ "error creating empty object store in {}",
+ crimson::common::local_conf().get_val<std::string>("osd_data")).c_str())
+);
}).then([this] {
return fs->stop();
}).then([this] {
}).then([this] {
return fs->mount(
).handle_error(
- crimson::stateful_ec::assert_failure([] (const auto& ec) {
- crimson::get_logger(
- ceph_subsys_test
- ).error(
- "error mounting object store in {}: ({}) {}",
- crimson::common::local_conf().get_val<std::string>("osd_data"),
- ec.value(),
- ec.message());
- }));
+ crimson::stateful_ec::assert_failure(fmt::format(
+ "error creating empty object store in {}",
+ crimson::common::local_conf().get_val<std::string>("osd_data")).c_str())
+ );
}).then([this] {
return seastar::do_for_each(
boost::counting_iterator<unsigned>(0),
}).then([this] {
return fs->mount(
).handle_error(
- crimson::stateful_ec::assert_failure([] (const auto& ec) {
- crimson::get_logger(
- ceph_subsys_test
- ).error(
- "error mounting object store in {}: ({}) {}",
- crimson::common::local_conf().get_val<std::string>("osd_data"),
- ec.value(),
- ec.message());
- }));
+ crimson::stateful_ec::assert_failure(fmt::format(
+ "error creating empty object store in {}",
+ crimson::common::local_conf().get_val<std::string>("osd_data")).c_str())
+ );
}).then([this] {
return seastar::do_for_each(
boost::counting_iterator<unsigned>(0),