mirror of
https://github.com/ceph/ceph
synced 2025-04-01 23:02:17 +00:00
Revert "osd/ReplicatedPG: snapset is not persisted"
This commit is contained in:
parent
d43d6844ec
commit
0ba2e145d0
@ -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());
|
||||
@ -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;
|
||||
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user