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
This commit is contained in:
sageweil 2007-02-28 23:05:17 +00:00
parent 9213a23f14
commit a476b85b8f
2 changed files with 10 additions and 4 deletions

View 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) {

View 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;
}