From 69280e2aebc7b52702b9b8a2bf5d5046f9c13053 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 20 Aug 2013 17:11:14 -0700 Subject: [PATCH] ReplicatedPG: remove OpContext::reply_user_version ctx->new_obs.oi.user_version is initialized to ctx->obs.oi.user_version, and for read ops it won't be changed. That means reply_user_version == ctx->new_obs.oi.user_version in all cases, which means we don't want it. Signed-off-by: Greg Farnum --- src/osd/ReplicatedPG.cc | 4 +--- src/osd/ReplicatedPG.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index e42b532c50d8f..70bfc893ce624 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1029,7 +1029,7 @@ void ReplicatedPG::do_op(OpRequestRef op) if (result >= 0) { ctx->reply->set_replay_version(ctx->at_version); - ctx->reply->set_user_version(ctx->reply_user_version); + ctx->reply->set_user_version(ctx->new_obs.oi.user_version); } else if (result == -ENOENT) { ctx->reply->set_replay_version(info.last_update); ctx->reply->set_user_version(info.last_update.version); @@ -3792,7 +3792,6 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx) // read-op? done? if (ctx->op_t.empty() && !ctx->modify) { - ctx->reply_user_version = ctx->obs->oi.user_version; unstable_stats.add(ctx->delta_stats, ctx->obc->obs.oi.category); return result; } @@ -3854,7 +3853,6 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx) /* update the user_version for any modify ops, except for the watch op */ ctx->new_obs.oi.user_version = ctx->at_version.version; } - ctx->reply_user_version = ctx->new_obs.oi.user_version; ctx->bytes_written = ctx->op_t.get_encoded_bytes(); if (ctx->new_obs.exists) { diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 878816fd1fa4d..dcc659e65a9ba 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -116,7 +116,6 @@ public: utime_t mtime; SnapContext snapc; // writer snap context eversion_t at_version; // pg's current version pointer - version_t reply_user_version; // the version that we report the client (depends on the op) int current_osd_subop_num; -- 2.39.5