From 9ac44d4ad1838056fc0326aa15e5b0376c4cbc7d Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 29 Mar 2011 11:28:19 -0700 Subject: [PATCH] MDS: change messenger name for replay mdses This will cause read operations from standby mdses to be distinguishable from those from the normal by changing the node name in the messenger. Previously, the replay node would have the same name as the node it's following. Signed-off-by: Samuel Just --- src/mds/MDS.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index c01be728ac394..c952aa5e82c82 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -904,10 +904,16 @@ void MDS::handle_mds_map(MMDSMap *m) if (oldwhoami != whoami) dout_create_rank_symlink(whoami); - if (oldwhoami != whoami) { + if (oldwhoami != whoami || oldstate != state) { // update messenger. - dout(1) << "handle_mds_map i am now mds" << whoami << "." << incarnation << dendl; - messenger->set_myname(entity_name_t::MDS(whoami)); + if (state == MDSMap::STATE_STANDBY_REPLAY || state == MDSMap::STATE_ONESHOT_REPLAY) { + dout(1) << "handle_mds_map i am now mds" << monc->get_global_id() << "." << incarnation + << "replaying mds" << whoami << "." << incarnation << dendl; + messenger->set_myname(entity_name_t::MDS(monc->get_global_id())); + } else { + dout(1) << "handle_mds_map i am now mds" << whoami << "." << incarnation << dendl; + messenger->set_myname(entity_name_t::MDS(whoami)); + } } // tell objecter my incarnation -- 2.39.5