This way, if execute_ctx is rerun on the same OpContext, we
won't erroneously reuse a stale snapset/object_info.
Signed-off-by: Samuel Just <sam.just@inktank.com>
void ReplicatedPG::execute_ctx(OpContext *ctx)
{
dout(10) << __func__ << " " << ctx << dendl;
+ ctx->reset_obs(ctx->obc);
OpRequestRef op = ctx->op;
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
ObjectContextRef obc = ctx->obc;
snapset = &_ssc->snapset;
}
}
+ void reset_obs(ObjectContextRef obc) {
+ new_obs = ObjectState(obc->obs.oi, obc->obs.exists);
+ if (obc->ssc) {
+ new_snapset = obc->ssc->snapset;
+ snapset = &obc->ssc->snapset;
+ }
+ }
~OpContext() {
assert(!clone_obc);
assert(lock_to_release == NONE);