From 38fe575d56b8e5acc11dfdf84f2d7e74cb55dc36 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 26 Dec 2013 09:19:08 -0800 Subject: [PATCH] osd/ReplicatedPG: always encode snaps in finish_ctx On promote we use finish_ctx to build the final log entries, and need to encode the snaps vector in that case. (Normally this is done by make_writeable or explicitly by the snap trimmer.) Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 2b9bb5cc70ee5..1119d2c992641 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4645,6 +4645,10 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type) ctx->obs->oi.version, ctx->user_at_version, ctx->reqid, ctx->mtime)); + if (soid.snap < CEPH_NOSNAP) { + dout(20) << __func__ << " encoding snaps " << ctx->new_obs.oi.snaps << dendl; + ::encode(ctx->new_obs.oi.snaps, ctx->log.back().snaps); + } // apply new object state. ctx->obc->obs = ctx->new_obs; -- 2.39.5