]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: update user_version if redirect object on promote()
authormyoungwon oh <ohmyoungwon@gmail.com>
Sat, 27 Feb 2021 15:53:20 +0000 (00:53 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Mon, 29 Mar 2021 08:18:45 +0000 (17:18 +0900)
If the object is redirect manifest object, need to change
user_version to the target object on promote()

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/osd/PrimaryLogPG.cc

index 526e5ae45ad33749b044189d2960e2f12236481e..d1f924d063ba8050316721e58650183b2f7035e5 100644 (file)
@@ -3904,7 +3904,21 @@ public:
     int r = results.get<0>();
     if (ctx) {
       promote_results = results;
-      pg->execute_ctx(ctx);
+      if (obc->obs.oi.has_manifest() && obc->obs.oi.manifest.is_redirect()) {
+       ctx->user_at_version = results_data->user_version;
+      }
+      if (r >= 0) {
+       ctx->pg->execute_ctx(ctx);
+      } else {
+       if (r != -ECANCELED) { 
+         if (ctx->op)
+           ctx->pg->osd->reply_op_error(ctx->op, r);
+       } else if (results_data->should_requeue) {
+         if (ctx->op)
+           ctx->pg->requeue_op(ctx->op);
+       }
+       ctx->pg->close_op_ctx(ctx);
+      }
     } else {
       pg->finish_promote_manifest(r, results_data, obc);
     }