Multi-path exception processing method and device, equipment and storage medium
By detecting and restoring capacity anomalies in the target path and aggregating unaggregated paths, the problem of path loss during storage device fault recovery is resolved, ensuring the stability and reliability of storage paths.
Patent Information
- Application Number
- CN202511468116.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-10-14
AI Technical Summary
During storage failure recovery, the multipath device read command of the storage device returns a Not Ready message, causing the path capacity to be reset to 0, the path to remain abnormally, and the storage volume may not be able to be added to the multipath topology when it comes back online, resulting in path loss or loss.
By identifying and recovering from capacity anomalies in the target path, the system obtains and aggregates the first unaggregated path and the second unaggregated path in the host system, ensuring path stability.
It ensures the stability of storage path transmission and avoids storage access anomalies caused by path abnormalities or lack of aggregation.
Smart Images

Figure CN120980005B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multi-path storage, and particularly relates to a multi-path exception processing method and device, equipment and a storage medium. BACKGROUND
[0002] The storage multipath technology (Multipath I / O, referred to as MPIO or Multipathing) is a scheme of software and hardware cooperation, which is used to establish two or more physical paths between a server and a storage array, and combine the multiple paths into a unified logical device.
[0003] In the related art, during storage fault recovery, the read instruction of the storage device to the multi-path device continuously returns Not Ready (not ready) information, which causes the host to reset the path capacity to 0, and the corresponding path is abnormally left in the multi-path device; and after the storage controller fault recovery, a large number of storage volumes are reconnected, which may cause the path capacity of the host to be abnormal, so that the corresponding path cannot join the multi-path topology, resulting in path loss or loss of the multi-path device. SUMMARY
[0004] The present application aims to at least solve one of the technical problems in the related art to some extent.
[0005] In a first aspect, the present application provides a multi-path exception processing method, which comprises: determining whether there is a target path to be detected; in response to the existence of the target path, performing capacity exception detection and recovery processing on the target path; in response to the target path being a first path of a multi-path device to which the target path belongs, acquiring a first path corresponding to the multi-path device which is not aggregated, and performing multi-path aggregation processing on the first path; in response to the target path not existing or the target path being a preset path, acquiring a second path which is not aggregated in a host system, and performing multi-path aggregation processing on the second path.
[0006] In an implementation, the capacity anomaly detection and recovery processing on the target path comprises: performing a capacity detection step on the target path to determine whether the capacity of the target path is abnormal; in response to the capacity of the target path being abnormal and the number of times of performing the capacity detection step being less than a preset threshold, returning to perform the capacity detection step; or, in response to the capacity of the target path being abnormal and the number of times of performing the capacity detection step being equal to the preset threshold, determining whether there is another available path in a multi-path to which the target path belongs; or, in response to the capacity of the target path being normal, continuing to perform the step of determining whether the target path is a first path of the multi-path device to which the target path belongs; in response to there being another available path in the multi-path to which the target path belongs, deleting the target path; and rescanning the target path to perform multi-path aggregation processing on the target path.
[0007] In an implementation, the obtaining the first path corresponding to the multi-path device to which the target path belongs comprises: obtaining a target device identifier corresponding to the multi-path device to which the target path belongs; obtaining a first path set, paths in the first path set belonging to the multi-path device corresponding to the same device identifier as the target device identifier; obtaining a second path set, paths in the second path set being aggregated paths corresponding to the multi-path device to which the target path belongs; and comparing the first path set and the second path set to obtain the first path, the first path being a path in the second path set different from the first path set.
[0008] In an implementation, the first path is at least one, and for each first path, the multi-path aggregation processing on the first path comprises: performing a capacity detection step on the first path to determine whether the capacity of the first path is abnormal; in response to the capacity of the first path being abnormal and the number of times of performing the capacity detection step being less than a preset threshold, returning to perform the capacity detection step; or, in response to the capacity of the first path being abnormal and the number of times of performing the capacity detection step being equal to the preset threshold, removing the first path; and rescanning the first path to perform multi-path aggregation processing on the first path.
[0009] In an optional implementation, the method further comprises: in response to the capacity of the first path being normal, directly performing multi-path aggregation processing on the first path.
[0010] In an implementation, the acquiring the second path not aggregated in the host system comprises: acquiring a first set of device identifiers, each device identifier in the first set of device identifiers being a device identifier corresponding to each multi-path device in the host system; acquiring a second set of device identifiers, each device identifier in the second set of device identifiers being a device identifier corresponding to each path in the host system; comparing the first set of device identifiers with the second set of device identifiers to obtain a target device identifier, the target device identifier being a device identifier in the second set of device identifiers different from the first set of device identifiers; and acquiring a path to which a multi-path device corresponding to the target device identifier belongs as the second path.
[0011] In an implementation, before the performing the capacity anomaly detection and recovery processing on the target path, the method further comprises: determining whether the target path reaches a first detection period; and in response to the target path reaching the first detection period, performing the steps of the performing the capacity anomaly detection and recovery processing on the target path.
[0012] In an implementation, the determining whether the target path is a preset path comprises: acquiring a target device identifier corresponding to a multi-path device to which the target path belongs; determining whether the target device identifier satisfies a preset condition; and in response to the target device identifier satisfying the preset condition, determining that the target path is the preset path.
[0013] In an optional implementation, the determining that the target path is the preset path in response to the device identifier of the multi-path device to which the target path belongs satisfying a preset condition comprises: in response to the target device identifier being a smallest device identifier in a host system to which the target path belongs, determining that the target path is the preset path.
[0014] In a second aspect, the present application provides a multi-path anomaly processing apparatus, which comprises: a first processing module configured to determine whether there is a target path to be detected; a second processing module configured to perform capacity anomaly detection and recovery processing on the target path in response to the target path existing; a third processing module configured to acquire a first path not aggregated corresponding to a multi-path device to which the target path belongs and perform multi-path aggregation processing on the first path in response to the target path being a first path of the multi-path device to which the target path belongs; a fourth processing module configured to determine whether a second detection period is reached in response to the target path not existing or the target path being a preset path; and a fifth processing module configured to acquire a second path not aggregated in a host system and perform multi-path aggregation processing on the second path in response to the second detection period being reached.
[0015] In an implementation, the second processing module can be configured to perform the following steps: performing a capacity detection step on the target path to determine whether the capacity of the target path is abnormal; in response to the capacity of the target path being abnormal and the number of times the capacity detection step has been performed being less than a preset threshold, returning to perform the capacity detection step; or, in response to the capacity of the target path being abnormal and the number of times the capacity detection step has been performed being equal to the preset threshold, determining whether there are other available paths in the multi-path to which the target path belongs; or, in response to the capacity of the target path being normal, continuing to perform the step of determining whether the target path is the first path of the multi-path device to which the target path belongs; in response to there being other available paths in the multi-path to which the target path belongs, deleting the target path; and rescanning the target path to perform multi-path aggregation processing on the target path.
[0016] In an implementation, the third processing module can be configured to: obtain a target device identifier corresponding to the multi-path device to which the target path belongs; obtain a first path set, the paths in the first path set belonging to the multi-path device with the same device identifier as the target device identifier; obtain a second path set, the paths in the second path set being aggregated paths corresponding to the multi-path device to which the target path belongs; and compare the first path set and the second path set to obtain the first path, the first path being a path in the second path set that is different from the first path set.
[0017] In an implementation, the first path is at least one, and for each first path, the third processing module can be configured to: perform a capacity detection step on the first path to determine whether the capacity of the first path is abnormal; in response to the capacity of the first path being abnormal and the number of times the capacity detection step has been performed being less than a preset threshold, returning to perform the capacity detection step; or, in response to the capacity of the first path being abnormal and the number of times the capacity detection step has been performed being equal to the preset threshold, removing the first path; and rescanning the first path to perform multi-path aggregation processing on the first path.
[0018] In an optional implementation, the third processing module can be further configured to: in response to the capacity of the first path being normal, directly performing multi-path aggregation processing on the first path.
[0019] In an implementation manner, the fifth processing module can be configured to: acquire a first device identifier set, wherein each device identifier in the first device identifier set is a device identifier corresponding to each multi-path device in the host system; acquire a second device identifier set, wherein each device identifier in the second device identifier set is a device identifier corresponding to each path in the host system; compare the first device identifier set with the second device identifier set to obtain a target device identifier, wherein the target device identifier is a device identifier in the second device identifier set that is different from the first device identifier set; and acquire a path to which a multi-path device corresponding to the target device identifier belongs as the second path.
[0020] In an implementation manner, the second processing module can be further configured to: determine whether the target path reaches a first detection period; and in response to the target path reaching the first detection period, perform the steps of detecting and recovering the capacity abnormality of the target path.
[0021] In an implementation manner, the fourth processing module can be configured to: acquire a target device identifier corresponding to a multi-path device to which the target path belongs; determine whether the target device identifier satisfies a preset condition; and in response to the target device identifier satisfying the preset condition, determine that the target path is the preset path.
[0022] In an optional implementation manner, the fourth processing module can be configured to: in response to the target device identifier being a minimum device identifier in the host system to which the target path belongs, determine that the target path is the preset path.
[0023] In a third aspect, an electronic device is provided, which includes at least one processor, and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the multi-path abnormality processing method according to the first aspect.
[0024] In a fourth aspect, a storage medium is provided, wherein the storage medium stores instructions, and when the instructions are run on an electronic device, the electronic device performs the method according to the first aspect.
[0025] In a fifth aspect, a program product is provided, which includes at least one of a program and instructions, and when the at least one of the program and instructions is executed by an electronic device, the steps of the method according to the first aspect are implemented.
[0026] The multi-path exception processing method, device, equipment and storage medium provided by the application can perform capacity exception detection and recovery on the target path to be detected, and when the corresponding conditions are met, perform multi-path aggregation processing on the un-aggregated first path corresponding to the multi-path equipment to which the target path belongs, and perform multi-path aggregation processing on the un-aggregated second path in the host system. The stability of the storage path transmission can be ensured, and the storage access exception caused by path exception or un-aggregation can be avoided.
[0027] Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will become apparent to those skilled in the art upon examination of the following and / or can be learned by practice of the application. BRIEF DESCRIPTION OF DRAWINGS
[0028] The above and / or additional aspects and advantages of the application will become apparent and be readily understood by reference to the following description, and by practicing the application, as embodied in the examples, which will become apparent to those skilled in the art, from the following detailed description, the accompanying drawings, and the appended claims.
[0029] Figure 1 is a flowchart of a multi-path exception processing method provided by an embodiment of the application;
[0030] Figure 2 is a flowchart of another multi-path exception processing method provided by an embodiment of the application;
[0031] Figure 3 is a flowchart of another multi-path exception processing method provided by an embodiment of the application;
[0032] Figure 4 is a flowchart of another multi-path exception processing method provided by an embodiment of the application;
[0033] Figure 5 is a flowchart of a multi-path device capacity exception processing method provided by an embodiment of the application;
[0034] Figure 6 is a structural schematic diagram of a multi-path exception processing device provided by an embodiment of the application;
[0035] Figure 7 is a structural schematic diagram of an electronic device provided by an embodiment of the application. DETAILED DESCRIPTION
[0036] The embodiments of the application are described in detail below, and examples of the embodiments are shown in the drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the drawings are exemplary and are intended to explain the application, and cannot be understood as limiting the application.
[0037] The multi-path exception processing method and device of the embodiments of the application are described below with reference to the drawings.
[0038] Figure 1 is a flowchart of a multi-path abnormality processing method provided by an embodiment of the present application. As shown in the figure, the method can include but is not limited to the following steps: Figure 1
[0039] S101: Determine whether there is a target path to be detected.
[0040] For example, each path that has been aggregated in the host system is acquired in sequence as a target path to be detected.
[0041] It should be noted that in the embodiments of the present application, the terms "path", "path device" and the like can be replaced with each other.
[0042] S102: In response to the existence of the target path, perform capacity abnormality detection and recovery processing on the target path.
[0043] For example, if there is a target path, scan the target path to obtain the capacity state of the target path, and if the capacity of the target path is 0, determine that the target path is abnormal in capacity, and then perform recovery processing on the target path to include the target path in multi-path aggregation management.
[0044] In some embodiments, before performing capacity abnormality detection and recovery processing on the target path, the above method further includes: determining whether the target path reaches a first detection period; and in response to the target path reaching the first detection period, performing the steps of capacity abnormality detection and recovery processing on the target path.
[0045] S103: In response to the target path being a first path of a multi-path device to which the target path belongs, obtain a first path corresponding to the multi-path device that has not been aggregated, and perform multi-path aggregation processing on the first path.
[0046] In the embodiments of the present application, the first path refers to a path that preferentially carries data transmission among a plurality of paths corresponding to a multi-path device in a multi-path management scenario.
[0047] For example, after the capacity abnormality detection and recovery processing on the target path is completed, in response to the target path being a first path of a multi-path device to which the target path belongs, all paths corresponding to the multi-path device to which the target path belongs and the aggregated paths of the storage device corresponding to the target path are obtained, all paths are compared with an aggregated path, a first path corresponding to the multi-path device to which the target path belongs and not aggregated is obtained, and multi-path aggregation processing is performed on the first path.
[0048] It should be noted that the first path is at least one, and each first path can be subjected to multi-path aggregation processing.
[0049] In the embodiments of the present application, the aggregated path refers to a path that has been identified by the multi-path management system and integrated into the corresponding multi-path device. The un-aggregated path refers to a path that points to a storage device but has not been identified by the multi-path management system or included in the management of the corresponding multi-path device of the storage device.
[0050] S104: In response to the target path not existing or the target path being a preset path, obtaining a second un-aggregated path in the host system and performing multi-path aggregation processing on the second path.
[0051] As an example, in response to the target path not existing, obtaining all paths in the host system and all aggregated paths in the host system, comparing all the paths and the aggregated paths, obtaining a second un-aggregated path in the host system, and performing multi-path aggregation processing on the second path.
[0052] As an example, in response to the target path being a preset path, obtaining all paths in the host system and all aggregated paths in the host system, comparing all the paths and the aggregated paths, obtaining a second un-aggregated path in the host system, and performing multi-path aggregation processing on the second path.
[0053] In the embodiments of the present application, the host system refers to the overall operating environment that can identify all storage paths at the host level. As an example, the host system can be a server system.
[0054] In some embodiments, the determination of whether the target path is a preset path includes: obtaining a target device identifier corresponding to the multi-path device to which the target path belongs; determining whether the target device identifier satisfies a preset condition; and in response to the target device identifier satisfying the preset condition, determining that the target path is a preset path.
[0055] In some embodiments, the target device identifier corresponding to the multi-path device to which the target path belongs can be a device identifier of a storage device corresponding to the multi-path device.
[0056] In some embodiments, the device identifier can be a WWID (World Wide Identifier).
[0057] As an example, the target device identifier of the storage device corresponding to the target path is obtained, and if the device identifier is the same as a pre-specified device identifier, it is determined that the target path is a preset path.
[0058] In an implementation, in response to the device identifier of the multi-path device to which the target path belongs satisfying a preset condition, determining that the target path is a preset path includes: in response to the target device identifier being the smallest device identifier in the host system to which the target path belongs, determining that the target path is a preset path.
[0059] Exemplarily, if the target device identifier is the smallest among the device identifiers of all the storage devices in the host system, the target path is determined as the preset path.
[0060] In some embodiments of the present application, before the steps of obtaining the second path not aggregated in the host system and performing the multi-path aggregation processing on the second path, it can be determined whether the preset second detection period is reached, and when the second detection period is reached, the steps of obtaining the second path not aggregated in the host system and performing the multi-path aggregation processing on the second path are continued to be executed, so as to avoid abnormal consumption of system resources caused by frequent detection.
[0061] In another embodiment, if the preset second detection period is not reached, the abnormal processing flow ends.
[0062] In the embodiments of the present application, the host system is the system to which the multi-path abnormal processing method of the embodiments of the present application is deployed.
[0063] It should be noted that the second path is at least one, and the multi-path aggregation processing can be performed on each second path respectively.
[0064] The multi-path abnormal processing related to the embodiments of the present disclosure can include at least one of steps S101-S104. For example, step 104 can be implemented as an independent embodiment, but is not limited thereto.
[0065] In some embodiments, steps S103 and S104 can be exchanged in order or executed simultaneously.
[0066] In some embodiments, step S101 is optional, and one or more of these steps can be omitted or replaced in different embodiments.
[0067] In some embodiments, step S102 is optional, and one or more of these steps can be omitted or replaced in different embodiments.
[0068] By implementing the embodiments of the present application, the capacity abnormality detection and recovery of the target path to be detected can be performed, and when the corresponding conditions are met, the multi-path aggregation processing on the first path not aggregated corresponding to the multi-path device to which the target path belongs can be performed, and the multi-path aggregation processing on the second path not aggregated in the host system can be performed. The stability of the storage path transmission can be guaranteed, and the storage access abnormality caused by path abnormality or non-aggregation can be avoided.
[0069] In some embodiments, it can be determined whether there is an unaggregated path in the multi-path device to which the target path belongs, and if there is an unaggregated path, the unaggregated path capacity abnormality problem is repaired and aggregated. As an example, please refer to Figure 2 , Figure 2 is a flow diagram of another multi-path exception processing method provided by an embodiment of the present application. As shown in Figure 2 , the method can include but is not limited to the following steps:
[0070] S201: Determine whether there is a target path to be detected.
[0071] In an embodiment of the present application, step S201 can be implemented by any of the embodiments of the present application, and the present application does not limit this and will not be repeated.
[0072] S202: In response to the existence of the target path, the capacity of the target path is detected to determine whether the capacity of the target path is abnormal.
[0073] For example, the target path is scanned to obtain the capacity state of the target path, and if it is determined that the capacity is empty, it is determined whether the capacity of the target path is abnormal.
[0074] S203: In response to the capacity of the target path being abnormal, and the number of times of execution of S202 being less than a preset threshold, return to execute S202; or, in response to the capacity of the target path being abnormal, and the number of times of execution of S202 being equal to the preset threshold, determine whether there is another available path in the multi-path to which the target path belongs.
[0075] As an example, in response to the capacity of the target path being abnormal, and the number of times of scanning the target path being less than a preset number of times threshold, the target path can be scanned again after a period of time to obtain the capacity state of the target path again.
[0076] As an example, in response to the capacity of the target path being abnormal, and the number of times of scanning the target path being equal to the preset threshold, it is determined whether there is another available path in the multi-path to which the target path belongs.
[0077] In other embodiments, in response to the capacity of the target path being normal, the step of determining whether the target path is the first path of the multi-path device to which the target path belongs is continued.
[0078] S204: In response to there being another available path in the multi-path to which the target path belongs, the target path is deleted.
[0079] For example, in response to there being another available path device in the multi-path device to which the target path belongs, the above target path device.
[0080] S205: rescanning the target path to perform a multi-path aggregation processing on the target path.
[0081] For example, the target path is rescanned to trigger a path device addition event, so as to re-add the target path to the device.
[0082] S206: in response to the target path being a first path of a multi-path device to which the target path belongs, obtaining a first path corresponding to the multi-path device to which the target path belongs and not aggregated, and performing a multi-path aggregation processing on the first path.
[0083] In the embodiments of the present application, step S206 can be implemented by any one of the embodiments of the present application, and the present application does not limit this and will not be repeated.
[0084] S207: in response to the target path not existing or being a preset path, obtaining a second path not aggregated in the host system and performing a multi-path aggregation processing on the second path.
[0085] In the embodiments of the present application, step S207 can be implemented by any one of the embodiments of the present application, and the present application does not limit this and will not be repeated.
[0086] By implementing the embodiments of the present application, at least one capacity anomaly detection can be performed on the target path to determine whether the capacity corresponding to the target path is abnormal, and the target path is deleted and rescanned when it is determined that the capacity corresponding to the target path is abnormal, so as to repair the target path. The stability of the storage path transmission can be ensured, and the storage access anomaly caused by the path anomaly can be avoided.
[0087] In some embodiments, the first path corresponding to the multi-path device to which the target path belongs and not aggregated can be obtained based on the device identifier corresponding to the multi-path device to which the target path belongs. As an example, please refer to Figure 3 , Figure 3 is a flow diagram of another multi-path anomaly processing method provided by an embodiment of the present application. As shown in Figure 3 , the method can include but is not limited to the following steps:
[0088] S301: determining whether there is a target path to be detected.
[0089] In the embodiments of the present application, step S301 can be implemented by any one of the embodiments of the present application, and the present application does not limit this and will not be repeated.
[0090] S302: in response to the target path existing, performing a capacity anomaly detection and recovery processing on the target path.
[0091] In the embodiments of the present application, step S302 can be implemented by any of the embodiments of the present application, and the embodiments of the present application do not limit this and will not be repeated here.
[0092] S303: In response to the target path being the first path of the multi-path device to which the target path belongs, obtaining the target device identifier corresponding to the multi-path device to which the target path belongs.
[0093] For example, it is determined whether the target path is the first path of the multi-path device to which the target path belongs, and when the target path is the first path of the multi-path device to which the target path belongs, the target device identifier of the storage device corresponding to the target path is obtained.
[0094] In other embodiments, if the target path is not the first path of the multi-path device to which the target path belongs, the step of determining whether the second detection period is reached in response to the target path not existing or the target path being a preset path provided by any of the embodiments of the present application can be directly executed.
[0095] S304: Obtain a first path set, and the paths in the first path set are the aggregated paths corresponding to the multi-path device to which the target path belongs.
[0096] For example, the device identifier of the multi-path device to which the target path belongs is obtained, and then all paths contained in the storage device corresponding to the identifier are filtered from all aggregated multi-path devices of the host system in which the target path is located to form the first path set.
[0097] S305: Obtain a second path set, and the paths in the second path set correspond to the storage device with the same device identifier as the target device identifier.
[0098] For example, the target device identifier of the storage device corresponding to the target path is determined, and then all identifiable path devices in the host system are scanned to extract the device identifier of the storage device corresponding to each path device, and the paths with the same device identifier as the target device identifier are filtered by comparison to form the second path set.
[0099] S306: Compare the first path set with the second path set to obtain the first path, and perform multi-path aggregation processing on the first path.
[0100] The first path is different from the paths in the second path set.
[0101] In some embodiments, the above multi-path aggregation processing on the first path can include the following steps A1-A3:
[0102] A1: Perform capacity detection on the first path to determine whether the capacity of the first path is abnormal.
[0103] Exemplarily, the first path is scanned to obtain a capacity state of the first path, and it is determined whether the capacity of the first path is abnormal if the capacity is determined to be empty.
[0104] A2: in response to the capacity of the first path being abnormal, and the number of times of execution of A1 being less than a preset threshold, returning to execute A1; or, in response to the capacity of the first path being abnormal, and the number of times of execution of A1 being equal to the preset threshold, removing the first path.
[0105] As an example, in response to the capacity of the first path being abnormal, and the number of times of scanning of the first path being less than a preset number threshold, the first path can be scanned again after a period of time to obtain the capacity state of the first path again.
[0106] As an example, in response to the capacity of the first path being abnormal, and the number of times of scanning of the first path being equal to the preset threshold, the first path is removed.
[0107] In some embodiments, in response to the capacity of the first path being normal, the first path is directly subjected to multi-path aggregation.
[0108] A3: the first path is scanned again to perform multi-path aggregation processing on the first path.
[0109] Exemplarily, the first path is scanned again to trigger a path addition event, so as to rescan the first path into the device and perform multi-path aggregation on the first path.
[0110] S307: in response to the target path not existing or being a preset path, a second path not aggregated in a host system is obtained, and multi-path aggregation processing is performed on the second path.
[0111] In the embodiments of the present application, step S307 can be implemented by any one of the embodiments of the present application, and the present application does not limit this, and will not be repeated here.
[0112] By implementing the embodiments of the present application, when the target path is the first path, the first path not aggregated in the multi-path device to which the target path belongs can be obtained, and multi-path aggregation processing is performed on the first path. It can avoid the storage access abnormality caused by the path not being aggregated.
[0113] In some embodiments, the second path not aggregated in the host system can be obtained based on the device identifiers of each storage device in the host system to which the target path belongs. As an example, please refer to Figure 4 , Figure 4 is a flow diagram of another multi-path abnormality processing method provided by the embodiments of the present application. As shown in Figure 4 , the method can include but is not limited to the following steps:
[0114] S401: Determine whether there is a target path to be detected.
[0115] In the embodiments of the present application, step S401 can be implemented by any of the embodiments of the present application, and the present application does not limit this and will not be repeated.
[0116] S402: In response to the existence of the target path, performing capacity anomaly detection and recovery processing on the target path.
[0117] In the embodiments of the present application, step S402 can be implemented by any of the embodiments of the present application, and the present application does not limit this and will not be repeated.
[0118] S403: In response to the target path being the first path of the multi-path device to which the target path belongs, obtaining a first path corresponding to the multi-path device of the target path without aggregation, and performing multi-path aggregation processing on the first path.
[0119] In the embodiments of the present application, step S403 can be implemented by any of the embodiments of the present application, and the present application does not limit this and will not be repeated.
[0120] S404: In response to the absence of the target path or the target path being a preset path, obtaining a first device identifier set, and the device identifiers in the first device identifier set being the device identifiers corresponding to each multi-path device in the host system.
[0121] For example, the device identifiers of the storage devices corresponding to all multi-path devices that have completed path aggregation in the host system are obtained, and the remaining device identifiers after deduplication of the obtained device identifiers are grouped to form the first device identifier set.
[0122] S405: Obtain a second device identifier set, and the device identifiers in the second device identifier set being the device identifiers corresponding to each path in the host system.
[0123] The device identifier corresponding to the path can be the device identifier of the storage device corresponding to the path.
[0124] For example, all path devices currently identifiable by the host system are scanned, the device identifiers of the storage devices corresponding to each path are extracted, and the remaining device identifiers after deduplication of the obtained device identifiers are grouped to form the second device identifier set.
[0125] S406: Compare the first device identifier set and the second device identifier set to obtain a target device identifier, and the target device identifier being a device identifier in the second device identifier set that is different from the first device identifier set.
[0126] S407: Obtain the path to which the target device identifier corresponds as a second path.
[0127] S408: Perform multi-path aggregation processing on the second path.
[0128] In the embodiments of the present application, the specific implementation mode of performing multi-path aggregation processing on the second path can be the same as the specific implementation mode of performing multi-path aggregation processing on the first path, and the present application will not be repeated here.
[0129] By implementing the embodiments of the present application, the second path that is not aggregated in the host system can be obtained, and the second path can be subjected to multi-path aggregation processing. The storage access exception caused by the unaggregated path can be avoided.
[0130] Please refer to Figure 5 , Figure 5 is a schematic diagram of a multi-path device capacity exception processing flow provided by the embodiments of the present application. As shown in Figure 5 , the flow can include the following steps:
[0131] Step S501: Determine whether there is at least one path device to be detected; if yes, jump to step S502, otherwise it is indicated that there is no multi-path volume (there is a path device that is not aggregated or there is no any path device), and jump to step S521.
[0132] Step S502: Determine whether the path X (i.e. the aforementioned path device to be detected) reaches the path detection period. If yes, jump to step S503, otherwise end.
[0133] Step S503: Whether the path X capacity is empty; if yes, jump to step S504, otherwise jump to step S508.
[0134] Step S504: Rescan the path X.
[0135] Step S505: Whether the path X capacity is empty. If yes, jump to step S506, otherwise jump to step S508.
[0136] Step S506: Whether the path X belongs to a multi-path that has other available paths. If yes, jump to step S507, otherwise it is indicated that it is the last path of the multi-path volume, and no deletion action is performed, and jump to step S508.
[0137] Step S507: Delete the path X and set the path X to be invalid. Rescan the path X and trigger the path X addition event. Jump to step S508.
[0138] Step S508: whether path X is the first path of the path queue of the multi-path volume. If yes, jump to step S509, otherwise jump to step S520.
[0139] Step S509: get the set M of all aggregated path devices of the volume to which path X belongs.
[0140] Step S510: get the set N of all paths in the host system that have the same identification (e.g. WWID) as path X.
[0141] Step S511: determine whether the number of elements of set M is less than the number of elements of set N. If yes, jump to step S512, otherwise jump to step S520.
[0142] Step S512: get the set L of un-aggregated path devices of set N. Initialize variable i to 0.
[0143] Step S513: determine whether i is less than the total number of path devices in set L. If yes, it means that there are other un-aggregated path devices of the multi-path device to which path X belongs, jump to step S514. Otherwise jump to step S520.
[0144] Step S514: determine whether the capacity of path device i is abnormal. If yes, jump to step S515. Otherwise jump to step S518.
[0145] Step S515: re-scan path device i.
[0146] Step S516: determine whether the capacity of path device i is abnormal. If yes, jump to step S517. Otherwise jump to step S518.
[0147] Step S517: delete path device i. Re-scan path device i.
[0148] Step S518: trigger a path device i addition event.
[0149] Step S519: increment variable i. Then jump to step S513.
[0150] Step S520: determine whether the identification of the volume to which path X belongs is the smallest among all multi-path volumes. If yes, jump to step S521, otherwise end.
[0151] Step S521: whether the un-aggregated detection interval has reached 4 path detection periods. If yes, jump to step S523, otherwise jump to step S522.
[0152] Step S522: increment the un-aggregated detection interval by 1 path detection period. Then end.
[0153] Step S523: Obtain all the aggregated multi-path device identification set P.
[0154] Step S524: Obtain the identification set Q of all paths in the host system.
[0155] Step S525: Determine whether the number of elements of set P is less than the number of elements of set Q. If yes, jump to step S526, otherwise jump to step S534.
[0156] Step S526: Query the path device set T in the host system consistent with the un-aggregated identification in set Q. Initialize variable j to 0.
[0157] Step S527: Determine whether j is less than the total number of path devices in set T. If yes, it means that there is an un-aggregated path device, jump to step S528. Otherwise jump to step S534.
[0158] Step S528: Determine whether the capacity of path device j is abnormal. If yes, jump to step S529. Otherwise jump to step S532.
[0159] Step S529: Rescan path device j.
[0160] Step S530: Determine whether the capacity of path device j is abnormal. If yes, jump to step S531. Otherwise jump to step S532.
[0161] Step S531: Delete path device j. Rescan path device j.
[0162] Step S532: Trigger path device j addition event.
[0163] Step S533: Increment variable j. Then jump to step S527.
[0164] Step S534: Reset the un-aggregated detection interval to 0, and then end.
[0165] See Figure 6 , Figure 6 is a structural schematic diagram of a multi-path abnormality processing device provided by an embodiment of the present application. As shown in Figure 6As shown, the apparatus 600 comprises: a first processing module 601 configured to determine whether there is a target path to be detected; a second processing module 602 configured to, in response to the existence of the target path, perform capacity anomaly detection and recovery processing on the target path; a third processing module 603 configured to, in response to the target path being a first path of a multi-path device to which the target path belongs, acquire a first path corresponding to the multi-path device which is not aggregated, and perform multi-path aggregation processing on the first path; a fourth processing module 604 configured to, in response to the non-existence of the target path or the target path being a preset path, determine whether a second detection period is reached; and a fifth processing module 605 configured to, in response to the second detection period being reached, acquire a second path which is not aggregated in a host system, and perform multi-path aggregation processing on the second path.
[0166] In an implementation manner, the second processing module 602 can be configured to perform the following steps: performing a capacity detection step on the target path to determine whether the capacity of the target path is abnormal; in response to the capacity of the target path being abnormal and the number of times of performing the capacity detection step being less than a preset threshold, returning to perform the capacity detection step; or, in response to the capacity of the target path being abnormal and the number of times of performing the capacity detection step being equal to the preset threshold, determining whether there is another available path in a multi-path to which the target path belongs; or, in response to the capacity of the target path being normal, continuing to perform the step of determining whether the target path is a first path of a multi-path device to which the target path belongs; in response to there being another available path in the multi-path to which the target path belongs, deleting the target path; and rescanning the target path to perform multi-path aggregation processing on the target path.
[0167] In an implementation manner, the third processing module 603 can be configured to: acquire a target device identifier corresponding to a multi-path device to which the target path belongs; acquire a first path set, the paths in the first path set belonging to a multi-path device with the same device identifier as the target device identifier; acquire a second path set, the paths in the second path set being aggregated paths corresponding to the multi-path device to which the target path belongs; and compare the first path set and the second path set to acquire a first path, the first path being a path in the second path set which is different from the first path set.
[0168] In an implementation manner, the first paths are at least one, for each first path, the third processing module 603 can be configured to: perform a capacity detection step on the first path to determine whether the capacity of the first path is abnormal; in response to the capacity of the first path being abnormal and the number of times of performing the capacity detection step being less than a preset threshold, return to perform the capacity detection step; or, in response to the capacity of the first path being abnormal and the number of times of performing the capacity detection step being equal to the preset threshold, remove the first path; and rescan the first path to perform a multi-path aggregation processing on the first path.
[0169] In an optional implementation manner, the third processing module 603 can be further configured to: in response to the capacity of the first path being normal, directly perform a multi-path aggregation processing on the first path.
[0170] In an implementation manner, the fifth processing module 605 can be configured to: obtain a first device identifier set, the device identifiers in the first device identifier set being device identifiers corresponding to each multi-path device in the host system; obtain a second device identifier set, the device identifiers in the second device identifier set being device identifiers corresponding to each path in the host system; compare the first device identifier set and the second device identifier set to obtain a target device identifier, the target device identifier being a device identifier in the second device identifier set that is different from the first device identifier set; and obtain a path to which a multi-path device corresponding to the target device identifier belongs as the second path.
[0171] In an implementation manner, the second processing module 602 can be further configured to: determine whether the target path reaches a first detection period; and in response to the target path reaching the first detection period, perform the steps of performing capacity abnormality detection and recovery processing on the target path.
[0172] In an implementation manner, the fourth processing module 604 can be configured to: obtain a target device identifier corresponding to a multi-path device to which the target path belongs; determine whether the target device identifier satisfies a preset condition; and in response to the target device identifier satisfying the preset condition, determine that the target path is a preset path.
[0173] In an optional implementation manner, the fourth processing module 604 can be configured to: in response to the target device identifier being a minimum device identifier in the host system to which the target path belongs, determine that the target path is the preset path.
[0174] Through the device of the embodiment of the present application, capacity anomaly detection and recovery can be performed on the target path to be detected, and when the corresponding conditions are met, the first path corresponding to the multi-path device to which the target path belongs is subjected to multi-path aggregation processing, and the second path in the host system is subjected to multi-path aggregation processing. The stability of the storage path transmission can be ensured, and the storage access anomaly caused by path anomaly or non-aggregation can be avoided.
[0175] It should be noted that the foregoing explanation and description of the multi-path anomaly processing method embodiment also applies to the multi-path anomaly processing device of the embodiment, which will not be described here.
[0176] In order to realize the above-mentioned embodiment, the present application further provides an electronic device. Please refer to Figure 7 , Figure 7 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 7 , the electronic device 700 comprises a processor 701 and a memory 702 connected with the processor 701 in communication; the memory 702 stores computer execution instructions; the processor 701 executes the computer execution instructions stored in the memory to realize the method provided by the foregoing embodiment.
[0177] In order to realize the above-mentioned embodiment, the present application further provides a storage medium, and the storage medium stores instructions, when the instructions run on the electronic device, the electronic device executes the method provided by the foregoing embodiment.
[0178] In order to realize the above-mentioned embodiment, the present application further provides a program product, comprising at least one of a program and an instruction, and the at least one of the program and the instruction is executed by the electronic device to realize the steps of the method provided by the foregoing embodiment.
[0179] It should be noted that the acquisition, transmission, storage, use, processing, etc. of data in the technical solutions of the present application all comply with the relevant provisions of national laws and regulations, and do not violate public order and good customs.
[0180] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0181] It should be noted that in the embodiments of the present application, some industry existing solutions, components, models, etc. may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0182] In the description of the present application, unless otherwise stated, " / " means the meaning of or, for example, A / B can mean A or B; "and / or" herein is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone.
[0183] In the foregoing embodiment description, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction.
[0184] In addition, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "multiple" is at least two, for example, two, three, etc., unless otherwise specifically limited.
[0185] Any process or method descriptions in flow charts or otherwise described herein can be understood as representing code modules, segments, or portions of code that include one or more executable instructions for implementing the specified logic functions or processes, and the preferred embodiments of the present application also include additional implementation examples, in which the functions can be performed in different orders, in substantially simultaneous fashion, or in reverse order, depending on the functionality involved, as would be understood by persons skilled in the art of the embodiments of the present application.
[0186] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of executable instructions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a product of the manufacturing and / or processing. The computer-readable medium can include, but is not limited to, the following: an electronic connection (an electronic device having one or more wires), a portable computer diskette (a magnetic device), a RAM (random access memory), a ROM (read-only memory), an EPROM (erasable programmable ROM) or Flash memory, an optical fiber device, and a portable CD ROM. Additionally, the computer-readable medium can be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for example, an optical scanner, then compiled, interpreted, or otherwise processed, and stored in a computer memory in order to be executed.
[0187] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. As such, in some embodiments, specifically configured hardware can be used to implement at least some of the functionality described herein. For example, if implemented in hardware, the hardware can include any or a combination of the following: a discrete logic circuit having logic gates for implementing logic functions upon data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0188] Those of skill in the art would understand that information and signals can be represented using any of a variety of technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that can be referenced throughout the above description can be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
[0189] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0190] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A method of handling a multi-path exception, the method comprising: The method comprises: determining whether a target path to be detected exists; performing capacity anomaly detection and recovery processing on the target path in response to the existence of the target path; in response to the target path being a first path of a multi-path device to which the target path belongs, obtaining a first path corresponding to the multi-path device to which the target path belongs and not aggregated, and performing multi-path aggregation processing on the first path; wherein the first path refers to a path that preferentially carries data transmission among a plurality of paths corresponding to a multi-path device in a multi-path management scenario; in response to the target path not existing or being a preset path, obtaining a second path not aggregated in a host system and performing multi-path aggregation processing on the second path; the capacity anomaly detection and recovery processing on the target path comprises: performing a capacity detection step on the target path to determine whether the capacity of the target path is abnormal; in response to the capacity of the target path being abnormal and the number of times the capacity detection step has been performed being less than a preset threshold, returning to perform the capacity detection step; or, in response to the capacity of the target path being abnormal and the number of times the capacity detection step has been performed being equal to the preset threshold, determining whether there is another available path in the multi-path to which the target path belongs; or, in response to the capacity of the target path not being abnormal, continuing to perform the step of determining whether the target path is the first path of the multi-path device to which the target path belongs; in response to there being another available path in the multi-path to which the target path belongs, deleting the target path; re-scanning the target path to perform multi-path aggregation processing on the target path.
2. The method of claim 1, wherein, the obtaining of the first path corresponding to the multi-path device to which the target path belongs and not aggregated comprises: obtaining a target device identifier corresponding to the multi-path device to which the target path belongs; obtaining a first path set, the device identifier corresponding to the multi-path device of the path in the first path set being the same as the target device identifier; obtaining a second path set, the path in the second path set being an aggregated path corresponding to the multi-path device to which the target path belongs; comparing the first path set and the second path set to obtain the first path, the first path being a path different from the first path set in the second path set.
3. The method according to claim 1 or 2, characterized in that, The first path is at least one, and for each first path, the multi-path aggregation processing on the first path comprises: performing a capacity detection step on the first path to determine whether the capacity of the first path is abnormal; in response to the capacity of the first path being abnormal and the number of times the capacity detection step has been performed being less than a preset threshold, returning to perform the capacity detection step; or, in response to the capacity of the first path being abnormal and the number of times the capacity detection step has been performed being equal to the preset threshold, removing the first path; re-scanning the first path to perform multi-path aggregation processing on the first path.
4. The method of claim 3, wherein, The method further comprises: in response to the capacity of the first path not being abnormal, directly performing multi-path aggregation processing on the first path.
5. The method of claim 1, wherein, The second path not aggregated in the host system is acquired, comprising: acquiring a first device identifier set, the device identifier in the first device identifier set being the device identifier corresponding to each multi-path device in the host system; acquiring a second device identifier set, the device identifier in the second device identifier set being the device identifier corresponding to each path in the host system; comparing the first device identifier set and the second device identifier set to obtain a target device identifier, the target device identifier being the device identifier in the second device identifier set different from the first device identifier set; acquiring the path to which the multi-path device corresponding to the target device identifier belongs as the second path.
6. The method of claim 1, wherein, Before the capacity anomaly detection and recovery processing on the target path, the method further comprises: determining whether the target path reaches a first detection period; in response to the target path reaching the first detection period, performing the steps of the capacity anomaly detection and recovery processing on the target path.
7. The method of claim 1, wherein, The target path is determined to be a preset path by the following steps: acquiring a target device identifier corresponding to the multi-path device to which the target path belongs; determining whether the target device identifier meets a preset condition; in response to the target device identifier meeting the preset condition, determining that the target path is the preset path.
8. The method of claim 7, wherein, In response to the device identifier of the multi-path device to which the target path belongs meeting a preset condition, the target path is determined to be the preset path, comprising: in response to the target device identifier being the smallest device identifier in the host system to which the target path belongs, determining that the target path is the preset path.
9. An electronic device, comprising: comprising: a processor, and a memory in communication connection with the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to realize the method in any one of claims 1-8.
Citation Information
Patent Citations
Dynamic multipath optimization method, system and equipment based on cloud network fusion technology
CN113438164A
Storage multi-path aggregation method, multi-path aggregation device and electronic equipment
CN117155853A