]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pg: rename warm_restart and last_warm_restart
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 6 Oct 2011 18:52:42 +0000 (11:52 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 6 Oct 2011 22:45:36 +0000 (15:45 -0700)
These names make more sense, since last_warm_restart was updated
outside of the warm_restart function.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/osd/PG.cc
src/osd/PG.h

index 22c772a33d8ff8604916f15eaef7280a87e40bcf..d52b1b402034acb881a5538be099a72cb812181b 100644 (file)
@@ -1720,7 +1720,7 @@ void PG::_activate_committed(epoch_t e)
 {
   osd->map_lock.get_read();
   lock();
-  if (e < last_warm_restart) {
+  if (e < last_peering_reset) {
     dout(10) << "_activate_committed " << e << ", that was an old interval" << dendl;
   } else if (is_primary()) {
     peer_activated.insert(osd->whoami);
@@ -3532,23 +3532,24 @@ bool PG::acting_up_affected(const vector<int>& newup, const vector<int>& newacti
 
 bool PG::old_peering_msg(const epoch_t &msg_epoch)
 {
-  return (last_warm_restart > msg_epoch);
+  return (last_peering_reset > msg_epoch);
 }
 
-void PG::reset_last_warm_restart()
-{
-  last_warm_restart = osd->osdmap->get_epoch();
+void PG::set_last_peering_reset() {
+  last_peering_reset = osd->osdmap->get_epoch();
 }
 
 /* Called before initializing peering during advance_map */
-void PG::warm_restart(const OSDMap *lastmap, const vector<int>& newup, const vector<int>& newacting)
+void PG::start_peering_interval(const OSDMap *lastmap,
+                               const vector<int>& newup,
+                               const vector<int>& newacting)
 {
   const OSDMap *osdmap = osd->osdmap;
 
   // -- there was a change! --
   kick();
 
-  reset_last_warm_restart();
+  set_last_peering_reset();
 
   vector<int> oldacting, oldup;
   int oldrole = get_role();
@@ -3960,7 +3961,7 @@ PG::RecoveryState::Initial::react(const MLogRec& i) {
 
 void PG::RecoveryState::Initial::exit() {
   PG *pg = context< RecoveryMachine >().pg;
-  pg->reset_last_warm_restart();
+  pg->set_last_peering_reset();
   context< RecoveryMachine >().log_exit(state_name, enter_time);
 }
 
@@ -3997,8 +3998,9 @@ PG::RecoveryState::Reset::react(const AdvMap& advmap) {
   PG *pg = context< RecoveryMachine >().pg;
   dout(10) << "Reset advmap" << dendl;
   if (pg->acting_up_affected(advmap.newup, advmap.newacting)) {
-    dout(10) << "up or acting affected, calling warm_restart again" << dendl;
-    pg->warm_restart(advmap.lastmap, advmap.newup, advmap.newacting);
+    dout(10) << "up or acting affected, calling start_peering_interval again"
+            << dendl;
+    pg->start_peering_interval(advmap.lastmap, advmap.newup, advmap.newacting);
   }
   return discard_event();
 }
index f1fd0313d607f5e42f73076358d884e95a8887b7..c1ecce0461a4bf66e935496493df490982682b2a 100644 (file)
@@ -1308,7 +1308,7 @@ protected:
   set<int>             might_have_unfound;  // These osds might have objects on them
                                            // which are unfound on the primary
 
-  epoch_t last_warm_restart;
+  epoch_t last_peering_reset;
 
   friend class OSD;
 
@@ -1514,7 +1514,7 @@ public:
     have_master_log(true),
     recovery_state(this),
     need_up_thru(false),
-    last_warm_restart(0),
+    last_peering_reset(0),
     pg_stats_lock("PG::pg_stats_lock"),
     pg_stats_valid(false),
     finish_sync_event(NULL),
@@ -1594,9 +1594,11 @@ public:
   void share_pg_info();
   void share_pg_log(const eversion_t &oldver);
 
-  void warm_restart(const OSDMap *lastmap, const vector<int>& newup, const vector<int>& newacting);
-  void reset_last_warm_restart();
-                   
+  void start_peering_interval(const OSDMap *lastmap,
+                             const vector<int>& newup,
+                             const vector<int>& newacting);
+  void set_last_peering_reset();
+
   void fulfill_info(int from, const Query &query, 
                    pair<int, Info> &notify_info);
   void fulfill_log(int from, const Query &query);