Skip to content

Commit

Permalink
Merge pull request ceph#5593 from ceph/revert-4927-snapset-obc
Browse files Browse the repository at this point in the history
Revert "osd/ReplicatedPG: snapset is not persisted"

Reviewed-by: Samuel Just <[email protected]>
  • Loading branch information
Samuel Just committed Aug 17, 2015
2 parents d43d684 + 0ba2e14 commit c3de0af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5754,7 +5754,9 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc
ctx->snapset_obc->obs.exists = false;
}
}
} else if (ctx->new_snapset.clones.size() && !ctx->cache_evict) {
} else if (ctx->new_snapset.clones.size() &&
!ctx->cache_evict &&
(!ctx->snapset_obc || !ctx->snapset_obc->obs.exists)) {
// save snapset on _snap
hobject_t snapoid(soid.oid, soid.get_key(), CEPH_SNAPDIR, soid.get_hash(),
info.pgid.pool(), soid.get_namespace());
Expand Down Expand Up @@ -5782,9 +5784,6 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc
} else if (!pool.info.require_rollback()) {
ctx->log.back().mod_desc.mark_unrollbackable();
}
if (!ctx->snapset_obc->obs.exists) {
ctx->op_t->touch(snapoid);
}
ctx->snapset_obc->obs.exists = true;
ctx->snapset_obc->obs.oi.version = ctx->at_version;
ctx->snapset_obc->obs.oi.last_reqid = ctx->reqid;
Expand All @@ -5793,6 +5792,7 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc

bufferlist bv(sizeof(ctx->new_obs.oi));
::encode(ctx->snapset_obc->obs.oi, bv);
ctx->op_t->touch(snapoid);
setattr_maybe_cache(ctx->snapset_obc, ctx, ctx->op_t, OI_ATTR, bv);
setattr_maybe_cache(ctx->snapset_obc, ctx, ctx->op_t, SS_ATTR, bss);
if (pool.info.require_rollback()) {
Expand Down

0 comments on commit c3de0af

Please sign in to comment.