]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mdsmap same_in_set_since
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 18 Jul 2007 18:42:00 +0000 (18:42 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 18 Jul 2007 18:42:00 +0000 (18:42 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1526 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/TODO
trunk/ceph/mds/MDS.cc
trunk/ceph/mds/MDSMap.h
trunk/ceph/mon/MDSMonitor.cc

index 3e760361151b4742feff28b9b9d8f9560de3e5d3..dadac8af2c8f18fc5710f8b629ddccfcd41145ae 100644 (file)
@@ -1,11 +1,4 @@
 
-
-- change same_inst_since to align with "in" set
-- tag MClientRequest with mdsmap v
-- push new mdsmap to clients on send_message_client, based on the tag?
-  - hrm, what about exports and stale caps wonkiness... there's a race with the REAP.  hmm.
-
-
 some smallish projects:
 
 - crush rewrite in C
index 3883e9925a73ffd5964e82cf602b97444609ae34..cce42573f2e70c027a6e3d787bae7c253b573792 100644 (file)
@@ -641,10 +641,10 @@ void MDS::handle_mds_map(MMDSMap *m)
   }
 
 
-  // inst set changed?
+  // in set set changed?
   /*
   if (state >= MDSMap::STATE_ACTIVE &&   // only if i'm active+.  otherwise they'll get map during reconnect.
-      mdsmap->get_same_inst_since() > last_client_mdsmap_bcast) {
+      mdsmap->get_same_in_set_since() > last_client_mdsmap_bcast) {
     bcast_mds_map();
   }
   */
index d72e6a1f21cca2da7e09ce65b36af4ba2082be9b..f7d1d20e5275bcbdc98b6bd5d364bf738a33c1b3 100644 (file)
@@ -97,7 +97,7 @@ class MDSMap {
  protected:
   epoch_t epoch;
   utime_t created;
-  epoch_t same_inst_since;
+  epoch_t same_in_set_since;  // note: this does not reflect exit-by-failure.
 
   int target_num;
   int anchortable;   // which MDS has anchortable (fixme someday)
@@ -112,13 +112,13 @@ class MDSMap {
   friend class MDSMonitor;
 
  public:
-  MDSMap() : epoch(0), same_inst_since(0), anchortable(0), root(0) {}
+  MDSMap() : epoch(0), same_in_set_since(0), anchortable(0), root(0) {}
 
   epoch_t get_epoch() const { return epoch; }
   void inc_epoch() { epoch++; }
 
   const utime_t& get_create() const { return created; }
-  epoch_t get_same_inst_since() const { return same_inst_since; }
+  epoch_t get_same_in_set_since() const { return same_in_set_since; }
 
   int get_anchortable() const { return anchortable; }
   int get_root() const { return root; }
@@ -311,7 +311,7 @@ class MDSMap {
     ::_encode(epoch, bl);
     ::_encode(target_num, bl);
     ::_encode(created, bl);
-    ::_encode(same_inst_since, bl);
+    ::_encode(same_in_set_since, bl);
     ::_encode(anchortable, bl);
     ::_encode(root, bl);
     ::_encode(mds_state, bl);
@@ -325,7 +325,7 @@ class MDSMap {
     ::_decode(epoch, bl, off);
     ::_decode(target_num, bl, off);
     ::_decode(created, bl, off);
-    ::_decode(same_inst_since, bl, off);
+    ::_decode(same_in_set_since, bl, off);
     ::_decode(anchortable, bl, off);
     ::_decode(root, bl, off);
     ::_decode(mds_state, bl, off);
index daebe0ab3f2cb801f1463e8e7a3d194fc972d9b2..763ee31c43ec10321ca114dab468a56bccca44dd 100644 (file)
@@ -303,9 +303,6 @@ bool MDSMonitor::handle_beacon(MMDSBeacon *m)
     pending_mdsmap.mds_inst[from].name = MSG_ADDR_MDS(from);
     pending_mdsmap.mds_inc[from]++;
     
-    // someone (new) has joined the cluster.
-    pending_mdsmap.same_inst_since = pending_mdsmap.epoch;
-
     // reset the beacon timer
     last_beacon[from] = g_clock.now();
   }
@@ -333,10 +330,12 @@ bool MDSMonitor::handle_beacon(MMDSBeacon *m)
           << " -> " << MDSMap::get_state_name(state)
           << endl;
 
-  // did someone leave the cluster?
-  if (state == MDSMap::STATE_STOPPED && 
-      !mdsmap.is_stopped(from))
-    pending_mdsmap.same_inst_since = pending_mdsmap.epoch;
+  // has someone join or leave the cluster?
+  if (state == MDSMap::STATE_REPLAY ||
+      state == MDSMap::STATE_ACTIVE ||
+      state == MDSMap::STATE_STOPPED) {
+    pending_mdsmap.same_in_set_since = pending_mdsmap.epoch;
+  }
   
   // change the state
   pending_mdsmap.mds_state[from] = state;