Skip to content

Commit

Permalink
osd: add flag to remember async recovery
Browse files Browse the repository at this point in the history
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 22d17fb)
  • Loading branch information
neha-ojha committed Aug 2, 2018
1 parent 4aa16ca commit ab597ad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/osd/ECBackend.cc
Expand Up @@ -908,8 +908,11 @@ void ECBackend::handle_sub_write(
}
clear_temp_objs(op.temp_removed);
dout(30) << __func__ << " missing before " << get_parent()->get_log().get_missing().get_items() << dendl;
// flag set to true during async recovery
bool async = false;
pg_missing_tracker_t pmissing = get_parent()->get_local_missing();
if (pmissing.is_missing(op.soid)) {
async = true;
dout(30) << __func__ << " is_missing " << pmissing.is_missing(op.soid) << dendl;
for (auto &&e: op.log_entries) {
dout(30) << " add_next_event entry " << e << dendl;
Expand All @@ -923,7 +926,8 @@ void ECBackend::handle_sub_write(
op.trim_to,
op.roll_forward_to,
!op.backfill_or_async_recovery,
localt);
localt,
async);

if (!get_parent()->pg_is_undersized() &&
(unsigned)get_parent()->whoami_shard().shard >=
Expand Down
3 changes: 2 additions & 1 deletion src/osd/PGBackend.h
Expand Up @@ -234,7 +234,8 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
const eversion_t &trim_to,
const eversion_t &roll_forward_to,
bool transaction_applied,
ObjectStore::Transaction &t) = 0;
ObjectStore::Transaction &t,
bool async = false) = 0;

virtual void pgb_set_object_snap_mapping(
const hobject_t &soid,
Expand Down
3 changes: 2 additions & 1 deletion src/osd/PrimaryLogPG.h
Expand Up @@ -416,7 +416,8 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
const eversion_t &trim_to,
const eversion_t &roll_forward_to,
bool transaction_applied,
ObjectStore::Transaction &t) override {
ObjectStore::Transaction &t,
bool async = false) override {
if (hset_history) {
info.hit_set = *hset_history;
}
Expand Down
6 changes: 5 additions & 1 deletion src/osd/ReplicatedBackend.cc
Expand Up @@ -1052,8 +1052,11 @@ void ReplicatedBackend::do_repop(OpRequestRef op)
update_snaps = true;
}

// flag set to true during async recovery
bool async = false;
pg_missing_tracker_t pmissing = get_parent()->get_local_missing();
if (pmissing.is_missing(soid)) {
async = true;
dout(30) << __func__ << " is_missing " << pmissing.is_missing(soid) << dendl;
for (auto &&e: log) {
dout(30) << " add_next_event entry " << e << dendl;
Expand All @@ -1069,7 +1072,8 @@ void ReplicatedBackend::do_repop(OpRequestRef op)
m->pg_trim_to,
m->pg_roll_forward_to,
update_snaps,
rm->localt);
rm->localt,
async);

rm->opt.register_on_commit(
parent->bless_context(
Expand Down

0 comments on commit ab597ad

Please sign in to comment.