Blame SOURCES/rear-bz1993296.patch

b9f7b3
From 4233fe30b315737ac8c4d857e2b04e021c2e2886 Mon Sep 17 00:00:00 2001
b9f7b3
From: Pavel Cahyna <pcahyna@redhat.com>
b9f7b3
Date: Mon, 16 Aug 2021 10:10:38 +0300
b9f7b3
Subject: [PATCH] Revert the main part of PR #2299
b9f7b3
b9f7b3
multipath -l is very slow with many multipath devices. As it will be
b9f7b3
called for every multipath device, it leads to quadratic time complexity
b9f7b3
in the number of multipath devices. For thousands of devices, ReaR can
b9f7b3
take hours to scan and exclude them. We therefore have to comment
b9f7b3
multipath -l out, as it is a huge performance regression, and find
b9f7b3
another solution to bug #2298.
b9f7b3
---
b9f7b3
 usr/share/rear/lib/layout-functions.sh | 5 ++++-
b9f7b3
 1 file changed, 4 insertions(+), 1 deletion(-)
b9f7b3
b9f7b3
diff --git a/usr/share/rear/lib/layout-functions.sh b/usr/share/rear/lib/layout-functions.sh
b9f7b3
index cdd81a14..8c8be74b 100644
b9f7b3
--- a/usr/share/rear/lib/layout-functions.sh
b9f7b3
+++ b/usr/share/rear/lib/layout-functions.sh
b9f7b3
@@ -771,7 +771,10 @@ function is_multipath_path {
b9f7b3
     # so that no "multipath -l" output could clutter the log (the "multipath -l" output is irrelevant here)
b9f7b3
     # in contrast to e.g. test "$( multipath -l )" that would falsely succeed with blank output
b9f7b3
     # and the output would appear in the log in 'set -x' debugscript mode:
b9f7b3
-    multipath -l | grep -q '[[:alnum:]]' || return 1
b9f7b3
+    #
b9f7b3
+    # Unfortunately, multipat -l is quite slow with many multipath devices
b9f7b3
+    # and becomes a performance bottleneck, so we must comment it out for now.
b9f7b3
+    #multipath -l | grep -q '[[:alnum:]]' || return 1
b9f7b3
     # Check if a block device should be a path in a multipath device:
b9f7b3
     multipath -c /dev/$1 &>/dev/null
b9f7b3
 }
b9f7b3
-- 
b9f7b3
2.26.3
b9f7b3