From: Samuel Just Date: Sat, 26 Oct 2013 00:58:10 +0000 (-0700) Subject: ReplicatedPG: have make_writeable adjust backfill_pos X-Git-Tag: v0.72-rc1~10^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d0d69fed09675fc466f6c5b2736ba674923823d;p=ceph.git 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 50fd43df7357..83ecc3b0dd3d 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++; }