]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: evict object state in foreground
authorKefu Chai <kchai@redhat.com>
Thu, 19 Sep 2019 09:52:35 +0000 (17:52 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 19 Sep 2019 10:23:20 +0000 (18:23 +0800)
when doing error handling, we need to make sure the stale object state
is evicted before we return.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/pg.cc

index e63b2e6fbcff35e0fca84803de463c6cfde4dde2..d9814108b797bd851b849a5a33a0c04a3d72b83a 100644 (file)
@@ -384,13 +384,13 @@ seastar::future<Ref<MOSDOpReply>> PG::do_osd_ops(Ref<MOSDOp> m)
   }).handle_exception_type([=,&oid](const ceph::osd::error& e) {
     logger().debug("got ceph::osd::error while handling object {}: {} ({})",
                    oid, e.code(), e.what());
-
-    backend->evict_object_state(oid);
-    auto reply = make_message<MOSDOpReply>(
-      m.get(), -e.code().value(), get_osdmap_epoch(), 0, false);
-    reply->set_enoent_reply_versions(peering_state.get_info().last_update,
-                                       peering_state.get_info().last_user_version);
-    return seastar::make_ready_future<Ref<MOSDOpReply>>(std::move(reply));
+    return backend->evict_object_state(oid).then([=] {
+      auto reply = make_message<MOSDOpReply>(
+        m.get(), -e.code().value(), get_osdmap_epoch(), 0, false);
+      reply->set_enoent_reply_versions(peering_state.get_info().last_update,
+                                         peering_state.get_info().last_user_version);
+      return seastar::make_ready_future<Ref<MOSDOpReply>>(std::move(reply));
+    });
   });
 }