]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: have make_writeable adjust backfill_pos
authorSamuel Just <sam.just@inktank.com>
Sat, 26 Oct 2013 00:58:10 +0000 (17:58 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 28 Oct 2013 20:34:16 +0000 (13:34 -0700)
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>
src/osd/ReplicatedPG.cc

index 50fd43df7357c4e324060d29628df1c7120c53db..83ecc3b0dd3d3c9a4f568d3a05db695acb6be73e 100644 (file)
@@ -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++;
   }