]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge branch 'master' into wip-encoding
authorSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 18:41:00 +0000 (10:41 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 18:41:00 +0000 (10:41 -0800)
Conflicts:
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

1  2 
src/Makefile.am
src/librados.cc
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

diff --cc src/Makefile.am
Simple merge
diff --cc src/librados.cc
Simple merge
diff --cc src/osd/OSD.cc
index 5727928b186a6047481f5b347fbc50345057157f,42de018907ecb2b66d8359b4872938ad25d3f3cf..e3a197dbcc9cf23f49dc51262c89b13a6811fff6
@@@ -5005,7 -5005,14 +5005,14 @@@ void OSD::do_recovery(PG *pg
      dout(20) << "  active was " << recovery_oids[pg->info.pgid] << dendl;
  #endif
      
-     int started = pg->start_recovery_ops(max);
+     ObjectStore::Transaction *t = new ObjectStore::Transaction;
+     C_Contexts *fin = new C_Contexts(g_ceph_context);
 -    map< int, vector<PG::Info> >  notify_list;  // primary -> list
 -    map< int, map<pg_t,PG::Query> > query_map;    // peer -> PG -> get_summary_since
++    map< int, vector<pg_info_t> >  notify_list;  // primary -> list
++    map< int, map<pg_t,pg_query_t> > query_map;    // peer -> PG -> get_summary_since
+     map<int,MOSDPGInfo*> info_map;  // peer -> message
+     PG::RecoveryCtx rctx(&query_map, &info_map, 0, &fin->contexts, t);
+     int started = pg->start_recovery_ops(max, &rctx);
      
      dout(10) << "do_recovery started " << started
             << " (" << recovery_ops_active << "/" << g_conf->osd_recovery_max_active << " rops) on "
diff --cc src/osd/PG.cc
index 6057a458f2d1ab25ffc2946aba6eed560082ede3,e25bff5d56ef47024f5c6ba2bddf94ad9ee915c0..be97440c5ddb44747eec34d1236c5af0730e947a
@@@ -309,8 -361,50 +309,50 @@@ bool PG::merge_old_entry(ObjectStore::T
    return false;
  }
  
 -  list<Log::Entry>::iterator p = log.log.end();
 -  list<Log::Entry> divergent;
+ /**
+  * rewind divergent entries at the head of the log
+  *
+  * This rewinds entries off the head of our log that are divergent.
+  * This is used by replicas during activation.
+  *
+  * @param t transaction
+  * @param newhead new head to rewind to
+  */
+ void PG::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead)
+ {
+   dout(10) << "rewind_divergent_log truncate divergent future " << newhead << dendl;
+   assert(newhead > log.tail);
 -  for (list<Log::Entry>::iterator d = divergent.begin(); d != divergent.end(); d++)
++  list<pg_log_entry_t>::iterator p = log.log.end();
++  list<pg_log_entry_t> divergent;
+   while (true) {
+     if (p == log.log.begin()) {
+       // yikes, the whole thing is divergent!
+       divergent.swap(log.log);
+       break;
+     }
+     --p;
+     if (p->version == newhead) {
+       ++p;
+       divergent.splice(divergent.begin(), log.log, p, log.log.end());
+       break;
+     }
+     assert(p->version > newhead);
+     dout(10) << "rewind_divergent_log future divergent " << *p << dendl;
+     log.unindex(*p);
+   }
+   log.head = newhead;
+   info.last_update = newhead;
+   if (info.last_complete > newhead)
+     info.last_complete = newhead;
++  for (list<pg_log_entry_t>::iterator d = divergent.begin(); d != divergent.end(); d++)
+     merge_old_entry(t, *d);
+ }
  void PG::merge_log(ObjectStore::Transaction& t,
 -                 Info &oinfo, Log &olog, int fromosd)
 +                 pg_info_t &oinfo, pg_log_t &olog, int fromosd)
  {
    dout(10) << "merge_log " << olog << " from osd." << fromosd
             << " into " << log << dendl;
@@@ -746,6 -854,20 +792,20 @@@ bool PG::adjust_need_up_thru(const OSDM
    return false;
  }
  
 -  map<int,PG::Info>::iterator p = peer_info.begin();
+ void PG::remove_down_peer_info(const OSDMapRef osdmap)
+ {
+   // Remove any downed osds from peer_info
++  map<int,pg_info_t>::iterator p = peer_info.begin();
+   while (p != peer_info.end()) {
+     if (!osdmap->is_up(p->first)) {
+       dout(10) << " dropping down osd." << p->first << " info " << p->second << dendl;
+       peer_missing.erase(p->first);
+       peer_info.erase(p++);
+     } else
+       p++;
+   }
+ }
  /*
   * Returns true unless there is a non-lost OSD in might_have_unfound.
   */
@@@ -1266,8 -1388,7 +1326,7 @@@ void PG::activate(ObjectStore::Transact
  
        // update local version of peer's missing list!
        if (m && pi.last_backfill != hobject_t()) {
-         eversion_t plu = pi.last_update;
 -        for (list<Log::Entry>::iterator p = m->log.log.begin();
 +        for (list<pg_log_entry_t>::iterator p = m->log.log.begin();
               p != m->log.log.end();
               p++)
          if (p->soid <= pi.last_backfill)
diff --cc src/osd/PG.h
index c17b9b613d365e85da80b6b8258f32aef69248ff,dcf9341ef247f6d9faef1b682991a1bc475148fb..4c34f05b98a90dad4137208653d7141b1a42b440
@@@ -1115,14 -1551,16 +1118,15 @@@ public
  
    virtual void calc_trim_to() = 0;
  
 -  void proc_replica_log(ObjectStore::Transaction& t, Info &oinfo, Log &olog,
 -                      Missing& omissing, int from);
 -  void proc_master_log(ObjectStore::Transaction& t, Info &oinfo, Log &olog,
 -                     Missing& omissing, int from);
 -  bool proc_replica_info(int from, Info &info);
 -  bool merge_old_entry(ObjectStore::Transaction& t, Log::Entry& oe);
 -  void merge_log(ObjectStore::Transaction& t, Info &oinfo, Log &olog, int from);
 +  void proc_replica_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog,
 +                      pg_missing_t& omissing, int from);
 +  void proc_master_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog,
 +                     pg_missing_t& omissing, int from);
 +  bool proc_replica_info(int from, pg_info_t &info);
 +  bool merge_old_entry(ObjectStore::Transaction& t, pg_log_entry_t& oe);
 +  void merge_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog, int from);
+   void rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead);
 -
 -  bool search_for_missing(const Info &oinfo, const Missing *omissing,
 +  bool search_for_missing(const pg_info_t &oinfo, const pg_missing_t *omissing,
                          int fromosd);
  
    void check_for_lost_objects();
Simple merge
Simple merge