From 3d0d69fed09675fc466f6c5b2736ba674923823d Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 25 Oct 2013 17:58:10 -0700 Subject: [PATCH] ReplicatedPG: have make_writeable adjust backfill_pos If we are writing to backfill_pos and create a clone, we end up failing to send the transaction creating the clone to the backfill peer. This is fine as long as we end up backfilling the clone. To that end, we simply add the clone to backfill_info and adjust backfill_pos accordingly. This is less brittle than the waiting_for_backfill_pos mechanism since it works even if we wait between that check and issuing the repop, which can happen for copy_from. Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 50fd43df735..83ecc3b0dd3 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3942,6 +3942,18 @@ void ReplicatedPG::make_writeable(OpContext *ctx) osd_reqid_t(), ctx->new_obs.oi.mtime)); ::encode(snaps, ctx->log.back().snaps); + /** + * In order to keep backfill_info up to date and avoid skipping this + * new clone, we must add the clone to backfill_pos. Furthermore, this + * is the only way in which an object might be created prior to backfill_pos + * without having the transaction shipped to the replica + */ + if (ctx->obs->oi.soid == backfill_pos) { + backfill_info.objects.insert(make_pair(coid, ctx->at_version)); + backfill_info.begin = coid; + backfill_pos = backfill_info.begin; + } + ctx->at_version.version++; } -- 2.47.3