]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: choose_log_location, fix error when scanning up set
authorSamuel Just <samuel.just@dreamhost.com>
Wed, 11 May 2011 20:50:20 +0000 (13:50 -0700)
committerSamuel Just <samuel.just@dreamhost.com>
Tue, 17 May 2011 21:09:37 +0000 (14:09 -0700)
++up.begin() does not skip the primary. Primary might not be up[0].

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/PG.cc

index 4c748b4c4b041641c641225e7dd8a14a115f6452..2d86cb3c4862cf8aeca5f67b1473b7efd60ff6b2 100644 (file)
@@ -1337,9 +1337,10 @@ void PG::choose_log_location(const PgPriorSet &prior_set,
   }
 
   oldest_update = info.last_update;
-  for (vector<int>::const_iterator it = ++up.begin();
+  for (vector<int>::const_iterator it = up.begin();
        it != up.end();
        ++it) {
+    if (*it == osd->whoami) continue;
     const Info &pi = peer_info.find(*it)->second;
     if (oldest_update > pi.last_update) {
       oldest_update = pi.last_update;
@@ -3902,6 +3903,7 @@ PG::RecoveryState::Primary::Primary(my_context ctx) : my_base(ctx) {
 boost::statechart::result 
 PG::RecoveryState::Primary::react(const BacklogComplete&) {
   PG *pg = context< RecoveryMachine >().pg;
+  dout(10) << "BacklogComplete" << dendl;
   pg->choose_acting(pg->osd->whoami);
   return discard_event();
 }
@@ -4343,7 +4345,8 @@ void PG::RecoveryState::GetInfo::exit() {
 
 /*------GetLog------------*/
 PG::RecoveryState::GetLog::GetLog(my_context ctx) : 
-  my_base(ctx), newest_update_osd(-1), need_backlog(false), msg(0)
+  my_base(ctx), newest_update_osd(-1), need_backlog(false),
+  wait_on_backlog(false), msg(0)
 {
   state_name = "Started/Primary/Peering/GetLog";
   context< RecoveryMachine >().log_enter(state_name);