]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
make mds notice incarnation, even when it starts up as a specific mds# (e.g. via...
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 28 Feb 2007 23:05:17 +0000 (23:05 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 28 Feb 2007 23:05:17 +0000 (23:05 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1139 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/mds/MDS.cc
trunk/ceph/osdc/Objecter.h

index 374ce40efa166ea82549542562a7f20f2af1b941..c7b31cc4de0ddf9bcc9734c7162d5ed9515c9b52 100644 (file)
@@ -440,17 +440,22 @@ void MDS::handle_mds_map(MMDSMap *m)
   // decode and process
   mdsmap->decode(m->get_encoded());
 
+  // tell objecter my incarnation
+  if (objecter->get_client_incarnation() < 0) {
+    assert(mdsmap->get_inc(whoami) > 0);
+    objecter->set_client_incarnation(mdsmap->get_inc(whoami));
+  }
+
   // see who i am
   whoami = mdsmap->get_inst_rank(messenger->get_myaddr());
   if (oldwhoami != whoami) {
     // update messenger.
     messenger->reset_myname(MSG_ADDR_MDS(whoami));
 
-    // tell objecter my incarnation
-    objecter->set_client_incarnation(mdsmap->get_inc(whoami));
-
     reopen_logger();
-    dout(1) << "handle_mds_map i am now mds" << whoami << endl;
+    dout(1) << "handle_mds_map i am now mds" << whoami
+           << " incarnation " << mdsmap->get_inc(whoami)
+           << endl;
 
     // do i need an osdmap?
     if (oldwhoami < 0) {
index f74081eafc3129bb1d3507a1c101519242a3b1bc..741db052a21ead193df686e1b7ec97aee8f54d5c 100644 (file)
@@ -164,6 +164,7 @@ class Objecter {
     return !(op_read.empty() && op_modify.empty());
   }
 
+  int get_client_incarnation() { return client_inc; }
   void set_client_incarnation(int inc) {
        client_inc = inc;
   }