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;
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
}
} 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;