From: myoungwon oh Date: Sat, 27 Feb 2021 15:53:20 +0000 (+0900) Subject: osd: update user_version if redirect object on promote() X-Git-Tag: v17.1.0~2307^2~19 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a2f5ac1365566754fa21345e73c5c0a53c50109d;p=ceph.git osd: update user_version if redirect object on promote() If the object is redirect manifest object, need to change user_version to the target object on promote() Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 526e5ae45ad33..d1f924d063ba8 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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); }