init_managers();
return transaction_manager->mount();
}).safe_then([this] {
+
+ ++(shard_stats.io_num);
+ ++(shard_stats.pending_io_num);
+ // For TM::submit_transaction()
+ ++(shard_stats.processing_inlock_io_num);
+
return repeat_eagain([this] {
+ ++(shard_stats.repeat_io_num);
+
return transaction_manager->with_transaction_intr(
Transaction::src_t::MUTATE,
"mkfs_seastore",
crimson::ct_error::assert_all{
"Invalid error in Shard::mkfs_managers"
}
- );
+ ).finally([this] {
+ assert(shard_stats.pending_io_num);
+ --(shard_stats.pending_io_num);
+ // XXX: it's wrong to assume no failure
+ --(shard_stats.processing_postlock_io_num);
+ });
}
seastar::future<> SeaStore::set_secondaries()
const ghobject_t& end,
uint64_t limit) const
{
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
ceph_assert(start <= end);
using list_iertr = OnodeManager::list_onodes_iertr;
using RetType = typename OnodeManager::list_onodes_bare_ret;
std::move(limit),
[this, ch, start, end](auto& ret, auto& limit) {
return repeat_eagain([this, ch, start, end, &limit, &ret] {
+ ++(shard_stats.repeat_read_num);
+
return transaction_manager->with_transaction_intr(
Transaction::src_t::READ,
"list_objects",
"Invalid error in SeaStore::list_objects"
}
);
+ }).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
});
}
seastar::future<std::vector<coll_core_t>>
SeaStore::Shard::list_collections()
{
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
return seastar::do_with(
std::vector<coll_core_t>(),
[this](auto &ret) {
return repeat_eagain([this, &ret] {
+ ++(shard_stats.repeat_read_num);
+
return transaction_manager->with_transaction_intr(
Transaction::src_t::READ,
"list_collections",
crimson::ct_error::assert_all{
"Invalid error in SeaStore::list_collections"
}
- );
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
+ });
}
SeaStore::Shard::read_errorator::future<ceph::bufferlist>
{
LOG_PREFIX(SeaStore::read);
DEBUG("oid {} offset {} len {}", oid, offset, len);
+
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
return repeat_with_onode<ceph::bufferlist>(
ch,
oid,
},
offset,
corrected_len);
- });
+ }
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
+ });
}
SeaStore::Shard::base_errorator::future<bool>
{
LOG_PREFIX(SeaStore::exists);
DEBUG("oid {}", oid);
+
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
return repeat_with_onode<bool>(
c,
oid,
return seastar::make_ready_future<bool>(false);
}),
crimson::ct_error::assert_all{"unexpected error"}
- );
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
+ });
}
SeaStore::Shard::read_errorator::future<ceph::bufferlist>
auto c = static_cast<SeastoreCollection*>(ch.get());
LOG_PREFIX(SeaStore::get_attr);
DEBUG("{} {}", c->get_cid(), oid);
+
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
return repeat_with_onode<ceph::bufferlist>(
c,
oid,
).handle_error(
crimson::ct_error::input_output_error::assert_failure{
"EIO when getting attrs"},
- crimson::ct_error::pass_further_all{});
+ crimson::ct_error::pass_further_all{}
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
+ });
}
SeaStore::Shard::get_attrs_ertr::future<SeaStore::Shard::attrs_t>
LOG_PREFIX(SeaStore::get_attrs);
auto c = static_cast<SeastoreCollection*>(ch.get());
DEBUG("{} {}", c->get_cid(), oid);
+
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
return repeat_with_onode<attrs_t>(
c,
oid,
).handle_error(
crimson::ct_error::input_output_error::assert_failure{
"EIO when getting attrs"},
- crimson::ct_error::pass_further_all{});
+ crimson::ct_error::pass_further_all{}
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
+ });
}
seastar::future<struct stat> SeaStore::Shard::stat(
CollectionRef c,
const ghobject_t& oid)
{
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
LOG_PREFIX(SeaStore::stat);
return repeat_with_onode<struct stat>(
c,
crimson::ct_error::assert_all{
"Invalid error in SeaStore::stat"
}
- );
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
+ });
}
SeaStore::Shard::get_attr_errorator::future<ceph::bufferlist>
const ghobject_t &oid,
const omap_keys_t &keys)
{
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
auto c = static_cast<SeastoreCollection*>(ch.get());
return repeat_with_onode<omap_values_t>(
c,
t,
std::move(omap_root),
keys);
- });
+ }
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
+ });
}
SeaStore::Shard::_omap_get_value_ret
auto c = static_cast<SeastoreCollection*>(ch.get());
LOG_PREFIX(SeaStore::omap_get_values);
DEBUG("{} {}", c->get_cid(), oid);
+
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
using ret_bare_t = std::tuple<bool, SeaStore::Shard::omap_values_t>;
return repeat_with_onode<ret_bare_t>(
c,
OMapManager::omap_list_config_t()
.with_inclusive(false, false)
.without_max());
+ }
+ ).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
});
}
{
LOG_PREFIX(SeaStore::fiemap);
DEBUG("oid: {}, off: {}, len: {} ", oid, off, len);
+
+ ++(shard_stats.read_num);
+ ++(shard_stats.pending_read_num);
+
return repeat_with_onode<std::map<uint64_t, uint64_t>>(
ch,
oid,
size - off:
std::min(size - off, len);
return _fiemap(t, onode, off, adjust_len);
+ }).finally([this] {
+ assert(shard_stats.pending_read_num);
+ --(shard_stats.pending_read_num);
});
}
CollectionRef _ch,
ceph::os::Transaction&& _t)
{
+ ++(shard_stats.io_num);
+ ++(shard_stats.pending_io_num);
+ ++(shard_stats.starting_io_num);
+
// repeat_with_internal_context ensures ordering via collection lock
return repeat_with_internal_context(
_ch,
return transaction_manager->submit_transaction(*ctx.transaction);
});
});
- });
+ }
+ ).finally([this] {
+ assert(shard_stats.pending_io_num);
+ --(shard_stats.pending_io_num);
+ // XXX: it's wrong to assume no failure
+ --(shard_stats.processing_postlock_io_num);
+ });
}
seastar::future<> SeaStore::Shard::flush(CollectionRef ch)
{
+ ++(shard_stats.flush_num);
+ ++(shard_stats.pending_flush_num);
+
return seastar::do_with(
get_dummy_ordering_handle(),
[this, ch](auto &handle) {
).then([this, &handle] {
return transaction_manager->flush(handle);
});
- });
+ }
+ ).finally([this] {
+ assert(shard_stats.pending_flush_num);
+ --(shard_stats.pending_flush_num);
+ });
}
SeaStore::Shard::tm_ret
{
LOG_PREFIX(SeaStore::write_meta);
DEBUG("key: {}; value: {}", key, value);
+
+ ++(shard_stats.io_num);
+ ++(shard_stats.pending_io_num);
+ // For TM::submit_transaction()
+ ++(shard_stats.processing_inlock_io_num);
+
return seastar::do_with(
key, value,
[this, FNAME](auto& key, auto& value) {
return repeat_eagain([this, FNAME, &key, &value] {
+ ++(shard_stats.repeat_io_num);
+
return transaction_manager->with_transaction_intr(
Transaction::src_t::MUTATE,
"write_meta",
});
});
});
- }).handle_error(
- crimson::ct_error::assert_all{"Invalid error in SeaStore::write_meta"}
- );
+ }
+ ).handle_error(
+ crimson::ct_error::assert_all{"Invalid error in SeaStore::write_meta"}
+ ).finally([this] {
+ assert(shard_stats.pending_io_num);
+ --(shard_stats.pending_io_num);
+ // XXX: it's wrong to assume no failure,
+ // but failure leads to fatal error
+ --(shard_stats.processing_postlock_io_num);
+ });
}
seastar::future<std::tuple<int, std::string>>
transaction_manager.reset();
collection_manager.reset();
onode_manager.reset();
+ shard_stats = {};
transaction_manager = make_transaction_manager(
device, secondaries, is_test);