From 97f00aec19eb9c82dff32280c8b8f5d8d149f90c Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 3 Jun 2010 18:22:24 -0700 Subject: [PATCH] debugging output --- src/osd/ReplicatedPG.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index abbcf87194869..edb9715711cf8 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1708,6 +1708,7 @@ inline void ReplicatedPG::_delete_head(OpContext *ctx) void ReplicatedPG::_rollback_to(OpContext *ctx, ceph_osd_op& op) { + dout(0) << "entering _rollback_to" << dendl; SnapSetContext *ssc = ctx->obs->ssc; const sobject_t& soid = ctx->obs->oi.soid; ObjectStore::Transaction& t = ctx->op_t; @@ -1719,6 +1720,8 @@ void ReplicatedPG::_rollback_to(OpContext *ctx, ceph_osd_op& op) if (-ENOENT == ret) { // there's no snapshot here, or there's no object. // if there's no snapshot, we delete the object; otherwise, do nothing. + dout(0) << "_rollback_to deleting head on " << soid.oid + << " because got ENOENT on find_object_context" << dendl; _delete_head(ctx); } else if (-EAGAIN == ret) { /* a different problem, like degraded pool @@ -1731,14 +1734,23 @@ void ReplicatedPG::_rollback_to(OpContext *ctx, ceph_osd_op& op) } } else { //we got our context, let's use it to do the rollback! if (ctx->clone_obc && - (ctx->clone_obc->obs.oi.prior_version == ctx->obs->oi.prior_version)) + (ctx->clone_obc->obs.oi.prior_version == ctx->obs->oi.prior_version)) { ; //just cloned the rollback target, we don't need to do anything! - + dout(0) << "_rollback_to has no work thanks to make_writeable" << dendl; + } else { /* 1) Delete current head * 2) Clone correct snapshot into head * 3) Calculate clone_overlaps by following overlaps * forward from rollback snapshot */ + dout(0) << "_rollback_to deleting " << soid.oid + << " and rolling back to old snap" + << " because we don't have a fresh clone (known by: clone_obj=" + << ctx->clone_obc << " and clone_obc.obs.oi.prior_version=" + << ctx->clone_obc->obs.oi.prior_version + << " and ctx->obs.oi.prior_version=" + << ctx->obs->oi.prior_version + << dendl; sobject_t new_head = get_object_context(ctx->obs->oi.soid) ->obs.oi.soid; -- 2.39.5