osd: Better handle failure to get enough EC shards to backfill

Fixes: http://tracker.ceph.com/issues/18162

Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
David Zafman 2017-10-03 18:32:20 -07:00
parent 78e5c0fbd8
commit 6a02bfef3d
4 changed files with 18 additions and 0 deletions

View File

@ -217,6 +217,7 @@ void ECBackend::_failed_push(const hobject_t &hoid,
dout(10) << __func__ << ": canceling recovery op for obj " << hoid
<< dendl;
assert(recovery_ops.count(hoid));
eversion_t v = recovery_ops[hoid].v;
recovery_ops.erase(hoid);
list<pg_shard_t> fl;
@ -224,6 +225,8 @@ void ECBackend::_failed_push(const hobject_t &hoid,
fl.push_back(i.first);
}
get_parent()->failed_push(fl, hoid);
get_parent()->backfill_add_missing(hoid, v);
get_parent()->finish_degraded_object(hoid);
}
struct OnRecoveryReadComplete :

View File

@ -106,6 +106,7 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
const hobject_t oid) = 0;
virtual void failed_push(const list<pg_shard_t> &from, const hobject_t &soid) = 0;
virtual void finish_degraded_object(const hobject_t& oid) = 0;
virtual void primary_failed(const hobject_t &soid) = 0;
virtual bool primary_error(const hobject_t& soid, eversion_t v) = 0;
virtual void cancel_pull(const hobject_t &soid) = 0;
@ -122,6 +123,11 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
eversion_t v
) = 0;
virtual void backfill_add_missing(
const hobject_t &oid,
eversion_t v
) = 0;
virtual void remove_missing_object(const hobject_t &oid,
eversion_t v,
Context *on_complete) = 0;

View File

@ -525,6 +525,14 @@ void PrimaryLogPG::on_primary_error(
dout(0) << __func__ << ": oid " << oid << " version " << v << dendl;
primary_failed(oid);
primary_error(oid, v);
backfill_add_missing(oid, v);
}
void PrimaryLogPG::backfill_add_missing(
const hobject_t &oid,
eversion_t v)
{
dout(0) << __func__ << ": oid " << oid << " version " << v << dendl;
backfills_in_flight.erase(oid);
missing_loc.add_missing(oid, v, eversion_t());
}

View File

@ -277,6 +277,7 @@ public:
const hobject_t &soid,
const object_stat_sum_t &delta_stats) override;
void on_primary_error(const hobject_t &oid, eversion_t v) override;
void backfill_add_missing(const hobject_t &oid, eversion_t v) override;
void remove_missing_object(const hobject_t &oid,
eversion_t v,
Context *on_complete) override;