From patchwork Sat Feb 20 20:23:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiva Krishna X-Patchwork-Id: 8367891 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6BA549F314 for ; Sat, 20 Feb 2016 20:27:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D8A8203E9 for ; Sat, 20 Feb 2016 20:27:01 +0000 (UTC) Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) (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 121CA203E6 for ; Sat, 20 Feb 2016 20:27:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1KKNdij007935; Sat, 20 Feb 2016 15:23:39 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1KKNb5n027578 for ; Sat, 20 Feb 2016 15:23:37 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1KKNbCf017936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 20 Feb 2016 15:23:37 -0500 Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0095.outbound.protection.outlook.com [65.55.169.95]) by mx1.redhat.com (Postfix) with ESMTPS id AA1886023; Sat, 20 Feb 2016 20:23:35 +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=pYJlZUGKlLe4etYcQj/zQ3O6oYr9kHeaDiRLN/OPlV0=; b=aBBUVh23Q+6VHirFt/PUevavZ0GUuHRp2RS9Hb7D9LZjVVDthnxrfXf4iFj41AJDqRIsYng0IvlN2MPl+clmzyg90mjJs6f5SmJzbAaieEaJ4HX7z+VCjmgbfr9QI54ahtj4KTAdpPUWF8MHwUSTWfenDbdnrVJpL4VBDeKdnzs= Received: from BY2PR02CA0054.namprd02.prod.outlook.com (10.141.216.44) by BY2PR02MB1331.namprd02.prod.outlook.com (10.162.79.26) with Microsoft SMTP Server (TLS) id 15.1.409.15; Sat, 20 Feb 2016 20:23:34 +0000 Received: from BY2FFO11FD013.protection.gbl (2a01:111:f400:7c0c::155) by BY2PR02CA0054.outlook.office365.com (2a01:111:e400:2c40::44) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Sat, 20 Feb 2016 20:23:33 +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 BY2FFO11FD013.mail.protection.outlook.com (10.1.14.75) with Microsoft SMTP Server (TLS) id 15.1.422.5 via Frontend Transport; Sat, 20 Feb 2016 20:23:31 +0000 Received: from CASHUB02.nimblestorage.com (10.11.0.121) by CASHUB01.nimblestorage.com (10.11.0.124) with Microsoft SMTP Server (TLS) id 14.3.235.1; Sat, 20 Feb 2016 12:23:30 -0800 Received: from SJC-MBX-03.nimblestorage.com ([fe80::84bf:bbc4:41c5:ecad]) by cashub02.nimblestorage.com ([::1]) with mapi id 14.03.0235.001; Sat, 20 Feb 2016 12:23:30 -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: AQHRbByP+p2s59NX7EKYDsMl8Gcv7w== Date: Sat, 20 Feb 2016 20:23:29 +0000 Message-ID: <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.8.34.177] Content-ID: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD013; 1:Ex4k7w0lhUkunrHkt177GD0PTC0sF5s4WLnI7DR2MOA/j9gch/7n11o0bxUNUP7ZQHAV4Grta5ArVnKPlk4ec2PDCxqeQmAShHjVF348BIqkQqVdmM8Xrs0fI+tLVT97FpUk32yJI8Vorhxr7LVYSTitbZXdMAWD9TXFvxpWv7gkIJUNGaiEaXJ2BT5RZ4vEM+HnlDz1wdi+Z/bmUslNljkSZBZl0P/65Z2crR3zln3gYK0XJ+eFZfXhSqroreZlDcuAXXFUdZOrjU8rtsEKg8mfMC8kqj6Cx0FSSR6sJ/GRdUCzI9xsJQyfd8Kg89mnUA4Q4jULZYzQeE5vcWOUvn3FAcj1LEyndqWeDMQxRX5iNUE3v6CtTL6suC0g8ohuhOqAbO+zaMiWskvfCBQ/aw== X-Forefront-Antispam-Report: CIP:198.54.169.104; CTRY:ZA; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(1096002)(1220700001)(11100500001)(2351001)(110136002)(229853001)(16796002)(97756001)(23726003)(3846002)(102836003)(46406003)(6116002)(586003)(83716003)(5004730100002)(82746002)(36756003)(47776003)(53416004)(19580395003)(5003600100002)(54356999)(2501003)(5250100002)(50986999)(19580405001)(189998001)(5001960100002)(106466001)(106116001)(50466002)(2900100001)(86362001)(2906002)(6806005)(4326007)(33656002)(87936001)(5008740100001)(92566002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1331; H:mail.nimblestorage.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1331; 2:EdogQUq99/0p/ADsU3xkBkjzOABjpZIMongN8lbktGYZk1lLhHBMnowLOS4pRdTqAxoJtI9Xy0Y+81sHI/g5dBCYQcKWywRASbK36DNLewqw5I48kypeGslhb28UppQMGg8IB//hxHdxHDS9qlMOsw==; 3:j7dhPxTwpUcllG4xPyuU3LSKH5G0/2y+XB9MAlff4RVZgbbbFqvwDVSW+3tz2M5skVjEA6gZeC5IeiPAm6MQVPWZYIFImVqhYR1e+18OduGSI8UCRK6fuEkv3rshczO9qwz7sM0s7mVHh9tBL/i6UHpbhspXJqcCYNvN/6OywYvrO6OTRsWGMUMtOr5AEaSdHrN/lZZpQn9eioPGfIzSA3gWBXnmzpoKM/8roEGhEwxATa/8HH1sbS17vHacDVV/ya4WCR1wJY96cajzDQe5jw==; 25:voz2cHeraW9V5JlaR1VwWqnLDYSm+ZE/3tcvjfm5IsyPkzSiWnnr3u68klOIhRGYZZkprxoPowLLRWcJqfkb4rGn/Ps6A/Gg+YC0SmdDjlntDxxveqR2cvbRDswRHxHH42cry9tQEkAr8V4boMX3bZsV8kac9zYwLQinShozUmEa6JK+DTpW81I/Kaf31Iuo8YHkKsSomkepkLUQ1GXm5oHuT4sFhr9IEDcWJrUHZfA/Q/1gDZaoMVkXUcDcQAyFVe45RXj8EAREm7Kuz6rBG08I6QzMw9FL+XxxGphDYNuYYDm+SDqqchM9yJALbPFvc1kqZHSGYfw1B2K15jv1MYyACnDxt9XFGBttd5MM9lM= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BY2PR02MB1331; X-MS-Office365-Filtering-Correlation-Id: d882a245-33b0-48c9-962b-08d33a33b329 X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1331; 20:1cVape3n+vcRCFw+P7dUDxviBRvly9jPCySeVeD4+80uaqZT48jpnnafcUHg/ZzN18sGjsF33d7cmyyavusoO9A4yOLlLdRNYNeWBw+5VvaUE/uEx/zVUH2/ycifvirUroZBGDr5kE/4/bAfn3x1cwj2lKVhr29lCWz8jDGuAW+Wjn3snOv4OMSqwfegD44SiP+Jz1WBA2rWnm6sZmwn4Zf0G2QV7vcf0wVwy5yAA0HQUCQU63mc1KbPe6Br3Y3aLPgbfHHIpnx79gSWelsaU07m/bfgZ7OnEjGzx8xYYNY+yy+8jNFlOORHQOeNmrJ7vc2q6AfnqHRhBmCqLMaaNN/dLqqfpi7lbh7lGJhWzGOjTQcmKRtCUIZna4Vb8lWzSUHYNLuUtjLpOYNkxc3hJsQIYqg1/nqRxpyyO/ahZ0AK60TBjT3tm7GGJjco24h9KEa4EoZseF6CS9fIhCwFYaAc1nZdaHVo3qJ7fCOAUj7lRg5XoYLp9hmI5LFwbVvNgYJN++qxLD8Mns+qBdhiUbfTz1+1tTkm137pUdSBGGJkdNU0p6cz/AWVTpPUEBZPqQHMRCYBtMUlwsC49KDuwYRwGvXwwNudqG+HHJGbOtI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(5005006)(13016025)(8121501046)(13023025)(3002001)(10201501046); SRVR:BY2PR02MB1331; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB1331; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1331; 4:hRDw4puJ4ZSf89iDyjH6eB00oYeiYU+jB3BSz30wT0HIdQTrvq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+0gHkjj4VUVxgaqg36YC3Nbd7vF9YJ7SFrBmMbwk7DSiQp1+SrIdh7gs52o+KaGVb8r2RUlgOHfzqcMkHjPkksHibBXEkvSJk9xXJhEc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nimblestorage.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2016 20:23:31.0778 (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: BY2PR02MB1331 X-Greylist: Sender IP whitelisted by DNSRBL, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 20 Feb 2016 20:23:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 20 Feb 2016 20:23:36 +0000 (UTC) for IP:'65.55.169.95' DOMAIN:'mail-bl2on0095.outbound.protection.outlook.com' HELO:'na01-bl2-obe.outbound.protection.outlook.com' FROM:'Shiva.Krishna@nimblestorage.com' RCPT:'' 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) 65.55.169.95 mail-bl2on0095.outbound.protection.outlook.com 65.55.169.95 mail-bl2on0095.outbound.protection.outlook.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id u1KKNb5n027578 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; --