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 <sam.just@inktank.com>
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++;
}