multipath-tools: decrease verbosity of state messages
authorMartin Wilck <mwilck@suse.com>
Mon, 10 Dec 2018 09:49:38 +0000 (10:49 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 10 Dec 2018 23:40:38 +0000 (00:40 +0100)
With verbosity level 3, thousands of "path state = running" messages
are logged, which are pretty much irrelevant, as the checker state
takes precedence. Also the "get_state" message is totally useless.

With this patch, the path state is reported exactly once per path
and check.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/discovery.c
multipathd/main.c

index 63558ad..f9a5901 100644 (file)
@@ -1433,7 +1433,7 @@ path_offline (struct path * pp)
        }
 
 
-       condlog(3, "%s: path state = %s", pp->dev, buff);
+       condlog(4, "%s: path state = %s", pp->dev, buff);
 
        if (pp->bus == SYSFS_BUS_SCSI) {
                if (!strncmp(buff, "offline", 7)) {
@@ -1552,8 +1552,6 @@ get_state (struct path * pp, struct config *conf, int daemon, int oldstate)
        struct checker * c = &pp->checker;
        int state;
 
-       condlog(3, "%s: get_state", pp->dev);
-
        if (!checker_selected(c)) {
                if (daemon) {
                        if (pathinfo(pp, conf, DI_SYSFS) != PATHINFO_OK) {
index c781115..e07ef50 100644 (file)
@@ -1904,6 +1904,16 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
        pp->tick = checkint;
 
        newstate = path_offline(pp);
+       if (newstate == PATH_UP) {
+               conf = get_multipath_config();
+               pthread_cleanup_push(put_multipath_config, conf);
+               newstate = get_state(pp, conf, 1, newstate);
+               pthread_cleanup_pop(1);
+       } else {
+               checker_clear_message(&pp->checker);
+               condlog(3, "%s: state %s, checker not called",
+                       pp->dev, checker_state_name(newstate));
+       }
        /*
         * Wait for uevent for removed paths;
         * some LLDDs like zfcp keep paths unavailable
@@ -1912,14 +1922,6 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
        if (newstate == PATH_REMOVED)
                newstate = PATH_DOWN;
 
-       if (newstate == PATH_UP) {
-               conf = get_multipath_config();
-               pthread_cleanup_push(put_multipath_config, conf);
-               newstate = get_state(pp, conf, 1, newstate);
-               pthread_cleanup_pop(1);
-       } else
-               checker_clear_message(&pp->checker);
-
        if (pp->wwid_changed) {
                condlog(2, "%s: path wwid has changed. Refusing to use",
                        pp->dev);