]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: use clear_location() to clear out missing_loc
authorNeha Ojha <nojha@redhat.com>
Thu, 15 Mar 2018 00:32:47 +0000 (17:32 -0700)
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/PG.h
src/osd/PrimaryLogPG.cc

index 1a8d012f7595a9c12b53cda98ba805f39c7d0a03..8c8b8e4b3f0c3799046dd33032040ea9d0cb8548 100644 (file)
@@ -782,6 +782,15 @@ protected:
        _inc_count(p->second);
       }
     }
+
+    void clear_location(const hobject_t &hoid) {
+      auto p = missing_loc.find(hoid);
+      if (p != missing_loc.end()) {
+       _dec_count(p->second);
+        missing_loc.erase(p);
+      }
+    }
+
     void add_active_missing(const pg_missing_t &missing) {
       for (map<hobject_t, pg_missing_item>::const_iterator i =
             missing.get_items().begin();
index 5f45e0245fd832e39a2499b17fc1788981082ebd..9395a89a4a55e4b96025af105b07539010bc7675 100644 (file)
@@ -10125,13 +10125,7 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
 
   if (requires_missing_loc) {
     // clear out missing_loc
-    set<pg_shard_t> peers(missing_loc.get_locations(soid));
-    for (set<pg_shard_t>::iterator r = peers.begin();
-         r != peers.end();
-         ++r) {
-      pg_shard_t peer(*r);
-      missing_loc.remove_location(soid, peer);
-    }
+    missing_loc.clear_location(soid);
     for (set<pg_shard_t>::const_iterator i = actingset.begin();
          i != actingset.end();
          ++i) {