Skip to content

Commit 6e453e2

Browse files
committed
fixup: ECRcoveryBackend don't goes to disk as well
Signed-off-by: Radoslaw Zarzynski <[email protected]>
1 parent 0fc875a commit 6e453e2

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

src/osd/ECBackend.cc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ECBackend::ECBackend(
130130
: PGBackend(cct, pg, store, coll, ch),
131131
read_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener()),
132132
rmw_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener(), *this),
133-
recovery_backend(cct, coll, ec_impl, this->sinfo, read_pipeline, unstable_hashinfo_registry, get_parent()),
133+
recovery_backend(cct, coll, ec_impl, this->sinfo, read_pipeline, unstable_hashinfo_registry, get_parent(), this),
134134
ec_impl(ec_impl),
135135
sinfo(ec_impl->get_data_chunk_count(), stripe_width),
136136
unstable_hashinfo_registry(cct, ec_impl) {
@@ -150,14 +150,16 @@ ECBackend::RecoveryBackend::RecoveryBackend(
150150
const ECUtil::stripe_info_t& sinfo,
151151
ReadPipeline& read_pipeline,
152152
UnstableHashInfoRegistry& unstable_hashinfo_registry,
153-
ECListener* parent)
153+
ECListener* parent,
154+
ECBackend* ecbackend)
154155
: cct(cct),
155156
coll(coll),
156157
ec_impl(std::move(ec_impl)),
157158
sinfo(sinfo),
158159
read_pipeline(read_pipeline),
159160
unstable_hashinfo_registry(unstable_hashinfo_registry),
160-
parent(parent) {
161+
parent(parent),
162+
ecbackend(ecbackend) {
161163
}
162164

163165
PGBackend::RecoveryHandle *ECBackend::RecoveryBackend::open_recovery_op()
@@ -575,8 +577,12 @@ void ECBackend::RecoveryBackend::continue_recovery_op(
575577
uint64_t amount = get_recovery_chunk_size();
576578

577579
if (op.recovery_progress.first && op.obc) {
578-
/* We've got the attrs and the hinfo, might as well use them */
579-
op.hinfo = unstable_hashinfo_registry.get_hash_info(op.hoid, false, op.obc->attr_cache, op.obc->obs.oi.size);
580+
if (auto [r, attrs, size] = ecbackend->get_attrs_n_size_from_disk(op.hoid);
581+
r >= 0 || r == -ENOENT) {
582+
op.hinfo = unstable_hashinfo_registry.get_hash_info(op.hoid, false, attrs, size);
583+
} else {
584+
derr << __func__ << ": can't stat-or-getattr on " << op.hoid << dendl;
585+
}
580586
if (!op.hinfo) {
581587
derr << __func__ << ": " << op.hoid << " has inconsistent hinfo"
582588
<< dendl;

src/osd/ECBackend.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class ECBackend : public PGBackend, public ECCommon {
198198
UnstableHashInfoRegistry& unstable_hashinfo_registry;
199199
// TODO: lay an interface down here
200200
ECListener* parent;
201+
ECBackend* ecbackend;
201202

202203
ECListener *get_parent() const { return parent; }
203204
const OSDMapRef& get_osdmap() const { return get_parent()->pgb_get_osdmap(); }
@@ -212,7 +213,8 @@ class ECBackend : public PGBackend, public ECCommon {
212213
const ECUtil::stripe_info_t& sinfo,
213214
ReadPipeline& read_pipeline,
214215
UnstableHashInfoRegistry& unstable_hashinfo_registry,
215-
ECListener* parent);
216+
ECListener* parent,
217+
ECBackend* ecbackend);
216218
struct RecoveryOp {
217219
hobject_t hoid;
218220
eversion_t v;
@@ -307,8 +309,9 @@ class ECBackend : public PGBackend, public ECCommon {
307309
const ECUtil::stripe_info_t& sinfo,
308310
ReadPipeline& read_pipeline,
309311
UnstableHashInfoRegistry& unstable_hashinfo_registry,
310-
Listener* parent)
311-
: RecoveryBackend(cct, coll, std::move(ec_impl), sinfo, read_pipeline, unstable_hashinfo_registry, parent->get_eclistener()),
312+
Listener* parent,
313+
ECBackend* ecbackend)
314+
: RecoveryBackend(cct, coll, std::move(ec_impl), sinfo, read_pipeline, unstable_hashinfo_registry, parent->get_eclistener(), ecbackend),
312315
parent(parent) {
313316
}
314317

0 commit comments

Comments
 (0)