]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: handle ec pools in mark_all_unfound_lost 1713/head
authorSamuel Just <sam.just@inktank.com>
Tue, 22 Apr 2014 21:56:08 +0000 (14:56 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 22 Apr 2014 22:43:51 +0000 (15:43 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.h
src/osd/PGLog.h
src/osd/ReplicatedPG.cc

index 58585dfe12cac51b88b77376cb8a960afd43924b..4f9bc4440983002f3a0f022470c78d2c93541323 100644 (file)
@@ -309,10 +309,10 @@ public:
     map<hobject_t, set<pg_shard_t> > missing_loc;
     set<pg_shard_t> missing_loc_sources;
     PG *pg;
-    boost::scoped_ptr<PGBackend::IsReadablePredicate> is_readable;
-    boost::scoped_ptr<PGBackend::IsRecoverablePredicate> is_recoverable;
     set<pg_shard_t> empty_set;
   public:
+    boost::scoped_ptr<PGBackend::IsReadablePredicate> is_readable;
+    boost::scoped_ptr<PGBackend::IsRecoverablePredicate> is_recoverable;
     MissingLoc(PG *pg)
       : pg(pg) {}
     void set_backend_predicates(
@@ -353,6 +353,10 @@ public:
       return ret;
     }
 
+    const map<hobject_t, pg_missing_t::item> &get_all_missing() {
+      return needs_recovery_map;
+    }
+
     void clear() {
       needs_recovery_map.clear();
       missing_loc.clear();
index 9309841326d6ed519bddeb8fb29816c752e11e14..f793cbdf57df9a60b57492d76cdfecde7b34cc2f 100644 (file)
@@ -283,6 +283,10 @@ public:
     missing.rm(p);
   }
 
+  void missing_add_event(const pg_log_entry_t &e) {
+    missing.add_next_event(e);
+  }
+
   //////////////////// get or set log ////////////////////
 
   const IndexedLog &get_log() const { return log; }
index c6a8d3e7f6830426a7be81f5f9c4f14b26377c47..d80661cc459b98354615193e1befabf795606b5a 100644 (file)
@@ -8853,8 +8853,10 @@ void ReplicatedPG::mark_all_unfound_lost(int what)
   utime_t mtime = ceph_clock_now(cct);
   info.last_update.epoch = get_osdmap()->get_epoch();
   const pg_missing_t &missing = pg_log.get_missing();
-  map<hobject_t, pg_missing_t::item>::const_iterator m = missing.missing.begin();
-  map<hobject_t, pg_missing_t::item>::const_iterator mend = missing.missing.end();
+  map<hobject_t, pg_missing_t::item>::const_iterator m =
+    missing_loc.get_all_missing().begin();
+  map<hobject_t, pg_missing_t::item>::const_iterator mend =
+    missing_loc.get_all_missing().end();
   while (m != mend) {
     const hobject_t &oid(m->first);
     if (!missing_loc.is_unfound(oid)) {
@@ -8906,7 +8908,8 @@ void ReplicatedPG::mark_all_unfound_lost(int what)
        t->remove(
          coll,
          ghobject_t(oid, ghobject_t::NO_GEN, pg_whoami.shard));
-       pg_log.missing_rm(m++);
+       pg_log.missing_add_event(e);
+       ++m;
        missing_loc.recovered(oid);
       }
       break;