multipath-tools: intermittent IO error accounting to improve reliability
v7 cover multipath-tools: intermittent IO error accounting to improve reliability
Hi Christophe and All,
This patch set adds a new method of path state checking based on accounting IO error. This is useful in many scenarios such as intermittent IO error on a path due to intermittent frame drops, intermittent corruptions, network congestion or a shaky link.
This patch set is of significance because of this (quoted from the discussion with Muneendra, Brocade):
There are typically two type of SAN network problems that are categorized as marginal issues. These issues by nature are not permanent in time and do come and go away over time.
1) Switches in the SAN can have intermittent frame drops or intermittent frame corruptions due to bad optics cable (SFP) or any such wear/tear port issues. This causes ITL flows that go through the faulty switch/port to intermittently experience frame drops.
2) There exists SAN topologies where there are switch ports in the fabric that becomes the only conduit for many different ITL(host--target--LUN) flows across multiple hosts. These single network paths are essentially shared across multiple ITL flows. Under these conditions if the port link bandwidth is not able to handle the net sum of the shared ITL flows bandwidth going through the single path then we could see intermittent network congestion problems. This condition is called network oversubscription. The intermittent congestions can delay SCSI exchange completion time (increase in I/O latency is observed).
To overcome the above network issues and many more such target issues, there are frame level retries that are done in HBA device firmware and I/O retries in the SCSI layer. These retries might succeed because of two reasons:
1) The intermittent switch/port issue is not observed
2) The retry I/O is a new SCSI exchange. This SCSI exchange can take an alternate SAN path for the ITL flow, if such an SAN path exists.
3) Network congestion disappears momentarily because the net I/O bandwidth coming from multiple ITL flows on the single shared network path is something the path can handle
However in some cases we have seen I/O retries don't succeed because the retry I/Os hits a SAN network path that has intermittent switch/port issue and/or network congestion.
On the host thus we see configurations two or more ITL path sharing the same target/LUN going through two or more HBA ports. These HBA ports are connected to two or more SAN to the same target/LUN.
If the I/O fails at the multipath layer then, the ITL path is turned into Failed state. Because of the marginal nature of the network, the next Health Check command sent from multipath layer might succeed, which results in making the ITL path into Active state. You end up seeing the DM path state going into Active, Failed, Active transitions. This results in overall reduction in application I/O throughput and sometime application I/O failures (because of timing constraints). All this can happen because of I/O retries and I/O request moving across multiple paths of the DM device. In the host it is to be noted all I/O retries on a single path and I/O movement across multiple paths results in slowing down the forward progress of new application I/O. Reason behind, the above I/O re-queue actions are given higher priority than the newer I/O requests coming from the application.
The above condition of the ITL path is hence called "marginal".
What we desire is for the DM to deterministically categorize a ITL Path as “marginal” and move all the pending I/Os from the marginal Path to an Active Path. This will help in meeting application I/O timing constraints. Also a capability to automatically re-instantiate the marginal path into Active once the marginal condition in the network is fixed.
Here is the description of implementation:
1) PATCH 1/2 implements the algorithm that sends a couple of continuous IOs to a path which suffers two failed events in less than a given time. Those IOs are sent at a fix rate of 10 Hz.
2) PATCH 2/2 discard the original algorithm because of this:
the detect sample interval of that path checkers is so big/coarse that it doesn't see what happens in the middle of the sample interval. We have the PATCH 1/2 as a better method.
Changes from V6:
* fix the warning of unwrapped commit description in patch 1/2
* add Reviewed-by tag of Muneendra
* add detailed scenario discription in the cover letter
Changes from V5:
* rebase on the latest release 0.7.3
Changes from V4:
* path_io_err_XXX -> marginal_path_err_XXX. (Mumeendra)
* add one more parameters named marginal_path_double_failed_time instead of the fixed 60 seconds for the pre-checking of a shaky path. (Martin)
* fix for "reschedule checking after %d seconds" log
* path_io_err_recovery_time -> marginal_path_err_recheck_gap_time.
* put the marginal path into PATH_SHAKY instead of PATH_DELAYED
* Modify the commit comments to sync with the changes above.
Changes from V3:
* add a patch for discard the san_path_XXX_feature
* fail the path in the kernel before enqueueing the path for checking rather than after knowing the checking result to make it more reliable. (Martin)
* use posix_memalign instead of manual alignment for direct IO buffer. (Martin)
* use PATH_MAX to avoid certain compiler warning when opening file rather than FILE_NAME_SIZE. (Martin)
* discard unnecessary sanity check when getting block size (Martin)
* do not return 0 in send_each_aync_io if io_starttime of a path is not set(Martin)
* Wait 10ms instead of 60 second if every path is down. (Martin)
* rename handle_async_io_timeout to poll_async_io_timeout and use polling method because io_getevents does not return 0 if there are timeout IO and normal IO.
* rename hit_io_err_recover_time ro hit_io_err_recheck_time
* modify the multipath.conf.5 and commit comments to keep sync with the above changes
Changes from V2:
* fix uncondistional rescedule forverver
* use script/checkpatch.pl in Linux to cleanup informal coding style
* fix "continous" and "internel" typos
Changes from V1:
* send continous IO instead of a single IO in a sample interval (Martin)
* when recover time expires, we reschedule the checking process (Hannes)
* Use the error rate threshold as a permillage instead of IO number(Martin)
* Use a common io_context for libaio for all paths (Martin)
* Other small fixes (Martin)
Junxiong Guan (2):
multipath-tools: intermittent IO error accounting to improve
reliability
multipath-tools: discard san_path_err_XXX feature
libmultipath/Makefile | 5 +- libmultipath/config.c | 3 - libmultipath/config.h | 21 +- libmultipath/configure.c | 7 +- libmultipath/dict.c | 88 +++--- libmultipath/io_err_stat.c | 744 +++++++++++++++++++++++++++++++++++++++++++++ libmultipath/io_err_stat.h | 15 + libmultipath/propsel.c | 70 +++-- libmultipath/propsel.h | 7 +- libmultipath/structs.h | 15 +- libmultipath/uevent.c | 32 ++ libmultipath/uevent.h | 2 + multipath/multipath.conf.5 | 89 ++++-- multipathd/main.c | 140 ++++----- 14 files changed, 1043 insertions(+), 195 deletions(-) create mode 100644 libmultipath/io_err_stat.c create mode 100644 libmultipath/io_err_stat.h
Signature · 7 lines
2.11.1 -- dm-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/dm-devel
PATCH v7 1/2 multipath-tools: intermittent IO error accounting to improve reliability
This patch adds a new method of path state checking based on accounting IO error. This is useful in many scenarios such as intermittent IO error an a path due to network congestion, or a shaky link.
Four parameters are added for the admin:"marginal_path_double_failed_time", marginal_path_err_sample_time", "marginal_path_err_rate_threshold" and "marginal_path_err_recheck_gap_time". If marginal_path_err_sample_time are set no less than 120 and marginal_path_err_recheck_gap_time are set to a value greater than 0, when path failing events occur twice in marginal_path_double_failed_time second due to an IO error, multipathd will fail the path and enqueue this path into a queue of which each member is sent a couple of continuous direct reading asynchronous IOs at a fixed sample rate of 10HZ. The IO accounting process for a path will last for marginal_path_err_sample_time. If the IO error rate on a particular path is greater than the marginal_path_err_rate_threshold, then the path will not reinstate for recover_time seconds unless there is only one active path.
If recover_time expires, we will reschedule this IO error checking process. If the path is good enough, we will claim it good. Or else the path will keep failed.
This helps us place the path in shaky state if we hit a lot of intermittent IO errors on a particular path due to network/target issues and isolate such degraded path and allow the admin to rectify the errors on a path.
--- libmultipath/Makefile | 5 +- libmultipath/config.h | 12 + libmultipath/configure.c | 4 + libmultipath/dict.c | 55 ++++ libmultipath/io_err_stat.c | 743 +++++++++++++++++++++++++++++++++++++++++++++ libmultipath/io_err_stat.h | 15 + libmultipath/propsel.c | 67 ++++ libmultipath/propsel.h | 4 + libmultipath/structs.h | 8 + libmultipath/uevent.c | 32 ++ libmultipath/uevent.h | 2 + multipath/multipath.conf.5 | 92 ++++++ multipathd/main.c | 64 ++++ 13 files changed, 1101 insertions(+), 2 deletions(-) create mode 100644 libmultipath/io_err_stat.c create mode 100644 libmultipath/io_err_stat.h
libmultipath/Makefile +3 -2
@@ -9,7 +9,7 @@ LIBS = $(DEVLIB).$(SONAME) CFLAGS += $(LIB_CFLAGS) -I$(mpathcmddir) -LIBDEPS += -lpthread -ldl -ldevmapper -ludev -L$(mpathcmddir) -lmpathcmd -lurcu +LIBDEPS += -lpthread -ldl -ldevmapper -ludev -L$(mpathcmddir) -lmpathcmd -lurcu -laio ifdef SYSTEMD CFLAGS += -DUSE_SYSTEMD=$(SYSTEMD)
@@ -42,7 +42,8 @@ OBJS = memory.o parser.o vector.o devmapper.o callout.o \ pgpolicies.o debug.o defaults.o uevent.o time-util.o \ switchgroup.o uxsock.o print.o alias.o log_pthread.o \ log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \ - lock.o waiter.o file.o wwids.o prioritizers/alua_rtpg.o prkey.o + lock.o waiter.o file.o wwids.o prioritizers/alua_rtpg.o prkey.o \ + io_err_stat.o all: $(LIBS)
libmultipath/config.h +12 -0
@@ -78,6 +78,10 @@ struct hwentry {int san_path_err_threshold;int san_path_err_forget_rate;int san_path_err_recovery_time; +int marginal_path_err_sample_time; +int marginal_path_err_rate_threshold; +int marginal_path_err_recheck_gap_time; +int marginal_path_double_failed_time;int skip_kpartx;int max_sectors_kb;char * bl_product;
@@ -110,6 +114,10 @@ struct mpentry {int san_path_err_threshold;int san_path_err_forget_rate;int san_path_err_recovery_time; +int marginal_path_err_sample_time; +int marginal_path_err_rate_threshold; +int marginal_path_err_recheck_gap_time; +int marginal_path_double_failed_time;int skip_kpartx;int max_sectors_kb;uid_t uid;
@@ -159,6 +167,10 @@ struct config {int san_path_err_threshold;int san_path_err_forget_rate;int san_path_err_recovery_time; +int marginal_path_err_sample_time; +int marginal_path_err_rate_threshold; +int marginal_path_err_recheck_gap_time; +int marginal_path_double_failed_time;int uxsock_timeout;int strict_timing;int retrigger_tries;
libmultipath/configure.c +4 -0
@@ -298,6 +298,10 @@ int setup_map(struct multipath *mpp, char *params, int params_size)select_san_path_err_threshold (conf, mpp);select_san_path_err_forget_rate (conf, mpp);select_san_path_err_recovery_time (conf, mpp); +select_marginal_path_err_sample_time (conf, mpp); +select_marginal_path_err_rate_threshold (conf, mpp); +select_marginal_path_err_recheck_gap_time (conf, mpp); +select_marginal_path_double_failed_time (conf, mpp);select_skip_kpartx (conf, mpp);select_max_sectors_kb (conf, mpp);
libmultipath/dict.c +55 -0
85 lines not on this page · raw message
libmultipath/io_err_stat.c new file +743 -0
743 lines not on this page · raw message
libmultipath/io_err_stat.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef _IO_ERR_STAT_H +#define _IO_ERR_STAT_H + +#include "vector.h" +#include "lock.h" + + +extern pthread_attr_t io_err_stat_attr; + +int start_io_err_stat_thread (void *data); +void stop_io_err_stat_thread (void ); +int io_err_stat_handle_pathfail (struct path *path); +int hit_io_err_recheck_time (struct path *pp); + +#endif /* _IO_ERR_STAT_H */
libmultipath/propsel.c +67 -0
85 lines not on this page · raw message
libmultipath/propsel.h +4 -0
@@ -28,6 +28,10 @@ int select_max_sectors_kb (struct config *conf, struct multipath * mp);int select_san_path_err_forget_rate (struct config *conf,struct multipath *mp);int select_san_path_err_threshold (struct config *conf,struct multipath *mp);int select_san_path_err_recovery_time (struct config *conf,struct multipath *mp); +int select_marginal_path_err_sample_time (struct config *conf,struct multipath *mp); +int select_marginal_path_err_rate_threshold (struct config *conf,struct multipath *mp); +int select_marginal_path_err_recheck_gap_time (struct config *conf,struct multipath *mp); +int select_marginal_path_double_failed_time (struct config *conf,struct multipath *mp);void reconcile_features_with_options (const char *id,char **features,int * no_path_retry,int *retain_hwhandler);
libmultipath/structs.h +8 -0
@@ -244,6 +244,10 @@ struct path {time_t dis_reinstate_time;int disable_reinstate;int san_path_err_forget_rate; +time_t io_err_dis_reinstate_time; +int io_err_disable_reinstate; +int io_err_pathfail_cnt; +int io_err_pathfail_starttime;/* configlet pointers */ struct hwentry * hwe; };
@@ -278,6 +282,10 @@ struct multipath {int san_path_err_threshold;int san_path_err_forget_rate;int san_path_err_recovery_time; +int marginal_path_err_sample_time; +int marginal_path_err_rate_threshold; +int marginal_path_err_recheck_gap_time; +int marginal_path_double_failed_time;int skip_kpartx;int max_sectors_kb;int force_readonly;
libmultipath/uevent.c +32 -0
@@ -922,3 +922,35 @@ char *uevent_get_dm_name(struct uevent *uev) }return p; } + +char *uevent_get_dm_path (struct uevent *uev) +{ +char *p =NULL ; +int i; + +for (i =0 ; uev->envp[i] !=NULL ; i++) { +if (!strncmp (uev->envp[i],"DM_PATH" ,7 ) && +strlen (uev->envp[i]) >8 ) { + p =MALLOC (strlen (uev->envp[i] +8 ) +1 ); +strcpy (p, uev->envp[i] +8 ); +break ; + } + } +return p; +} + +char *uevent_get_dm_action (struct uevent *uev) +{ +char *p =NULL ; +int i; + +for (i =0 ; uev->envp[i] !=NULL ; i++) { +if (!strncmp (uev->envp[i],"DM_ACTION" ,9 ) && +strlen (uev->envp[i]) >10 ) { + p =MALLOC (strlen (uev->envp[i] +10 ) +1 ); +strcpy (p, uev->envp[i] +10 ); +break ; + } + } +return p; +}
libmultipath/uevent.h +2 -0
@@ -37,5 +37,7 @@ int uevent_get_major(struct uevent *uev);int uevent_get_minor (struct uevent *uev);int uevent_get_disk_ro (struct uevent *uev);char *uevent_get_dm_name (struct uevent *uev); +char *uevent_get_dm_path (struct uevent *uev); +char *uevent_get_dm_action (struct uevent *uev);#endif /* _UEVENT_H */
multipath/multipath.conf.5 +92 -0
116 lines not on this page · raw message
multipathd/main.c +64 -0
118 lines not on this page · raw message
Signature · 1 line
2.6.4.windows.1
PATCH v7 2/2 multipath-tools: discard san_path_err_XXX feature
In reply to Guan JunxiongEven the san_path_err_threshold , san_path_err_forget_rate and san_path_err_recovery_time is turned on, the detect sample interval of that path checkers is so big/coarse that it doesn't see what happens in the middle of the sample interval.
Now we have new method of detecting path state of IO erros especially for intermittent IO errors in the previous patch.
Therefore, discard the original commit "c3705a12b893cc302a89587c4d37".
--- libmultipath/config.c | 3 -- libmultipath/config.h | 9 ----- libmultipath/configure.c | 3 -- libmultipath/dict.c | 39 --------------------- libmultipath/propsel.c | 47 -------------------------- libmultipath/propsel.h | 3 -- libmultipath/structs.h | 7 ---- multipath/multipath.conf.5 | 57 ------------------------------- multipathd/main.c | 84 ---------------------------------------------- 9 files changed, 252 deletions(-)
libmultipath/config.c +0 -3
@@ -351,9 +351,6 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)merge_num (delay_wait_checks);merge_num (skip_kpartx);merge_num (max_sectors_kb); -merge_num (san_path_err_threshold); -merge_num (san_path_err_forget_rate); -merge_num (san_path_err_recovery_time);snprintf (id,sizeof (id),"%s/%s" , dst->vendor, dst->product); reconcile_features_with_options(id, &dst->features,
libmultipath/config.h +0 -9
@@ -75,9 +75,6 @@ struct hwentry {int deferred_remove;int delay_watch_checks;int delay_wait_checks; -int san_path_err_threshold; -int san_path_err_forget_rate; -int san_path_err_recovery_time;int marginal_path_err_sample_time;int marginal_path_err_rate_threshold;int marginal_path_err_recheck_gap_time;
@@ -111,9 +108,6 @@ struct mpentry {int deferred_remove;int delay_watch_checks;int delay_wait_checks; -int san_path_err_threshold; -int san_path_err_forget_rate; -int san_path_err_recovery_time;int marginal_path_err_sample_time;int marginal_path_err_rate_threshold;int marginal_path_err_recheck_gap_time;
@@ -164,9 +158,6 @@ struct config {int processed_main_config;int delay_watch_checks;int delay_wait_checks; -int san_path_err_threshold; -int san_path_err_forget_rate; -int san_path_err_recovery_time;int marginal_path_err_sample_time;int marginal_path_err_rate_threshold;int marginal_path_err_recheck_gap_time;
libmultipath/configure.c +0 -3
@@ -295,9 +295,6 @@ int setup_map(struct multipath *mpp, char *params, int params_size)select_deferred_remove (conf, mpp);select_delay_watch_checks (conf, mpp);select_delay_wait_checks (conf, mpp); -select_san_path_err_threshold (conf, mpp); -select_san_path_err_forget_rate (conf, mpp); -select_san_path_err_recovery_time (conf, mpp);select_marginal_path_err_sample_time (conf, mpp);select_marginal_path_err_rate_threshold (conf, mpp);select_marginal_path_err_recheck_gap_time (conf, mpp);
libmultipath/dict.c +0 -39
@@ -1083,33 +1083,6 @@ declare_hw_handler(delay_wait_checks, set_off_int_undef) declare_hw_snprint(delay_wait_checks, print_off_int_undef) declare_mp_handler(delay_wait_checks, set_off_int_undef) declare_mp_snprint(delay_wait_checks, print_off_int_undef) -declare_def_handler(san_path_err_threshold, set_off_int_undef) -declare_def_snprint_defint (san_path_err_threshold, print_off_int_undef, - DEFAULT_ERR_CHECKS) -declare_ovr_handler(san_path_err_threshold, set_off_int_undef) -declare_ovr_snprint(san_path_err_threshold, print_off_int_undef) -declare_hw_handler(san_path_err_threshold, set_off_int_undef) -declare_hw_snprint(san_path_err_threshold, print_off_int_undef) -declare_mp_handler(san_path_err_threshold, set_off_int_undef) -declare_mp_snprint(san_path_err_threshold, print_off_int_undef) -declare_def_handler(san_path_err_forget_rate, set_off_int_undef) -declare_def_snprint_defint (san_path_err_forget_rate, print_off_int_undef, - DEFAULT_ERR_CHECKS) -declare_ovr_handler(san_path_err_forget_rate, set_off_int_undef) -declare_ovr_snprint(san_path_err_forget_rate, print_off_int_undef) -declare_hw_handler(san_path_err_forget_rate, set_off_int_undef) -declare_hw_snprint(san_path_err_forget_rate, print_off_int_undef) -declare_mp_handler(san_path_err_forget_rate, set_off_int_undef) -declare_mp_snprint(san_path_err_forget_rate, print_off_int_undef) -declare_def_handler(san_path_err_recovery_time, set_off_int_undef) -declare_def_snprint_defint (san_path_err_recovery_time, print_off_int_undef, - DEFAULT_ERR_CHECKS) -declare_ovr_handler(san_path_err_recovery_time, set_off_int_undef) -declare_ovr_snprint(san_path_err_recovery_time, print_off_int_undef) -declare_hw_handler(san_path_err_recovery_time, set_off_int_undef) -declare_hw_snprint(san_path_err_recovery_time, print_off_int_undef) -declare_mp_handler(san_path_err_recovery_time, set_off_int_undef) -declare_mp_snprint(san_path_err_recovery_time, print_off_int_undef) declare_def_handler(marginal_path_err_sample_time, set_off_int_undef)declare_def_snprint_defint (marginal_path_err_sample_time, print_off_int_undef,DEFAULT_ERR_CHECKS )
@@ -1482,9 +1455,6 @@ init_keywords(vector keywords)install_keyword ("config_dir" , &def_config_dir_handler, &snprint_def_config_dir);install_keyword ("delay_watch_checks" , &def_delay_watch_checks_handler, &snprint_def_delay_watch_checks);install_keyword ("delay_wait_checks" , &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks); -install_keyword ("san_path_err_threshold" , &def_san_path_err_threshold_handler, &snprint_def_san_path_err_threshold); -install_keyword ("san_path_err_forget_rate" , &def_san_path_err_forget_rate_handler, &snprint_def_san_path_err_forget_rate); -install_keyword ("san_path_err_recovery_time" , &def_san_path_err_recovery_time_handler, &snprint_def_san_path_err_recovery_time);install_keyword ("marginal_path_err_sample_time" , &def_marginal_path_err_sample_time_handler, &snprint_def_marginal_path_err_sample_time);install_keyword ("marginal_path_err_rate_threshold" , &def_marginal_path_err_rate_threshold_handler, &snprint_def_marginal_path_err_rate_threshold);install_keyword ("marginal_path_err_recheck_gap_time" , &def_marginal_path_err_recheck_gap_time_handler, &snprint_def_marginal_path_err_recheck_gap_time);
@@ -1573,9 +1543,6 @@ init_keywords(vector keywords)install_keyword ("deferred_remove" , &hw_deferred_remove_handler, &snprint_hw_deferred_remove);install_keyword ("delay_watch_checks" , &hw_delay_watch_checks_handler, &snprint_hw_delay_watch_checks);install_keyword ("delay_wait_checks" , &hw_delay_wait_checks_handler, &snprint_hw_delay_wait_checks); -install_keyword ("san_path_err_threshold" , &hw_san_path_err_threshold_handler, &snprint_hw_san_path_err_threshold); -install_keyword ("san_path_err_forget_rate" , &hw_san_path_err_forget_rate_handler, &snprint_hw_san_path_err_forget_rate); -install_keyword ("san_path_err_recovery_time" , &hw_san_path_err_recovery_time_handler, &snprint_hw_san_path_err_recovery_time);install_keyword ("marginal_path_err_sample_time" , &hw_marginal_path_err_sample_time_handler, &snprint_hw_marginal_path_err_sample_time);install_keyword ("marginal_path_err_rate_threshold" , &hw_marginal_path_err_rate_threshold_handler, &snprint_hw_marginal_path_err_rate_threshold);install_keyword ("marginal_path_err_recheck_gap_time" , &hw_marginal_path_err_recheck_gap_time_handler, &snprint_hw_marginal_path_err_recheck_gap_time);
@@ -1610,9 +1577,6 @@ init_keywords(vector keywords)install_keyword ("deferred_remove" , &ovr_deferred_remove_handler, &snprint_ovr_deferred_remove);install_keyword ("delay_watch_checks" , &ovr_delay_watch_checks_handler, &snprint_ovr_delay_watch_checks);install_keyword ("delay_wait_checks" , &ovr_delay_wait_checks_handler, &snprint_ovr_delay_wait_checks); -install_keyword ("san_path_err_threshold" , &ovr_san_path_err_threshold_handler, &snprint_ovr_san_path_err_threshold); -install_keyword ("san_path_err_forget_rate" , &ovr_san_path_err_forget_rate_handler, &snprint_ovr_san_path_err_forget_rate); -install_keyword ("san_path_err_recovery_time" , &ovr_san_path_err_recovery_time_handler, &snprint_ovr_san_path_err_recovery_time);install_keyword ("marginal_path_err_sample_time" , &ovr_marginal_path_err_sample_time_handler, &snprint_ovr_marginal_path_err_sample_time);install_keyword ("marginal_path_err_rate_threshold" , &ovr_marginal_path_err_rate_threshold_handler, &snprint_ovr_marginal_path_err_rate_threshold);install_keyword ("marginal_path_err_recheck_gap_time" , &ovr_marginal_path_err_recheck_gap_time_handler, &snprint_ovr_marginal_path_err_recheck_gap_time);
@@ -1646,9 +1610,6 @@ init_keywords(vector keywords)install_keyword ("deferred_remove" , &mp_deferred_remove_handler, &snprint_mp_deferred_remove);install_keyword ("delay_watch_checks" , &mp_delay_watch_checks_handler, &snprint_mp_delay_watch_checks);install_keyword ("delay_wait_checks" , &mp_delay_wait_checks_handler, &snprint_mp_delay_wait_checks); -install_keyword ("san_path_err_threshold" , &mp_san_path_err_threshold_handler, &snprint_mp_san_path_err_threshold); -install_keyword ("san_path_err_forget_rate" , &mp_san_path_err_forget_rate_handler, &snprint_mp_san_path_err_forget_rate); -install_keyword ("san_path_err_recovery_time" , &mp_san_path_err_recovery_time_handler, &snprint_mp_san_path_err_recovery_time);install_keyword ("marginal_path_err_sample_time" , &mp_marginal_path_err_sample_time_handler, &snprint_mp_marginal_path_err_sample_time);install_keyword ("marginal_path_err_rate_threshold" , &mp_marginal_path_err_rate_threshold_handler, &snprint_mp_marginal_path_err_rate_threshold);install_keyword ("marginal_path_err_recheck_gap_time" , &mp_marginal_path_err_recheck_gap_time_handler, &snprint_mp_marginal_path_err_recheck_gap_time);
libmultipath/propsel.c +0 -47
53 lines not on this page · raw message
libmultipath/propsel.h +0 -3
@@ -25,9 +25,6 @@ int select_delay_watch_checks (struct config *conf, struct multipath * mp);int select_delay_wait_checks (struct config *conf,struct multipath * mp);int select_skip_kpartx (struct config *conf,struct multipath * mp);int select_max_sectors_kb (struct config *conf,struct multipath * mp); -int select_san_path_err_forget_rate (struct config *conf,struct multipath *mp); -int select_san_path_err_threshold (struct config *conf,struct multipath *mp); -int select_san_path_err_recovery_time (struct config *conf,struct multipath *mp);int select_marginal_path_err_sample_time (struct config *conf,struct multipath *mp);int select_marginal_path_err_rate_threshold (struct config *conf,struct multipath *mp);int select_marginal_path_err_recheck_gap_time (struct config *conf,struct multipath *mp);
libmultipath/structs.h +0 -7
@@ -240,10 +240,6 @@ struct path {int initialized;int retriggers;int wwid_changed; -unsigned int path_failures; -time_t dis_reinstate_time; -int disable_reinstate; -int san_path_err_forget_rate;time_t io_err_dis_reinstate_time;int io_err_disable_reinstate;int io_err_pathfail_cnt;
@@ -279,9 +275,6 @@ struct multipath {int deferred_remove;int delay_watch_checks;int delay_wait_checks; -int san_path_err_threshold; -int san_path_err_forget_rate; -int san_path_err_recovery_time;int marginal_path_err_sample_time;int marginal_path_err_rate_threshold;int marginal_path_err_recheck_gap_time;
multipath/multipath.conf.5 +0 -57
81 lines not on this page · raw message
multipathd/main.c +0 -84
96 lines not on this page · raw message
Signature · 1 line
2.6.4.windows.1
Dear Christophe,
Could you please consider applying this patch or give any feedback about it? We (Huawei and Brocade) are looking forward to you reply. Thanks.
Regards
Guan Junxiong
.
Quoted 143 lines · Guan Junxiong
Hi Christophe and All,
This patch set adds a new method of path state checking based on accounting IO error. This is useful in many scenarios such as intermittent IO error on a path due to intermittent frame drops, intermittent corruptions, network congestion or a shaky link.
This patch set is of significance because of this (quoted from the discussion with Muneendra, Brocade):
There are typically two type of SAN network problems that are categorized as marginal issues. These issues by nature are not permanent in time and do come and go away over time.
1) Switches in the SAN can have intermittent frame drops or intermittent frame corruptions due to bad optics cable (SFP) or any such wear/tear port issues. This causes ITL flows that go through the faulty switch/port to intermittently experience frame drops.
2) There exists SAN topologies where there are switch ports in the fabric that becomes the only conduit for many different ITL(host--target--LUN) flows across multiple hosts. These single network paths are essentially shared across multiple ITL flows. Under these conditions if the port link bandwidth is not able to handle the net sum of the shared ITL flows bandwidth going through the single path then we could see intermittent network congestion problems. This condition is called network oversubscription. The intermittent congestions can delay SCSI exchange completion time (increase in I/O latency is observed).To overcome the above network issues and many more such target issues, there are frame level retries that are done in HBA device firmware and I/O retries in the SCSI layer. These retries might succeed because of two reasons:
1) The intermittent switch/port issue is not observed
2) The retry I/O is a new SCSI exchange. This SCSI exchange can take an alternate SAN path for the ITL flow, if such an SAN path exists.
3) Network congestion disappears momentarily because the net I/O bandwidth coming from multiple ITL flows on the single shared network path is something the path can handleHowever in some cases we have seen I/O retries don't succeed because the retry I/Os hits a SAN network path that has intermittent switch/port issue and/or network congestion.
On the host thus we see configurations two or more ITL path sharing the same target/LUN going through two or more HBA ports. These HBA ports are connected to two or more SAN to the same target/LUN.
If the I/O fails at the multipath layer then, the ITL path is turned into Failed state. Because of the marginal nature of the network, the next Health Check command sent from multipath layer might succeed, which results in making the ITL path into Active state. You end up seeing the DM path state going into Active, Failed, Active transitions. This results in overall reduction in application I/O throughput and sometime application I/O failures (because of timing constraints). All this can happen because of I/O retries and I/O request moving across multiple paths of the DM device. In the host it is to be noted all I/O retries on a single path and I/O movement across multiple paths results in slowing down the forward progress of new application I/O. Reason behind, the above I/O re-queue actions are given higher priority than the newer I/O requests coming from the application.The above condition of the ITL path is hence called "marginal".
What we desire is for the DM to deterministically categorize a ITL Path as “marginal” and move all the pending I/Os from the marginal Path to an Active Path. This will help in meeting application I/O timing constraints. Also a capability to automatically re-instantiate the marginal path into Active once the marginal condition in the network is fixed.
Here is the description of implementation:
1) PATCH 1/2 implements the algorithm that sends a couple of continuous IOs to a path which suffers two failed events in less than a given time. Those IOs are sent at a fix rate of 10 Hz.
2) PATCH 2/2 discard the original algorithm because of this:
the detect sample interval of that path checkers is so big/coarse that it doesn't see what happens in the middle of the sample interval. We have the PATCH 1/2 as a better method.Changes from V6:
* fix the warning of unwrapped commit description in patch 1/2
* add Reviewed-by tag of Muneendra
* add detailed scenario discription in the cover letterChanges from V5:
* rebase on the latest release 0.7.3Changes from V4:
*path_io_err_XXX->marginal_path_err_XXX. (Mumeendra)
* add one more parameters namedmarginal_path_double_failed_timeinstead of the fixed 60 seconds for the pre-checking of a shaky path. (Martin)
* fix for "reschedule checking after %d seconds" log
*path_io_err_recovery_time->marginal_path_err_recheck_gap_time.
* put the marginal path intoPATH_SHAKYinstead ofPATH_DELAYED
* Modify the commit comments to sync with the changes above.Changes from V3:
* add a patch for discard thesan_path_XXX_feature
* fail the path in the kernel before enqueueing the path for checking rather than after knowing the checking result to make it more reliable. (Martin)
* useposix_memaligninstead of manual alignment for direct IO buffer. (Martin)
* usePATH_MAXto avoid certain compiler warning when opening file rather thanFILE_NAME_SIZE. (Martin)
* discard unnecessary sanity check when getting block size (Martin)
* do not return 0 insend_each_aync_ioifio_starttimeof a path is not set(Martin)
* Wait 10ms instead of 60 second if every path is down. (Martin)
* renamehandle_async_io_timeouttopoll_async_io_timeoutand use polling method becauseio_geteventsdoes not return 0 if there are timeout IO and normal IO.
* renamehit_io_err_recover_timerohit_io_err_recheck_time
* modify the multipath.conf.5 and commit comments to keep sync with the above changesChanges from V2:
* fix uncondistional rescedule forverver
* usescript/checkpatch.plin Linux to cleanup informal coding style
* fix "continous" and "internel" typosChanges from V1:
* send continous IO instead of a single IO in a sample interval (Martin)
* when recover time expires, we reschedule the checking process (Hannes)
* Use the error rate threshold as a permillage instead of IO number(Martin)
* Use a commonio_contextfor libaio for all paths (Martin)
* Other small fixes (Martin)Junxiong Guan (2):
multipath-tools: intermittent IO error accounting to improve
reliability
multipath-tools: discardsan_path_err_XXXfeaturelibmultipath/Makefile | 5 +- libmultipath/config.c | 3 - libmultipath/config.h | 21 +- libmultipath/configure.c | 7 +- libmultipath/dict.c | 88 +++--- libmultipath/io_err_stat.c | 744 +++++++++++++++++++++++++++++++++++++++++++++ libmultipath/io_err_stat.h | 15 + libmultipath/propsel.c | 70 +++-- libmultipath/propsel.h | 7 +-
Quoted 9 lines
libmultipath/structs.h | 15 +- libmultipath/uevent.c | 32 ++ libmultipath/uevent.h | 2 + multipath/multipath.conf.5 | 89 ++++-- multipathd/main.c | 140 ++++----- 14 files changed, 1043 insertions(+), 195 deletions(-) create mode 100644 libmultipath/io_err_stat.c create mode 100644 libmultipath/io_err_stat.h
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Muneendra Kumar M
Hi Guan,
Any update on this patch ?Quoted 1 line
Regards,
Muneendra.
It's not yet merged. It's waiting for Christophe's merging. Hope Christophe can give any feedback soon.
BTW, your clients ( and my clients) can keep using this patch until it is really merged into the mainline.
Please wait . I think Christophe will eventually pick up this patch.
Best wishes.
Guan
Quoted 13 lines
-----Original Message-----
From: Guan Junxiong [mailto:[email protected]]
Sent: Thursday, November 02, 2017 6:20 AM
To: [email protected]
Cc: [email protected]; Muneendra Kumar M <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v7 0/2] multipath-tools: intermittent IO error accounting to improve reliabilityDear Christophe,
Could you please consider applying this patch or give any feedback about it? We (Huawei and Brocade) are looking forward to you reply. Thanks.
Quoted 166 lines
Regards
Guan Junxiong.
Quoted 158 lines · Guan Junxiong
Hi Christophe and All,
This patch set adds a new method of path state checking based on accounting IO error. This is useful in many scenarios such as intermittent IO error on a path due to intermittent frame drops, intermittent corruptions, network congestion or a shaky link.
This patch set is of significance because of this (quoted from the discussion with Muneendra, Brocade):
There are typically two type of SAN network problems that are categorized as marginal issues. These issues by nature are not permanent in time and do come and go away over time.
1) Switches in the SAN can have intermittent frame drops or intermittent frame corruptions due to bad optics cable (SFP) or any such wear/tear port issues. This causes ITL flows that go through the faulty switch/port to intermittently experience frame drops.
2) There exists SAN topologies where there are switch ports in the fabric that becomes the only conduit for many different ITL(host--target--LUN) flows across multiple hosts. These single network paths are essentially shared across multiple ITL flows. Under these conditions if the port link bandwidth is not able to handle the net sum of the shared ITL flows bandwidth going through the single path then we could see intermittent network congestion problems. This condition is called network oversubscription. The intermittent congestions can delay SCSI exchange completion time (increase in I/O latency is observed).To overcome the above network issues and many more such target issues, there are frame level retries that are done in HBA device firmware and I/O retries in the SCSI layer. These retries might succeed because of two reasons:
1) The intermittent switch/port issue is not observed
2) The retry I/O is a new SCSI exchange. This SCSI exchange can take an alternate SAN path for the ITL flow, if such an SAN path exists.
3) Network congestion disappears momentarily because the net I/O bandwidth coming from multiple ITL flows on the single shared network path is something the path can handleHowever in some cases we have seen I/O retries don't succeed because the retry I/Os hits a SAN network path that has intermittent switch/port issue and/or network congestion.
On the host thus we see configurations two or more ITL path sharing
the same target/LUN going through two or more HBA ports. These HBA
ports are connected to two or more SAN to the same target/LUN.
If the I/O fails at the multipath layer then, the ITL path is turned
into Failed state. Because of the marginal nature of the network, the
next Health Check command sent from multipath layer might succeed,
which results in making the ITL path into Active state. You end up
seeing the DM path state going into Active, Failed, Active
transitions. This results in overall reduction in application I/O
throughput and sometime application I/O failures (because of timing
constraints). All this can happen because of I/O retries and I/O
request moving across multiple paths of the DM device. In the host it
is to be noted all I/O retries on a single path and I/O movement
across multiple paths results in slowing down the forward progress of
new application I/O. Reason behind, the above I/O re-queue actions are given higher priority than the newer I/O requests coming from the application.The above condition of the ITL path is hence called "marginal".
What we desire is for the DM to deterministically categorize a ITL Path as “marginal” and move all the pending I/Os from the marginal Path to an Active Path. This will help in meeting application I/O timing constraints. Also a capability to automatically re-instantiate the marginal path into Active once the marginal condition in the network is fixed.
Here is the description of implementation:
1) PATCH 1/2 implements the algorithm that sends a couple of continuous IOs to a path which suffers two failed events in less than a given time. Those IOs are sent at a fix rate of 10 Hz.
2) PATCH 2/2 discard the original algorithm because of this:
the detect sample interval of that path checkers is so big/coarse that it doesn't see what happens in the middle of the sample interval. We have the PATCH 1/2 as a better method.Changes from V6:
* fix the warning of unwrapped commit description in patch 1/2
* add Reviewed-by tag of Muneendra
* add detailed scenario discription in the cover letterChanges from V5:
* rebase on the latest release 0.7.3Changes from V4:
*path_io_err_XXX->marginal_path_err_XXX. (Mumeendra)
* add one more parameters namedmarginal_path_double_failed_timeinstead of the fixed 60 seconds for the pre-checking of a shaky path.
(Martin)
* fix for "reschedule checking after %d seconds" log
*path_io_err_recovery_time->marginal_path_err_recheck_gap_time.
* put the marginal path intoPATH_SHAKYinstead ofPATH_DELAYED
* Modify the commit comments to sync with the changes above.Changes from V3:
* add a patch for discard thesan_path_XXX_feature
* fail the path in the kernel before enqueueing the path for checking rather than after knowing the checking result to make it more reliable. (Martin)
* useposix_memaligninstead of manual alignment for direct IO buffer. (Martin)
* usePATH_MAXto avoid certain compiler warning when opening file rather thanFILE_NAME_SIZE. (Martin)
* discard unnecessary sanity check when getting block size (Martin)
* do not return 0 insend_each_aync_ioifio_starttimeof a path is not set(Martin)
* Wait 10ms instead of 60 second if every path is down. (Martin)
* renamehandle_async_io_timeouttopoll_async_io_timeoutand use polling method becauseio_geteventsdoes not return 0 if there are timeout IO and normal IO.
* renamehit_io_err_recover_timerohit_io_err_recheck_time
* modify the multipath.conf.5 and commit comments to keep sync with the above changesChanges from V2:
* fix uncondistional rescedule forverver
* usescript/checkpatch.plin Linux to cleanup informal coding style
* fix "continous" and "internel" typosChanges from V1:
* send continous IO instead of a single IO in a sample interval (Martin)
* when recover time expires, we reschedule the checking process (Hannes)
* Use the error rate threshold as a permillage instead of IO number(Martin)
* Use a commonio_contextfor libaio for all paths (Martin)
* Other small fixes (Martin)Junxiong Guan (2):
multipath-tools: intermittent IO error accounting to improve
reliability
multipath-tools: discardsan_path_err_XXXfeaturelibmultipath/Makefile | 5 +- libmultipath/config.c | 3 - libmultipath/config.h | 21 +- libmultipath/configure.c | 7 +- libmultipath/dict.c | 88 +++--- libmultipath/io_err_stat.c | 744 +++++++++++++++++++++++++++++++++++++++++++++ libmultipath/io_err_stat.h | 15 + libmultipath/propsel.c | 70 +++-- libmultipath/propsel.h | 7 +- libmultipath/structs.h | 15 +- libmultipath/uevent.c | 32 ++ libmultipath/uevent.h | 2 + multipath/multipath.conf.5 | 89 ++++-- multipathd/main.c | 140 ++++----- 14 files changed, 1043 insertions(+), 195 deletions(-) create mode100644
libmultipath/io_err_stat.ccreate mode 100644libmultipath/io_err_stat.h
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Dear Christophe,
Any advance about this patch? We are looking forward to your reply. This patch set is of significance as described in the following previous cover letter. Please consider this patch.
We are looking forward to your reply.
Thanks very much.
Guan Junxiong ( Huawei)
Muneendra (Brocade)
Quoted 76 lines · Guan Junxiong
Hi Christophe and All,
This patch set adds a new method of path state checking based on accounting IO error. This is useful in many scenarios such as intermittent IO error on a path due to intermittent frame drops, intermittent corruptions, network congestion or a shaky link.
This patch set is of significance because of this (quoted from the discussion with Muneendra, Brocade):
There are typically two type of SAN network problems that are categorized as marginal issues. These issues by nature are not permanent in time and do come and go away over time.
1) Switches in the SAN can have intermittent frame drops or intermittent frame corruptions due to bad optics cable (SFP) or any such wear/tear port issues. This causes ITL flows that go through the faulty switch/port to intermittently experience frame drops.
2) There exists SAN topologies where there are switch ports in the fabric that becomes the only conduit for many different ITL(host--target--LUN) flows across multiple hosts. These single network paths are essentially shared across multiple ITL flows. Under these conditions if the port link bandwidth is not able to handle the net sum of the shared ITL flows bandwidth going through the single path then we could see intermittent network congestion problems. This condition is called network oversubscription. The intermittent congestions can delay SCSI exchange completion time (increase in I/O latency is observed).To overcome the above network issues and many more such target issues, there are frame level retries that are done in HBA device firmware and I/O retries in the SCSI layer. These retries might succeed because of two reasons:
1) The intermittent switch/port issue is not observed
2) The retry I/O is a new SCSI exchange. This SCSI exchange can take an alternate SAN path for the ITL flow, if such an SAN path exists.
3) Network congestion disappears momentarily because the net I/O bandwidth coming from multiple ITL flows on the single shared network path is something the path can handleHowever in some cases we have seen I/O retries don't succeed because the retry I/Os hits a SAN network path that has intermittent switch/port issue and/or network congestion.
On the host thus we see configurations two or more ITL path sharing the same target/LUN going through two or more HBA ports. These HBA ports are connected to two or more SAN to the same target/LUN.
If the I/O fails at the multipath layer then, the ITL path is turned into Failed state. Because of the marginal nature of the network, the next Health Check command sent from multipath layer might succeed, which results in making the ITL path into Active state. You end up seeing the DM path state going into Active, Failed, Active transitions. This results in overall reduction in application I/O throughput and sometime application I/O failures (because of timing constraints). All this can happen because of I/O retries and I/O request moving across multiple paths of the DM device. In the host it is to be noted all I/O retries on a single path and I/O movement across multiple paths results in slowing down the forward progress of new application I/O. Reason behind, the above I/O re-queue actions are given higher priority than the newer I/O requests coming from the application.The above condition of the ITL path is hence called "marginal".
What we desire is for the DM to deterministically categorize a ITL Path as “marginal” and move all the pending I/Os from the marginal Path to an Active Path. This will help in meeting application I/O timing constraints. Also a capability to automatically re-instantiate the marginal path into Active once the marginal condition in the network is fixed.
Here is the description of implementation:
1) PATCH 1/2 implements the algorithm that sends a couple of continuous IOs to a path which suffers two failed events in less than a given time. Those IOs are sent at a fix rate of 10 Hz.
2) PATCH 2/2 discard the original algorithm because of this:
the detect sample interval of that path checkers is so big/coarse that it doesn't see what happens in the middle of the sample interval. We have the PATCH 1/2 as a better method.
Quoted 4 lines
Changes from V6:
* fix the warning of unwrapped commit description in patch 1/2
* add Reviewed-by tag of Muneendra
* add detailed scenario discription in the cover letter
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel