diff options
author | Sage Weil <sage@inktank.com> | 2013-08-30 17:20:54 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-01 08:42:57 -0700 |
commit | e8506b5adf96985df3113ab2f765041e21dc2369 (patch) | |
tree | 59e77e7c5c476a760338595c95af687ff9a6e0f3 | |
parent | 99793d970baa66341b6b1db7ccba658fa246e1cf (diff) | |
download | ceph-e8506b5adf96985df3113ab2f765041e21dc2369.tar.gz |
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 <sage@inktank.com>
-rw-r--r-- | src/osd/ReplicatedPG.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5f458644af0..a50e0f263d6 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(); |