]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: update missing_loc more carefully
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 14 Aug 2018 07:30:37 +0000 (15:30 +0800)
committerPrashant D <pdhange@redhat.com>
Mon, 1 Oct 2018 01:04:21 +0000 (21:04 -0400)
There could be clones and hence we should update missing_loc
based on log entry itself.

Also I think the **have** field of missing_loc is not quite accurate here
but should be fine.

Fixes: http://tracker.ceph.com/issues/35546
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit b09dedf2e9f37ae117a909796727adea71e32422)

src/osd/PrimaryLogPG.cc

index e65171eec1dd94c1e2e1bc0fce4581661207a7ab..4c0746cdffae2c387a43bff36d7c34777d6b9ab0 100644 (file)
@@ -10330,32 +10330,22 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
     }
   }
 
-  for (set<pg_shard_t>::const_iterator i = acting_recovery_backfill.begin();
-       i != acting_recovery_backfill.end();
-       ++i) {
-    pg_shard_t peer(*i);
-    if (peer == pg_whoami) continue;
-    if (async_recovery_targets.count(peer) && peer_missing[peer].is_missing(soid)) {
-      for (auto &&entry: ctx->log) {
-       missing_loc.add_missing(soid, ctx->at_version, eversion_t(), entry.is_delete());
-      }
-    }
-  }
-
-  dout(30) << __func__ << " missing_loc before: " << missing_loc.get_locations(soid) << dendl;
-
   if (requires_missing_loc) {
-    // clear out missing_loc
-    missing_loc.clear_location(soid);
-    for (set<pg_shard_t>::const_iterator i = actingset.begin();
-         i != actingset.end();
-         ++i) {
-      pg_shard_t peer(*i);
-      if (!peer_missing[peer].is_missing(soid))
-        missing_loc.add_location(soid, peer);
+    for (auto &&entry: ctx->log) {
+      dout(30) << __func__ << " missing_loc before: "
+               << missing_loc.get_locations(entry.soid) << dendl;
+      missing_loc.add_missing(entry.soid, entry.version,
+                              eversion_t(), entry.is_delete());
+      // clear out missing_loc
+      missing_loc.clear_location(entry.soid);
+      for (auto &i: actingset) {
+        if (!peer_missing[i].is_missing(entry.soid))
+          missing_loc.add_location(entry.soid, i);
+      }
+      dout(30) << __func__ << " missing_loc after: "
+               << missing_loc.get_locations(entry.soid) << dendl;
     }
   }
-  dout(30) << __func__ << " missing_loc after: " << missing_loc.get_locations(soid) << dendl;
 
   pgbackend->submit_transaction(
     soid,