From patchwork Sun Mar 17 14:51:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2283681 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A261DE016C for ; Sun, 17 Mar 2013 15:06:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932548Ab3CQOwN (ORCPT ); Sun, 17 Mar 2013 10:52:13 -0400 Received: from mga03.intel.com ([143.182.124.21]:34328 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932476Ab3CQOwL (ORCPT ); Sun, 17 Mar 2013 10:52:11 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 17 Mar 2013 07:52:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,859,1355126400"; d="scan'208";a="215704251" Received: from unknown (HELO zyan5-mobl.ccr.corp.intel.com) ([10.255.20.118]) by AZSMGA002.ch.intel.com with ESMTP; 17 Mar 2013 07:52:08 -0700 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: sage@inktank.com, greg@inktank.com, "Yan, Zheng" Subject: [PATCH 07/39] mds: mark connection down when MDS fails Date: Sun, 17 Mar 2013 22:51:10 +0800 Message-Id: <1363531902-24909-8-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1363531902-24909-1-git-send-email-zheng.z.yan@intel.com> References: <1363531902-24909-1-git-send-email-zheng.z.yan@intel.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" So if the MDS restarts and uses the same address, it does not get old messages. Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- src/mds/MDS.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 859782a..282fa64 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1046,8 +1046,10 @@ void MDS::handle_mds_map(MMDSMap *m) oldmap->get_failed_mds_set(oldfailed); mdsmap->get_failed_mds_set(failed); for (set::iterator p = failed.begin(); p != failed.end(); ++p) - if (oldfailed.count(*p) == 0) + if (oldfailed.count(*p) == 0) { + messenger->mark_down(oldmap->get_inst(*p).addr); mdcache->handle_mds_failure(*p); + } // or down then up? // did their addr/inst change? @@ -1055,8 +1057,10 @@ void MDS::handle_mds_map(MMDSMap *m) mdsmap->get_up_mds_set(up); for (set::iterator p = up.begin(); p != up.end(); ++p) if (oldmap->have_inst(*p) && - oldmap->get_inst(*p) != mdsmap->get_inst(*p)) + oldmap->get_inst(*p) != mdsmap->get_inst(*p)) { + messenger->mark_down(oldmap->get_inst(*p).addr); mdcache->handle_mds_failure(*p); + } } if (is_clientreplay() || is_active() || is_stopping()) { // did anyone stop?