]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: update pg stats more reliably
authorSage Weil <sage@newdream.net>
Tue, 20 May 2008 05:51:06 +0000 (22:51 -0700)
committerSage Weil <sage@newdream.net>
Tue, 20 May 2008 05:51:06 +0000 (22:51 -0700)
src/osd/OSD.cc
src/osd/PG.cc

index e8ef8b8fbe681ef5ffe0b7a0f6708ab80896c46e..7079e3395eca190fe7039936a65d323df21bc222 100644 (file)
@@ -1741,7 +1741,7 @@ void OSD::activate_map(ObjectStore::Transaction& t)
       // update started counter
       pg->info.history.last_epoch_started = osdmap->get_epoch();
     }
-    else if (pg->get_role() == 0 && !pg->is_active()) {
+    else if (pg->is_primary() && !pg->is_active()) {
       // i am (inactive) primary
       pg->build_prior();
       pg->peer(t, query_map, &info_map);
@@ -1996,7 +1996,7 @@ void OSD::kick_pg_split_queue()
         waiting_for_pg.erase(pg->info.pgid);
       }
       pg->peer(t, query_map, &info_map);
-
+      pg->update_stats();
       pg->unlock();
       created++;
     }
@@ -2131,6 +2131,7 @@ void OSD::handle_pg_create(MOSDPGCreate *m)
         waiting_for_pg.erase(pgid);
       }
       pg->peer(t, query_map, &info_map);
+      pg->update_stats();
       pg->unlock();
     }
   }
@@ -2291,7 +2292,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m)
     }
 
     // ok!
-    dout(10) << *pg << " osd" << from << " " << *it << dendl;
+    dout(10) << *pg << " got osd" << from << " info " << *it << dendl;
     pg->info.history.merge(it->history);
 
     // save info.
@@ -2323,7 +2324,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m)
       pg->build_prior();
       pg->peer(t, query_map, &info_map);
     }
-
+    pg->update_stats();
     pg->unlock();
   }
   
@@ -2407,6 +2408,7 @@ void OSD::_process_pg_info(epoch_t epoch, int from,
     // peer
     map< int, map<pg_t,PG::Query> > query_map;
     pg->peer(t, query_map, info_map);
+    pg->update_stats();
     do_queries(query_map);
 
   } else {
index 95d3c225b5a91a77c492057a01b2499ac856c6a4..f22b10ad1c0e0680c13b047cdf15dc2b7babfd9f 100644 (file)
@@ -881,6 +881,8 @@ void PG::peer(ObjectStore::Transaction& t,
   }
   else if (is_all_uptodate()) 
     finish_recovery();
+
+  update_stats(); // update stats
 }