From: Neha Ojha Date: Mon, 16 Jul 2018 22:42:43 +0000 (-0700) Subject: osd: add flag to remember async recovery X-Git-Tag: v13.2.2~50^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ab597ad2208e77caa87c0e85e42f7c03463b4abf;p=ceph.git osd: add flag to remember async recovery Signed-off-by: Neha Ojha (cherry picked from commit 22d17fb5aad6ab9d7525d9492c0e96a36d02879e) --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index b09adc33d0c..71364840751 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -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; @@ -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 >= diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index 51c35a81180..b2cc0011a78 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -234,7 +234,8 @@ typedef ceph::shared_ptr 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, diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index aa0a57e5356..f4ee21b23c3 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -416,7 +416,8 @@ public: 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; } diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 295b9a97207..ad6a81f192c 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -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; @@ -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(