From: Sage Weil Date: Sat, 31 Aug 2013 00:20:54 +0000 (-0700) Subject: osd/ReplicatedPG: do not set ctx->user_at_version unless ctx->user_modify X-Git-Tag: v0.69~21^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e8506b5adf96985df3113ab2f765041e21dc2369;p=ceph.git osd/ReplicatedPG: do not set ctx->user_at_version unless ctx->user_modify Leave ctx->user_at_version set to the previous oi.user_version unless/until we find that ctx->user_modify is true. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5f458644af0f..a50e0f263d6f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -969,7 +969,7 @@ void ReplicatedPG::execute_ctx(OpContext *ctx) << dendl; } - ctx->user_at_version = info.last_user_version; + ctx->user_at_version = obc->obs.oi.user_version; // note my stats utime_t now = ceph_clock_now(g_ceph_context); @@ -3951,14 +3951,14 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx) // finish and log the op. if (ctx->user_modify) { - /* update the user_version for any modify ops, except for the watch op */ - ++ctx->user_at_version; - assert(ctx->user_at_version > ctx->new_obs.oi.user_version); + // update the user_version for any modify ops, except for the watch op + ctx->user_at_version = MAX(info.last_user_version, ctx->new_obs.oi.user_version) + 1; /* In order for new clients and old clients to interoperate properly * when exchanging versions, we need to lower bound the user_version * (which our new clients pay proper attention to) * by the at_version (which is all the old clients can ever see). */ - ctx->user_at_version = MAX(ctx->at_version.version, ctx->user_at_version); + if (ctx->at_version.version > ctx->user_at_version) + ctx->user_at_version = ctx->at_version.version; ctx->new_obs.oi.user_version = ctx->user_at_version; } ctx->bytes_written = ctx->op_t.get_encoded_bytes();