]> git.apps.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>
Mon, 16 Jul 2018 22:42:43 +0000 (15:42 -0700)
Signed-off-by: Neha Ojha <nojha@redhat.com>
src/osd/ECBackend.cc
src/osd/PGBackend.h
src/osd/PrimaryLogPG.h
src/osd/ReplicatedBackend.cc

index 65c984449391bb86df85a8681bc140137ef5d0f4..6223ca12ec40e25967043bd53e06ad0a6790fb76 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 370694a7421f229a65fda74c73a0287d2752dcc0..825a8d8e29a6d38ba9c3b1c35ebe58abc93fa12b 100644 (file)
@@ -234,7 +234,8 @@ typedef std::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 5d0315972c041eba04cc9ec095aee3a445c39a24..231b8b36649f77eed833810714ae10b742ad0ebc 100644 (file)
@@ -418,7 +418,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 abeca78d45d80bb04696686d409167e5a38a016b..eb6e996c39616aff54e31cdbb1d7ffad7025165c 100644 (file)
@@ -1058,8 +1058,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;
@@ -1075,7 +1078,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(