From a476b85b8f814fa716a8a7170d3765e398fbe8a8 Mon Sep 17 00:00:00 2001 From: sageweil Date: Wed, 28 Feb 2007 23:05:17 +0000 Subject: [PATCH] make mds notice incarnation, even when it starts up as a specific mds# (e.g. via newsyn) git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1139 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/mds/MDS.cc | 13 +++++++++---- trunk/ceph/osdc/Objecter.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/trunk/ceph/mds/MDS.cc b/trunk/ceph/mds/MDS.cc index 374ce40efa1..c7b31cc4de0 100644 --- a/trunk/ceph/mds/MDS.cc +++ b/trunk/ceph/mds/MDS.cc @@ -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) { diff --git a/trunk/ceph/osdc/Objecter.h b/trunk/ceph/osdc/Objecter.h index f74081eafc3..741db052a21 100644 --- a/trunk/ceph/osdc/Objecter.h +++ b/trunk/ceph/osdc/Objecter.h @@ -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; }