ECBackend::CollectionRef coll,
crimson::osd::ShardServices& shard_services,
const ec_profile_t&,
- uint64_t)
- : PGBackend{shard, coll, shard_services}
+ uint64_t,
+ DoutPrefixProvider &dpp)
+ : PGBackend{shard, coll, shard_services, dpp}
{
// todo
}
CollectionRef coll,
crimson::osd::ShardServices& shard_services,
const ec_profile_t& ec_profile,
- uint64_t stripe_width);
+ uint64_t stripe_width,
+ DoutPrefixProvider &dpp);
seastar::future<> stop() final {
return seastar::now();
}
pool,
coll_ref,
shard_services,
- profile)),
+ profile,
+ *this)),
recovery_backend(
std::make_unique<ReplicatedRecoveryBackend>(
*this, shard_services, coll_ref, backend.get())),
const pg_pool_t& pool,
crimson::os::CollectionRef coll,
crimson::osd::ShardServices& shard_services,
- const ec_profile_t& ec_profile)
+ const ec_profile_t& ec_profile,
+ DoutPrefixProvider &dpp)
{
switch (pool.type) {
case pg_pool_t::TYPE_REPLICATED:
return std::make_unique<ReplicatedBackend>(pgid, pg_shard,
- coll, shard_services);
+ coll, shard_services,
+ dpp);
case pg_pool_t::TYPE_ERASURE:
return std::make_unique<ECBackend>(pg_shard.shard, coll, shard_services,
std::move(ec_profile),
- pool.stripe_width);
+ pool.stripe_width,
+ dpp);
default:
throw runtime_error(seastar::format("unsupported pool type '{}'",
pool.type));
PGBackend::PGBackend(shard_id_t shard,
CollectionRef coll,
- crimson::osd::ShardServices &shard_services)
+ crimson::osd::ShardServices &shard_services,
+ DoutPrefixProvider &dpp)
: shard{shard},
coll{coll},
shard_services{shard_services},
+ dpp{dpp},
store{&shard_services.get_store()}
{}
std::tuple<interruptible_future<>,
interruptible_future<crimson::osd::acked_peers_t>>;
PGBackend(shard_id_t shard, CollectionRef coll,
- crimson::osd::ShardServices &shard_services);
+ crimson::osd::ShardServices &shard_services,
+ DoutPrefixProvider &dpp);
virtual ~PGBackend() = default;
static std::unique_ptr<PGBackend> create(pg_t pgid,
const pg_shard_t pg_shard,
const pg_pool_t& pool,
crimson::os::CollectionRef coll,
crimson::osd::ShardServices& shard_services,
- const ec_profile_t& ec_profile);
+ const ec_profile_t& ec_profile,
+ DoutPrefixProvider &dpp);
using attrs_t =
std::map<std::string, ceph::bufferptr, std::less<>>;
using read_errorator = ll_read_errorator::extend<
const shard_id_t shard;
CollectionRef coll;
crimson::osd::ShardServices &shard_services;
+ DoutPrefixProvider &dpp; ///< provides log prefix context
crimson::os::FuturizedStore* store;
bool stopping = false;
std::optional<peering_info_t> peering;
#include "crimson/osd/shard_services.h"
#include "osd/PeeringState.h"
-namespace {
- seastar::logger& logger() {
- return crimson::get_logger(ceph_subsys_osd);
- }
-}
+SET_SUBSYS(osd);
ReplicatedBackend::ReplicatedBackend(pg_t pgid,
pg_shard_t whoami,
ReplicatedBackend::CollectionRef coll,
- crimson::osd::ShardServices& shard_services)
- : PGBackend{whoami.shard, coll, shard_services},
+ crimson::osd::ShardServices& shard_services,
+ DoutPrefixProvider &dpp)
+ : PGBackend{whoami.shard, coll, shard_services, dpp},
pgid{pgid},
whoami{whoami}
{}
epoch_t min_epoch, epoch_t map_epoch,
std::vector<pg_log_entry_t>&& log_entries)
{
+ LOG_PREFIX(ReplicatedBackend::_submit_transaction);
if (__builtin_expect(stopping, false)) {
throw crimson::common::system_shutdown_exception();
}
bufferlist encoded_txn;
encode(txn, encoded_txn);
- logger().debug("ReplicatedBackend::_submit_transaction: do_transaction...");
+ DEBUGDPP("object {}", dpp, hoid);
auto all_completed = interruptor::make_interruptible(
shard_services.get_store().do_transaction(coll, std::move(txn)))
.then_interruptible([this, peers=pending_txn->second.weak_from_this()] {
void ReplicatedBackend::got_rep_op_reply(const MOSDRepOpReply& reply)
{
+ LOG_PREFIX(ReplicatedBackend::got_rep_op_reply);
auto found = pending_trans.find(reply.get_tid());
if (found == pending_trans.end()) {
- logger().warn("{}: no matched pending rep op: {}", __func__, reply);
+ WARNDPP("cannot find rep op for message {}", dpp, reply);
return;
}
auto& peers = found->second;
seastar::future<> ReplicatedBackend::stop()
{
- logger().info("ReplicatedBackend::stop {}", coll->get_cid());
+ LOG_PREFIX(ReplicatedBackend::stop);
+ INFODPP("cid {}", coll->get_cid());
stopping = true;
for (auto& [tid, pending_on] : pending_trans) {
pending_on.all_committed.set_exception(
public:
ReplicatedBackend(pg_t pgid, pg_shard_t whoami,
CollectionRef coll,
- crimson::osd::ShardServices& shard_services);
+ crimson::osd::ShardServices& shard_services,
+ DoutPrefixProvider &dpp);
void got_rep_op_reply(const MOSDRepOpReply& reply) final;
seastar::future<> stop() final;
void on_actingset_changed(peering_info_t pi) final;