: PGBackend(cct, pg, store, coll, ch),
read_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener()),
rmw_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener(), *this),
- recovery_backend(cct, coll, ec_impl, this->sinfo, read_pipeline, unstable_hashinfo_registry, get_parent()->get_eclistener()),
+ recovery_backend(cct, coll, ec_impl, this->sinfo, read_pipeline, unstable_hashinfo_registry, get_parent()),
ec_impl(ec_impl),
sinfo(ec_impl->get_data_chunk_count(), stripe_width),
unstable_hashinfo_registry(cct, ec_impl) {
return recovery_backend.open_recovery_op();
}
+ECBackend::RecoveryBackend::RecoveryBackend(
+ CephContext* cct,
+ const coll_t &coll,
+ ceph::ErasureCodeInterfaceRef ec_impl,
+ const ECUtil::stripe_info_t& sinfo,
+ ReadPipeline& read_pipeline,
+ UnstableHashInfoRegistry& unstable_hashinfo_registry,
+ ECListener* parent)
+ : cct(cct),
+ coll(coll),
+ ec_impl(std::move(ec_impl)),
+ sinfo(sinfo),
+ read_pipeline(read_pipeline),
+ unstable_hashinfo_registry(unstable_hashinfo_registry),
+ parent(parent) {
+}
+
PGBackend::RecoveryHandle *ECBackend::RecoveryBackend::open_recovery_op()
{
return new ECRecoveryHandle;
RecoveryMessages rm;
};
+void ECBackend::ECRecoveryBackend::commit_txn_send_replies(
+ ceph::os::Transaction&& txn,
+ std::map<int, MOSDPGPushReply*> replies)
+{
+ txn.register_on_complete(
+ get_parent()->bless_context(
+ new SendPushReplies(
+ get_parent(),
+ get_osdmap_epoch(),
+ replies)));
+ get_parent()->queue_transaction(std::move(txn));
+}
+
void ECBackend::RecoveryBackend::dispatch_recovery_messages(RecoveryMessages &m, int priority)
{
for (map<pg_shard_t, vector<PushOp> >::iterator i = m.pushes.begin();
replies.insert(make_pair(i->first.osd, msg));
}
+#if 1
if (!replies.empty()) {
- (m.t).register_on_complete(
- get_parent()->bless_context(
- new SendPushReplies(
- get_parent(),
- get_osdmap_epoch(),
- replies)));
- get_parent()->queue_transaction(std::move(m.t));
- }
+ commit_txn_send_replies(std::move(m.t), std::move(replies));
+ }
+#endif
if (m.recovery_reads.empty())
return;
RecoveryBackend(CephContext* cct,
const coll_t &coll,
- ceph::ErasureCodeInterfaceRef ec_impl,
- const ECUtil::stripe_info_t& sinfo,
- ReadPipeline& read_pipeline,
- UnstableHashInfoRegistry& unstable_hashinfo_registry,
- ECListener* parent)
- : cct(cct),
- coll(coll),
- ec_impl(std::move(ec_impl)),
- sinfo(sinfo),
- read_pipeline(read_pipeline),
- unstable_hashinfo_registry(unstable_hashinfo_registry),
- parent(parent) {
- }
- // <<<----
+ ceph::ErasureCodeInterfaceRef ec_impl,
+ const ECUtil::stripe_info_t& sinfo,
+ ReadPipeline& read_pipeline,
+ UnstableHashInfoRegistry& unstable_hashinfo_registry,
+ ECListener* parent);
struct RecoveryOp {
hobject_t hoid;
eversion_t v;
sinfo.get_stripe_width());
}
+ virtual ~RecoveryBackend() = default;
+ virtual void commit_txn_send_replies(
+ ceph::os::Transaction&& txn,
+ std::map<int, MOSDPGPushReply*> replies) = 0;
void dispatch_recovery_messages(RecoveryMessages &m, int priority);
RecoveryHandle *open_recovery_op();
}
void _failed_push(const hobject_t &hoid, ECCommon::read_result_t &res);
};
+ struct ECRecoveryBackend : RecoveryBackend {
+ ECRecoveryBackend(CephContext* cct,
+ const coll_t &coll,
+ ceph::ErasureCodeInterfaceRef ec_impl,
+ const ECUtil::stripe_info_t& sinfo,
+ ReadPipeline& read_pipeline,
+ UnstableHashInfoRegistry& unstable_hashinfo_registry,
+ Listener* parent)
+ : RecoveryBackend(cct, coll, std::move(ec_impl), sinfo, read_pipeline, unstable_hashinfo_registry, parent->get_eclistener()),
+ parent(parent) {
+ }
+
+ void commit_txn_send_replies(
+ ceph::os::Transaction&& txn,
+ std::map<int, MOSDPGPushReply*> replies) override;
+
+ Listener *get_parent() const { return parent; }
+
+ private:
+ Listener *parent;
+ };
friend ostream &operator<<(ostream &lhs, const RecoveryBackend::RecoveryOp &rhs);
friend struct RecoveryMessages;
friend struct OnRecoveryReadComplete;
public:
struct ReadPipeline read_pipeline;
struct RMWPipeline rmw_pipeline;
- struct RecoveryBackend recovery_backend;
+ struct ECRecoveryBackend recovery_backend;
ceph::ErasureCodeInterfaceRef ec_impl;