From cc8e9011381a6deb41e322b5a1dc18192d23339c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 30 Aug 2013 17:22:26 -0700 Subject: [PATCH] osd/ReplicatedPG: do not log user_version on deletion events Or snap trim events where we are adjusting the head's snapdir attr. Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 0eee7b314e2c4..d61d441cb43f5 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1596,7 +1596,7 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid) coid, ctx->at_version, ctx->obs->oi.version, - info.last_user_version, + 0, osd_reqid_t(), ctx->mtime) ); @@ -1619,7 +1619,7 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid) coid, coi.version, coi.prior_version, - info.last_user_version, + 0, osd_reqid_t(), ctx->mtime) ); @@ -1644,7 +1644,7 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid) snapoid, ctx->at_version, ctx->snapset_obc->obs.oi.version, - info.last_user_version, + 0, osd_reqid_t(), ctx->mtime) ); @@ -1659,7 +1659,7 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid) snapoid, ctx->at_version, ctx->snapset_obc->obs.oi.version, - info.last_user_version, + 0, osd_reqid_t(), ctx->mtime) ); @@ -3919,7 +3919,7 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx) dout(10) << " removing old " << snapoid << dendl; ctx->log.push_back(pg_log_entry_t(pg_log_entry_t::DELETE, snapoid, ctx->at_version, old_version, - info.last_user_version, osd_reqid_t(), ctx->mtime)); + 0, osd_reqid_t(), ctx->mtime)); ctx->at_version.version++; ctx->snapset_obc->obs.exists = false; @@ -4597,10 +4597,10 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) ObjectStore::Transaction *t = &ctx->op_t; ctx->log.push_back(pg_log_entry_t(pg_log_entry_t::MODIFY, obc->obs.oi.soid, - ctx->at_version, - obc->obs.oi.version, - info.last_user_version, - osd_reqid_t(), ctx->mtime)); + ctx->at_version, + obc->obs.oi.version, + 0, + osd_reqid_t(), ctx->mtime)); eversion_t old_last_update = pg_log.get_head(); bool old_exists = repop->obc->obs.exists; @@ -6510,7 +6510,7 @@ ObjectContextRef ReplicatedPG::mark_object_lost(ObjectStore::Transaction *t, // Add log entry ++info.last_update.version; - pg_log_entry_t e(what, oid, info.last_update, version, info.last_user_version, osd_reqid_t(), mtime); + pg_log_entry_t e(what, oid, info.last_update, version, 0, osd_reqid_t(), mtime); pg_log.add(e); ObjectContextRef obc = get_object_context(oid, true); @@ -6581,7 +6581,7 @@ void ReplicatedPG::mark_all_unfound_lost(int what) ++info.last_update.version; pg_log_entry_t e( pg_log_entry_t::LOST_REVERT, oid, info.last_update, - m->second.need, info.last_user_version, osd_reqid_t(), mtime); + m->second.need, 0, osd_reqid_t(), mtime); e.reverting_to = prev; pg_log.add(e); dout(10) << e << dendl; @@ -6598,7 +6598,7 @@ void ReplicatedPG::mark_all_unfound_lost(int what) // log it ++info.last_update.version; pg_log_entry_t e(pg_log_entry_t::LOST_DELETE, oid, info.last_update, m->second.need, - info.last_user_version, osd_reqid_t(), mtime); + 0, osd_reqid_t(), mtime); pg_log.add(e); dout(10) << e << dendl; -- 2.39.5