]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: add location to missing_loc only during async_recovery
authorNeha Ojha <nojha@redhat.com>
Wed, 21 Feb 2018 04:57:20 +0000 (20:57 -0800)
committerNeha Ojha <nojha@redhat.com>
Thu, 15 Mar 2018 18:13:34 +0000 (11:13 -0700)
Signed-off-by: Neha Ojha <nojha@redhat.com>
src/osd/PrimaryLogPG.cc

index 2df6297b468d78d8cf60b08f5f15aec67f33bdc9..7f9bd5cdb08fa3edeff450d46308ec10929a8bb9 100644 (file)
@@ -10077,10 +10077,12 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
            ++i) {
     dout(10) << __func__ << " shard " << i->first << " before missing " << (i->second).get_items() << dendl;
   }
+  bool requires_missing_loc = false;
   for (set<pg_shard_t>::iterator i = async_recovery_targets.begin();
        i != async_recovery_targets.end();
        ++i) {
     if (*i == get_primary() || !peer_missing[*i].is_missing(soid)) continue;
+    requires_missing_loc = true;
     for (auto &&entry: ctx->log) {
       peer_missing[*i].add_next_event(entry);
     }
@@ -10114,12 +10116,14 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
     missing_loc.remove_location(soid, peer);
   }
 
-  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);
+  if (requires_missing_loc) {
+    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);
+    }
   }
   dout(10) << __func__ << " missing_loc after: " << missing_loc.get_locations(soid) << dendl;