From dc704aeedf80f9bea0412f0345a137a2cb307380 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Apr 07 2021 22:14:40 +0000 Subject: Apply patch 0058-multipathd-cleanup-logging-for-marginal-paths.patch patch_name: 0058-multipathd-cleanup-logging-for-marginal-paths.patch present_in_specfile: true location_in_specfile: 58 --- diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index bf1d391..ee711f7 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -254,7 +254,7 @@ static int enqueue_io_err_stat_by_path(struct path *path) vector_set_slot(io_err_pathvec, p); pthread_mutex_unlock(&io_err_pathvec_lock); - io_err_stat_log(2, "%s: enqueue path %s to check", + io_err_stat_log(3, "%s: enqueue path %s to check", path->mpp->alias, path->dev); return 0; @@ -353,7 +353,7 @@ int need_io_err_check(struct path *pp) if (uatomic_read(&io_err_thread_running) == 0) return 0; if (count_active_paths(pp->mpp) <= 0) { - io_err_stat_log(2, "%s: recover path early", pp->dev); + io_err_stat_log(2, "%s: no paths. recovering early", pp->dev); goto recover; } if (pp->io_err_pathfail_cnt != PATH_IO_ERR_WAITING_TO_CHECK) @@ -371,8 +371,7 @@ int need_io_err_check(struct path *pp) * Or else, return 1 to set path state to PATH_SHAKY */ if (r == 1) { - io_err_stat_log(3, "%s: enqueue fails, to recover", - pp->dev); + io_err_stat_log(2, "%s: enqueue failed. recovering early", pp->dev); goto recover; } else pp->io_err_pathfail_cnt = PATH_IO_ERR_IN_CHECKING; diff --git a/multipathd/main.c b/multipathd/main.c index 1d0579e..cc1aeea 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -2041,8 +2041,8 @@ check_path (struct vectors * vecs, struct path * pp, unsigned int ticks) pathinfo(pp, conf, 0); pthread_cleanup_pop(1); return 1; - } else if ((newstate != PATH_UP && newstate != PATH_GHOST) && - (pp->state == PATH_DELAYED)) { + } else if ((newstate != PATH_UP && newstate != PATH_GHOST && + newstate != PATH_PENDING) && (pp->state == PATH_DELAYED)) { /* If path state become failed again cancel path delay state */ pp->state = newstate; return 1; @@ -2104,8 +2104,9 @@ check_path (struct vectors * vecs, struct path * pp, unsigned int ticks) if ((newstate == PATH_UP || newstate == PATH_GHOST) && (san_path_check_enabled(pp->mpp) || marginal_path_check_enabled(pp->mpp))) { - int was_marginal = pp->marginal; if (should_skip_path(pp)) { + if (!pp->marginal && pp->state != PATH_DELAYED) + condlog(2, "%s: path is now marginal", pp->dev); if (!marginal_pathgroups) { if (marginal_path_check_enabled(pp->mpp)) /* to reschedule as soon as possible, @@ -2115,13 +2116,18 @@ check_path (struct vectors * vecs, struct path * pp, unsigned int ticks) pp->state = PATH_DELAYED; return 1; } - if (!was_marginal) { + if (!pp->marginal) { pp->marginal = 1; marginal_changed = 1; } - } else if (marginal_pathgroups && was_marginal) { - pp->marginal = 0; - marginal_changed = 1; + } else { + if (pp->marginal || pp->state == PATH_DELAYED) + condlog(2, "%s: path is no longer marginal", + pp->dev); + if (marginal_pathgroups && pp->marginal) { + pp->marginal = 0; + marginal_changed = 1; + } } }