From patchwork Mon Feb 22 16:46:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiva Krishna X-Patchwork-Id: 8380141 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 86CCFC0553 for ; Mon, 22 Feb 2016 16:49:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6775E2051A for ; Mon, 22 Feb 2016 16:49:52 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 134342040F for ; Mon, 22 Feb 2016 16:49:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MGkst5060527; Mon, 22 Feb 2016 11:46:55 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1MGkrfi003109 for ; Mon, 22 Feb 2016 11:46:53 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1MGkrGP016072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Feb 2016 11:46:53 -0500 Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0070.outbound.protection.outlook.com [207.46.100.70]) by mx1.redhat.com (Postfix) with ESMTPS id 1B6FBC00070F; Mon, 22 Feb 2016 16:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nimblestorage4.onmicrosoft.com; s=selector1-nimblestorage-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=n4uDWMcm3XV4C63ZhqVejXn56y47+pyCNbgD6ifT8rY=; b=FdsKXhv3nyG8YgzwnCf0a2N6vXYeT6ti3zFJSk1t69VLktNOy1kaRUaCQyFe3sMaV2uwqe0FfXRH3yqj9zAUDAK7QxsN5SrQYpkpVSRWmdUS29VIazSPq0vjoIduhcbgXUS1Bb9dCVcTIl/ctl7v+4VzuIMnL12LYaMWJIGODS8= Received: from BY2PR02CA0080.namprd02.prod.outlook.com (10.242.32.38) by CY1PR0201MB0940.namprd02.prod.outlook.com (10.160.165.149) with Microsoft SMTP Server (TLS) id 15.1.409.15; Mon, 22 Feb 2016 16:46:50 +0000 Received: from BL2FFO11FD023.protection.gbl (2a01:111:f400:7c09::129) by BY2PR02CA0080.outlook.office365.com (2a01:111:e400:2c2a::38) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Mon, 22 Feb 2016 16:46:49 +0000 Authentication-Results: spf=pass (sender IP is 198.54.169.104) smtp.mailfrom=nimblestorage.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=nimblestorage.com; Received-SPF: Pass (protection.outlook.com: domain of nimblestorage.com designates 198.54.169.104 as permitted sender) receiver=protection.outlook.com; client-ip=198.54.169.104; helo=mail.nimblestorage.com; Received: from mail.nimblestorage.com (198.54.169.104) by BL2FFO11FD023.mail.protection.outlook.com (10.173.161.102) with Microsoft SMTP Server (TLS) id 15.1.422.5 via Frontend Transport; Mon, 22 Feb 2016 16:46:47 +0000 Received: from CASHUB04.nimblestorage.com (10.128.10.15) by CASHUB01.nimblestorage.com (10.11.0.124) with Microsoft SMTP Server (TLS) id 14.3.235.1; Mon, 22 Feb 2016 08:46:40 -0800 Received: from SJC-MBX-03.nimblestorage.com ([fe80::84bf:bbc4:41c5:ecad]) by CASHUB04.nimblestorage.com ([::1]) with mapi id 14.03.0235.001; Mon, 22 Feb 2016 08:46:40 -0800 From: Shiva Krishna To: "dm-devel@redhat.com" Thread-Topic: [PATCH]multipath-tools: prevent unnecessary reinstate of stand-by paths with implicit tpgs mode and no active array paths. Thread-Index: AQHRbByPgiNpq5A3O0ST1bwIjRIqpZ84SPqA Date: Mon, 22 Feb 2016 16:46:40 +0000 Message-ID: References: <065E3B7B-8F7D-48D9-BCB9-DFE13F8F3923@nimblestorage.com> In-Reply-To: <065E3B7B-8F7D-48D9-BCB9-DFE13F8F3923@nimblestorage.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.43.180] Content-ID: <40922D3994F59143875186B8CBFD9585@nimblestorage.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CPI:198.54.169.104; IPV:CAL; CTRY:ZA; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(199003)(189002)(87936001)(53416004)(102836003)(3846002)(50986999)(16796002)(76176999)(54356999)(11100500001)(6806005)(110136002)(5001960100002)(106116001)(189998001)(36756003)(5004730100002)(586003)(5003600100002)(5008740100001)(2906002)(47776003)(4326007)(1096002)(1220700001)(6116002)(50466002)(23726003)(92566002)(229853001)(2351001)(2900100001)(2950100001)(86362001)(46406003)(106466001)(19580405001)(19580395003)(97756001)(2501003)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0940; H:mail.nimblestorage.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD023; 1:rbPRxEyf8tUUcSbo+26Gs4u0cE9E1EJTEgnD3GZve8Ut+G6jUTiQMo5dS/0T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ykebad8IHAUGAhsiY+RF1a1UYAsrXdAoP4/Bg48RiBrr866H82ZVFwnd/OHwcQ0AguYOJsDl52fo= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:CY1PR0201MB0940; X-MS-Office365-Filtering-Correlation-Id: 542c1a89-4193-454b-cd41-08d33ba7c17b X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0940; 20:dLtT+PGl7m4d/xufv4XJ11jc+i3sG7SvQjqOnj+tB3YLpd9a3A9DNRFx0CvOU9nvqS/PizHBdzFpgjelR2KIn7QBFnxOVz+eNOmYghMiZMX5YxXITK6nOHdvDtVj1+liL0DpvSrFZdqUt1GhT7Q2aZIym/iucjacf0lCAq6mQ7Lp9K6D5CjVM5IyvMg6dPmYnXP873/ncB547VAzYYMrgIXbVwCq9XMlqtwLPsfhll20eJlvhEhjjtAY3/3l7UyjChP18NOj4NLfYofyHneciSuPoY04OYBkmaS9qoAI8ufEgot17zAfx25EwbQ3RQR9dTGDwqLIeEtQN+GXkkJi1BGuoswzB4Km6V2NkelpbLGnCyexOqi9vMmzDfjYyUlY6UndmZAaV+/Vo9nt6/URh/29KVJsBK/UIgvYQbm84fwQbsZNo0XLYtByBMx3Ka19TRwMTPsl0RTCwGdIO6gdPC6CyK1i/UoRKbPi+ejGTTyXj4AIdNqsBr/RhQVRhuJx6UNXdS992rlCE1oBtsGPm12Qt71XtNLnetuHfEH0KpsWMEV+Hu3NAmOGJLAu/UwUKlSN3oGib7JnMYWd9KJt96LazQJ56PIOA6MuEeSfnZo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(13021025)(13013025)(13023025)(10201501046)(3002001); SRVR:CY1PR0201MB0940; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0940; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0940; 4:1qx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Es9bNqlL1kjzqwS8LbRLHiOYSVpexwZd4JV9hxlgNihQLiHVmrt42jZyJQa?= =?us-ascii?Q?e1EswEUOmo1XDgfolgr+G/5pMzl6sEvYPPuLB5Lmunio7ymU8dchhzwrYhM6?= =?us-ascii?Q?6zJEMdS9Sbl6L/h9dHQfFI0636AGfXZAhuJIEBo96GnIyI86gmyikDpRDqAV?= =?us-ascii?Q?GByukWuTg6IoUzIICXW3hDULaIgAML8XX2+SbH+hxSwjUfsXsd0TydsFVw7/?= =?us-ascii?Q?XtEJd8GyDjymCBmeY7n4dz8OZ5yHClnxWL9m/Um999a67Fqlp9lXAjvcUTsb?= =?us-ascii?Q?WjLevFWosp3sf7h+CLVv+mkrYUdizK8bH/qyjKyeUeeBmK8P+l7GJZkEiU2b?= =?us-ascii?Q?+hC/3tbSnoA6hHWWHu5dwXiCX0LHFrWAjvLVRwJHqE0oahvyOfNmAstCgQBI?= =?us-ascii?Q?lRJz2MivKaV1ygOId/eg27eBzSqz0mVZsHgZxH8VhidIxiyTnq0mY3biL/Fa?= =?us-ascii?Q?3y9lzTsnEM3TO5K6v15xmx3cXHhW46azh1P8OKlMJ+QrYjSnUVY8xTqR29NT?= =?us-ascii?Q?TYQ4kcxNta1IAzTXG06wsaB8BbrFdRot1qOJ2Ehk0EcSAqRjQel8TBFf7ZGo?= =?us-ascii?Q?3NhFupVQrXUaWqzBCaVs5rU0qHj6WJnwPOUdy0LuS3eStvjnmCMUwr+z0e2F?= =?us-ascii?Q?rBE+JRpH7xv83nUNXL9kbDuOYNA0eSUaS?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0940; 5:Dvnq9unhQ+bJn1Wh3ZmRCggCrHfddaKTepwT+5barXdejJyVRjblQhfigY6+CEwgfT2bh/OUfsDSTqL/r8qma2Oa6iuLIZAxPvI2da0AVASZGR+Ivzd9cabFwKQSokqGGThtC8Lobun6GnYm/E5uUg==; 24:RfrNBKiLx68SpSodFpzpSFUVh2BfiugSLFS3qUgnaofbj4ss0AJsNCNqWwIOyvta5R9acNvCo63a0WdvIey7EDpDmzrouIDugveB7Ho7UV0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nimblestorage.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2016 16:46:47.7633 (UTC) X-MS-Exchange-CrossTenant-Id: 84f04a72-ca5d-479c-b48d-72d80f13b585 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=84f04a72-ca5d-479c-b48d-72d80f13b585; Ip=[198.54.169.104]; Helo=[mail.nimblestorage.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0940 X-RedHat-Spam-Score: 0.387 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS) 207.46.100.70 mail-by2on0070.outbound.protection.outlook.com 207.46.100.70 mail-by2on0070.outbound.protection.outlook.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id u1MGkrfi003109 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH]multipath-tools: prevent unnecessary reinstate of stand-by paths with implicit tpgs mode and no active array paths. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-4.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP multipathd treats "stand-by" path as active(ghost) and reinstate path.This causes I/O hang issues and lots of "change" udev events in cases where only stand-by paths are present in multipath map and target supports only implicit tpgs mode(active/passive arrays) This can happen during system boot where only stand-by paths are discovered first and continuous retry of I/O's by dm-multipath and change(failed) events are hogging multipathd and slowing down the entire boot process with large number of volumes mapped (~100s). Selecting path checkers other than tur is not a solution as well, as they will continuously throw messages saying paths are failed for stand-by state. This patch will prevent re-instate of stand-by paths in this situation and thus prevent unnecessary i/o with failed events during boot or when active array goes down temporarily. Detailed steps to hit the I/O hang issue even with no_path_retry: devices { device { vendor "Nimble" product "Server" path_grouping_policy group_by_prio detect_prio yes hardware_handler "1 alua" path_checker tur failback immediate fast_io_fail_tmo 10 no_path_retry 30 path_selector "round-robin 0" } } 1. Delete all active paths. mpathal (2e0176ad6309077166c9ce90033bfa248_1) dm-2 Nimble,Server size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw `-+- policy='round-robin 0' prio=1 status=active |- 8:0:5:1 sdg 8:96 active ghost running `- 8:0:6:1 sdh 8:112 active ghost running 2. Issue I/O on mpath with zero active paths. dd if=/dev/mapper/mpathal of=/dev/null bs=512 count=1 iflag=direct & Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: sdg - tur checker reports path is in standby state Nov 23 15:10:36 hitdev-rhel67 multipathd: 8:96: reinstated Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: queue_if_no_path enabled Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: Recovered to normal mode Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: remaining active paths: 1 Nov 23 15:10:36 hitdev-rhel67 kernel: sd 8:0:5:1: alua: port group 02 state S non-preferred supports tolusna Nov 23 15:10:36 hitdev-rhel67 kernel: device-mapper: multipath: Failing path 8:96. Nov 23 15:10:36 hitdev-rhel67 multipathd: 8:96: mark as failed Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: Entering recovery mode: max_retries=20 Nov 23 15:10:36 hitdev-rhel67 multipathd: mpathal: remaining active paths: 0 3. Monitor udev events every 5 seconds. # udevadm monitor monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent KERNEL[1448320131.061837] change /devices/virtual/block/dm-2 (block) KERNEL[1448320131.064802] change /devices/virtual/block/dm-2 (block) UDEV [1448320131.082838] change /devices/virtual/block/dm-2 (block) UDEV [1448320131.102134] change /devices/virtual/block/dm-2 (block) KERNEL[1448320135.551737] change /devices/virtual/block/dm-2 (block) KERNEL[1448320135.552701] change /devices/virtual/block/dm-2 (block) UDEV [1448320135.571634] change /devices/virtual/block/dm-2 (block) UDEV [1448320135.591017] change /devices/virtual/block/dm-2 (block) KERNEL[1448320136.553368] change /devices/virtual/block/dm-2 (block) KERNEL[1448320136.554298] change /devices/virtual/block/dm-2 (block) UDEV [1448320136.572733] change /devices/virtual/block/dm-2 (block) UDEV [1448320136.592089] change /devices/virtual/block/dm-2 (block) KERNEL[1448320140.555389] change /devices/virtual/block/dm-2 (block) KERNEL[1448320140.556369] change /devices/virtual/block/dm-2 (block) UDEV [1448320140.574944] change /devices/virtual/block/dm-2 (block) UDEV [1448320140.594076] change /devices/virtual/block/dm-2 (block) Signed-off-by: ShivaKrishna Merla --- libmultipath/propsel.c | 2 +- libmultipath/structs.h | 1 + multipathd/main.c | 21 ++++++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) -- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index f64d5e4..b9e389f 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -374,7 +374,7 @@ detect_prio(struct path * pp) int ret; struct prio *p = &pp->prio; - if (get_target_port_group_support(pp->fd) <= 0) + if ((pp->tpgs = get_target_port_group_support(pp->fd)) <= 0) return; ret = get_target_port_group(pp->fd); if (ret < 0) diff --git a/libmultipath/structs.h b/libmultipath/structs.h index 5f68a8e..ef5fb7e 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -193,6 +193,7 @@ struct path { int detect_prio; int watch_checks; int wait_checks; + int tpgs; char * uid_attribute; char * getuid; struct prio prio; diff --git a/multipathd/main.c b/multipathd/main.c index bf3423f..7faa4bd 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -62,6 +62,7 @@ static int use_watchdog; #include #include #include +#include "prioritizers/alua_rtpg.h" #include "main.h" #include "pidfile.h" @@ -1299,11 +1300,21 @@ check_path (struct vectors * vecs, struct path * pp) pp->watch_checks--; add_active = 0; } - if (reinstate_path(pp, add_active)) { - condlog(3, "%s: reload map", pp->dev); - ev_add_path(pp, vecs); - pp->tick = 1; - return 0; + + /* + * don't reinstate failed path, if its in stand-by + * and if target supports only implicit tpgs mode. + * this will prevent unnecessary i/o by dm on stand-by + * paths if there are no other active paths in map. + */ + if (newstate != PATH_GHOST || pp->mpp->nr_active > 0 || + pp->tpgs != TPGS_IMPLICIT) { + if (reinstate_path(pp, add_active)) { + condlog(3, "%s: reload map", pp->dev); + ev_add_path(pp, vecs); + pp->tick = 1; + return 0; + } } new_path_up = 1;