device-mapper-multipath/0013-multipathd-use-marginal_pathgroups.patch

112 lines
3.4 KiB
Diff
Raw Normal View History

device-mapper-multipath-0.8.2-1 Update Source to upstream version 0.8.2 * Previoud patches 0001-0017 & 0027 are included in this commit Rename files * Previous patches 0018-0026 & 0028 are not patches 0021-0030 Add 0001-libmultipath-make-vector_foreach_slot_backwards-work.patch Add 0002-libmultipath-add-marginal-paths-and-groups-infrastru.patch Add 0003-tests-add-path-grouping-policy-unit-tests.patch Add 0004-libmultipath-add-wrapper-function-around-pgpolicyfn.patch Add 0005-tests-update-pgpolicy-tests-to-work-with-group_paths.patch Add 0006-libmultipath-fix-double-free-in-pgpolicyfn-error-pat.patch Add 0007-libmultipath-consolidate-group_by_-functions.patch Add 0008-libmultipath-make-pgpolicyfn-take-a-paths-vector.patch Add 0009-libmultipath-make-group_paths-handle-marginal-paths.patch Add 0010-tests-add-tests-for-grouping-marginal-paths.patch Add 0011-libmultipath-add-marginal_pathgroups-config-option.patch Add 0012-libmutipath-deprecate-delay_-_checks.patch Add 0013-multipathd-use-marginal_pathgroups.patch Add 0014-multipath-update-man-pages.patch * The above 13 patches add the marinal_pathgroups option Add 0015-multipath.conf-add-enable_foreign-parameter.patch Add 0016-multipath.conf.5-document-foreign-library-support.patch * The above 2 patches add the enable_foreign option Add 0017-mpathpersist-remove-broken-unused-code.patch Add 0018-libmultipath-EMC-PowerMax-NVMe-device-config.patch Add 0019-mpathpersist-fix-leaks.patch Add 0020-libmultipath-fix-mpcontext-initialization.patch * The above 20 patches have been submitted upstream
2019-09-11 22:06:10 +00:00
From d43ffc1112c0385737f88bab1c884e4ff4c316f5 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 31 Jul 2019 18:11:41 -0500
Subject: [PATCH] multipathd: use marginal_pathgroups
This commit makes the marginal_pathgroups option work with the
existing methods for determining marginal paths. It also merges the
code for the marginal_path and sand_path_err methods. This has the
side effect of making the marginal_path code set a marginal path's state
to "delayed" instead of "shaky" like it previously did.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/main.c | 53 +++++++++++++++++++++++++++++++++--------------
1 file changed, 38 insertions(+), 15 deletions(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index dca2214c..04b2b56a 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1960,6 +1960,18 @@ reinstate_path:
return 0;
}
+static int
+should_skip_path(struct path *pp){
+ if (marginal_path_check_enabled(pp->mpp)) {
+ if (pp->io_err_disable_reinstate && need_io_err_check(pp))
+ return 1;
+ } else if (san_path_check_enabled(pp->mpp)) {
+ if (check_path_reinstate_state(pp))
+ return 1;
+ }
+ return 0;
+}
+
/*
* Returns '1' if the path has been checked, '-1' if it was blacklisted
* and '0' otherwise
@@ -1975,6 +1987,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
int oldchkrstate = pp->chkrstate;
int retrigger_tries, checkint, max_checkint, verbosity;
struct config *conf;
+ int marginal_pathgroups, marginal_changed = 0;
int ret;
if ((pp->initialized == INIT_OK ||
@@ -1991,6 +2004,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
checkint = conf->checkint;
max_checkint = conf->max_checkint;
verbosity = conf->verbosity;
+ marginal_pathgroups = conf->marginal_pathgroups;
put_multipath_config(conf);
if (pp->checkint == CHECKINT_UNDEF) {
@@ -2106,20 +2120,27 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
set_no_path_retry(pp->mpp);
if ((newstate == PATH_UP || newstate == PATH_GHOST) &&
- check_path_reinstate_state(pp)) {
- pp->state = PATH_DELAYED;
- return 1;
- }
-
- if ((newstate == PATH_UP || newstate == PATH_GHOST) &&
- pp->io_err_disable_reinstate && need_io_err_check(pp)) {
- pp->state = PATH_SHAKY;
- /*
- * to reschedule as soon as possible,so that this path can
- * be recoverd in time
- */
- pp->tick = 1;
- return 1;
+ (san_path_check_enabled(pp->mpp) ||
+ marginal_path_check_enabled(pp->mpp))) {
+ int was_marginal = pp->marginal;
+ if (should_skip_path(pp)) {
+ if (!marginal_pathgroups) {
+ if (marginal_path_check_enabled(pp->mpp))
+ /* to reschedule as soon as possible,
+ * so that this path can be recovered
+ * in time */
+ pp->tick = 1;
+ pp->state = PATH_DELAYED;
+ return 1;
+ }
+ if (!was_marginal) {
+ pp->marginal = 1;
+ marginal_changed = 1;
+ }
+ } else if (marginal_pathgroups && was_marginal) {
+ pp->marginal = 0;
+ marginal_changed = 1;
+ }
}
/*
@@ -2258,7 +2279,9 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
*/
condlog(4, "path prio refresh");
- if (update_prio(pp, new_path_up) &&
+ if (marginal_changed)
+ update_path_groups(pp->mpp, vecs, 1);
+ else if (update_prio(pp, new_path_up) &&
(pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio) &&
pp->mpp->pgfailback == -FAILBACK_IMMEDIATE)
update_path_groups(pp->mpp, vecs, !new_path_up);
--
2.17.2