]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add flag to remember async recovery
authorNeha Ojha <nojha@redhat.com>
Mon, 16 Jul 2018 22:42:43 +0000 (15:42 -0700)
committerNeha Ojha <nojha@redhat.com>
Thu, 2 Aug 2018 17:53:31 +0000 (17:53 +0000)
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 22d17fb5aad6ab9d7525d9492c0e96a36d02879e)

src/osd/ECBackend.cc
src/osd/PGBackend.h
src/osd/PrimaryLogPG.h
src/osd/ReplicatedBackend.cc

index b09adc33d0c8d9bff0937ba3ea0b1954e0dbcb9d..713648407511b2a1b5fd167dcbb175f4fdb95a8d 100644 (file)
@@ -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 >=
index 51c35a81180273c864117d1c65ec39d3adfd9b55..b2cc0011a78235be46a785f3e4a7d5f1c622a555 100644 (file)
@@ -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,
index aa0a57e5356fa54a2493f84c6d36bddda2cc8aea..f4ee21b23c331084b449f8903da29998f621b90e 100644 (file)
@@ -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;
     }
index 295b9a97207c555f0a515fbed6b70377060ddd11..ad6a81f192ce7726a7b1db59cc73ab5567f918d6 100644 (file)
@@ -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(