Path management method, computer readable storage medium and electronic device
By maintaining the global path linked list and bitmap, re-adding the storage space of paths and multipath devices, the problem of low release efficiency of data structures when failure timeout is solved, and the rapid recovery of host multipath disks is achieved.
Patent Information
- Application Number
- CN202411372919.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In the case where the failure of the path or storage area network timeout, the path will be deleted in the prior art, resulting in low release efficiency of the data structure, which in turn affects the rapid recovery of the host multipath disk.
By maintaining the global path linked list and the global path bitmap, the attribute information of path and multipath device is cached, and when failing to recover, the storage space of path and multipath device is re-added, delaying the deletion of useless data structures, ensuring that the host multipath disk Quick recovery.
Improves the efficiency during failure recovery, ensures that the host multipath disks quickly recover to available state, and solves the problem of low data structure release efficiency.
Smart Images

Figure CN118885133B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a path management method, a computer-readable storage medium, and an electronic device. Background Art
[0002] The I / O (Input / Output) path is the data transmission path between the host and the SAN (Storage Area Network) system. When there is only one I / O path, if any element on the I / O path fails, the host cannot access the storage system and the application on the host cannot continue to run.
[0003] To improve availability, two or more parallel paths can be established between the host and the SAN network storage system, and a multipath driver can be implemented on the host operating system to distribute I / O to different paths and transfer I / O to other paths when a path fails.
[0004] It should be noted that the management of multipath devices and paths in the related technology will apply for related data structures when adding new paths and multipath devices, and release related data structures when deleting multipath devices and paths. In the scenario of a large number of volumes, when a path fails for a long time, or the storage controller is cold restarted, or the storage system is upgraded, the path will be deleted and the related data structures will be released when the failure timeout occurs. When the failure is eliminated, the path and the related data structures of the multipath device need to be re-applied, and it takes a long time for the host's multipath disk to recover to an available state. Summary of the invention
[0005] The embodiments of the present application provide a path management method, a computer-readable storage medium, and an electronic device to at least solve the problem in the related art that when a path or storage area network fails and times out, the path will be deleted and the related data structure will be released. When the fault is eliminated, the multi-path disk of the host is restored to an available state in an inefficient manner.
[0006] According to an embodiment of the present application, a path management method is provided, including: responding to a creation instruction of a first path, querying whether there is attribute information of the first path in a global path linked list; if the attribute information of the first path exists in the global path linked list, querying whether there is attribute information of a first multipath device to which the first path belongs in the global path linked list, wherein the global path linked list is used to cache the attribute information of the path and the attribute information of the multipath device; if the attribute information of the first multipath device does not exist in the global path linked list, querying whether there is attribute information of the first multipath device in a global path bitmap, wherein the global path bitmap is used to cache the attribute information of the multipath device, the attribute information of the multipath device in the global path linked list is deleted when a path deletion event is triggered, and the attribute information of the path in the global path linked list and the multipath device in the global path bitmap are deleted when a delayed deletion condition is met; if the attribute information of the first multipath device exists in the global path bitmap, the attribute information of the first multipath device is added to the global path linked list, and the first path is added to the storage space of the first multipath device.
[0007] In an exemplary embodiment, a first path is used to connect a host and a disk in a storage area network. In response to a creation instruction of the first path, querying whether there is attribute information of the first path in a global path linked list includes: obtaining target host information of a host to be connected by the first path and a target disk identifier of a disk to be connected by the first path; querying whether there is a path associated with the target host information and the target disk identifier in the global path linked list; if there is a path associated with the target host information and the target disk identifier in the global path linked list, determining that there is attribute information of the first path in the global path linked list; if there is no path associated with the target host information and the target disk identifier in the global path linked list, determining that there is no attribute information of the first path in the global path linked list.
[0008] In an exemplary embodiment, after querying whether there is attribute information of the first path in the global path linked list, it also includes: if the attribute information of the first path does not exist in the global path linked list, collecting the attribute information of the first path; adding the attribute information of the first path to the global path linked list, and executing the step of querying whether there is attribute information of the first multipath device to which the first path belongs in the global path linked list.
[0009] In an exemplary embodiment, the global path bitmap is also used to store the status of the path in the global path linked list and the delayed deletion flag of the path's attribute information. After querying whether the attribute information of the first path exists in the global path linked list, it also includes: when the attribute information of the first path exists in the global path linked list, setting the status of the first path to a non-removal state in the global path bitmap, setting the delayed deletion flag of the attribute information of the first path to a second preset value, and setting the path reuse flag in the attribute information of the first path to a first preset value.
[0010] In an exemplary embodiment, after querying whether there is attribute information of the first multipath device to which the first path belongs in the global path linked list, the method further includes: if the attribute information of the first multipath device exists in the global path linked list, executing the step of adding the first path to the storage space of the first multipath device.
[0011] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After the attribute information of the first multipath device is added to the global path linked list, it also includes: setting the status of the first multipath device to a non-removal state in the global path bitmap, and setting the delayed deletion flag of the attribute information of the first multipath device to a second preset value.
[0012] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After querying whether the attribute information of the first multipath device exists in the global path bitmap, it also includes: when the attribute information of the first multipath device does not exist in the global path bitmap, collecting the attribute information of the first multipath device, and adding the attribute information of the first multipath device to the global path linked list; setting the status of the first multipath device in the global path bitmap to a non-removal state, and setting the delayed deletion flag of the attribute information of the first multipath device to a second preset value.
[0013] In an exemplary embodiment, adding a first path to the storage space of a first multipath device includes: querying a path reuse flag in the attribute information of the first path; when the path reuse flag is a second preset value, querying the latest storage space of the first multipath device and adding the first path to the latest storage space; when the path reuse flag is a first preset value, adding the first path to the historical storage space of the first multipath device.
[0014] In an exemplary embodiment, the method further includes: in response to a deletion event of the second path, setting the status in the attribute information of the second path in the global path linked list to a closed state; querying the global path linked list for the status of all paths of a second multipath device to which the second path belongs; and when the status of all paths of the second multipath device is the closed state, deleting the attribute information of the second multipath device from the global path linked list.
[0015] In an exemplary embodiment, the global path bitmap is also used to store the status of the path in the global path linked list and the delayed deletion flag of the path's attribute information. After setting the status in the attribute information of the second path in the global path linked list to a closed state, it also includes: setting the path reuse flag in the attribute information of the first path to a second preset value; setting the status of the second path in the global path bitmap to a removed state, and setting the delayed deletion flag of the attribute information of the second path to a first preset value.
[0016] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After querying the status of all paths of the second multipath device to which the second path belongs in the global path linked list, it also includes: when the status of all paths of the second multipath device is a closed state, the status of the second multipath device is set to a removed state in the global path bitmap, and the delayed deletion flag of the attribute information of the second multipath device is set to a first preset value.
[0017] In an exemplary embodiment, it also includes: periodically traversing each multipath device in the global path bitmap, determining in turn whether each path of the current multipath device meets the first delayed deletion condition, and if the current path meets the first delayed deletion condition, deleting the attribute information of the current path in the global path linked list until all paths of the current multipath device are traversed.
[0018] In an exemplary embodiment, it also includes: when all paths of the current multipath device are deleted in the global path linked list, determining whether the current multipath device meets the second delayed deletion condition; when the current multipath device meets the second delayed deletion condition, deleting the attribute information of the current multipath device in the global path bitmap until all multipath devices in the global path bitmap are traversed.
[0019] In an exemplary embodiment, determining in turn whether each path of the current multipath device meets the first delayed deletion condition includes: determining whether a delayed deletion flag of the attribute information of the current path is a first preset value; if the delayed deletion flag is the first preset value, determining whether the current path carries a forced deletion flag; if the current path carries a forced deletion flag, determining that the current path meets the first delayed deletion condition; if the current path does not carry a forced deletion flag, determining whether the cache duration of the attribute information of the current path reaches a first cleanup time threshold; if the cache duration of the attribute information of the current path reaches the first cleanup time threshold, determining that the current path meets the first delayed deletion condition.
[0020] In an exemplary embodiment, after deleting the attribute information of the current multipath device in the global path bitmap, the method further includes: setting the state of the current path in the global path bitmap to a removal state, and setting a delayed deletion flag of the attribute information of the current path to a second preset value.
[0021] In an exemplary embodiment, determining whether the current multipath device meets the second delayed deletion condition includes: determining whether a delayed deletion flag of the attribute information of the current multipath device is a first preset value; if the delayed deletion flag is the first preset value, determining whether the current multipath device carries a forced deletion flag; if the current multipath device carries a forced deletion flag, determining that the current multipath device meets the second delayed deletion condition; if the current multipath device does not carry a forced deletion flag, determining whether the cache duration of the attribute information of the current multipath device reaches a second cleanup time threshold; if the cache duration of the attribute information of the current multipath device reaches the second cleanup time threshold, determining that the current multipath device meets the second delayed deletion condition.
[0022] In an exemplary embodiment, after deleting the current multipath device in the global path linked list, the method further includes: setting the state of the current multipath device to a removed state in the global path bitmap, and setting a delayed deletion flag of the attribute information of the current multipath device to a second preset value.
[0023] According to another embodiment of the present application, another path management method is provided, including: periodically traversing each multipath device in a global path bitmap, and when the current path meets a first delayed deletion condition, deleting the attribute information of the current path in a global path linked list until all paths of the current multipath device are traversed, wherein the global path linked list is used to cache the attribute information of paths and multipath devices, the global path bitmap is used to cache the attribute information of multipath devices, and the attribute information of the multipath devices in the global path linked list is deleted when a path deletion event is triggered; if all paths of the current multipath device are deleted in the global path linked list, when the current multipath device meets a second delayed deletion condition, deleting the attribute information of the current multipath device in the global path bitmap until all multipath devices in the global path bitmap are traversed.
[0024] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0025] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0026] Through the present application, since a global path linked list and a global path bitmap are maintained, the global path linked list is used to cache the attribute information of the path and the attribute information of the multipath device, the global path bitmap is used to cache the attribute information of the multipath device, the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered, and the attribute information of the path in the global path linked list and the multipath device in the global path bitmap are deleted when the delayed deletion condition is met. Therefore, when the fault is recovered, if the attribute information of the first path to be restored exists in the global path linked list, and the attribute information of the first multipath device to which the first path belongs does not exist, if the attribute information of the first multipath device exists in the global path bitmap, the attribute information of the first multipath device is added to the global path linked list, and the first path is added to the storage space of the first multipath device, the problem that the path is deleted and the related data structure is released when the fault of the path or storage area network times out in the related technology, and the multipath disk of the host is restored to an available state in an inefficient manner when the fault is eliminated, and the effect of quickly recovering the path and the multipath device to which the path belongs when the fault is eliminated is achieved, so that the multipath disk of the host is quickly restored to an available state. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1is a hardware structure block diagram of a mobile terminal according to a path management method of an embodiment of the present application;
[0028] Figure 2 is a flow chart of a path management method according to an embodiment of the present application;
[0029] Figure 3 This is the process of an optional path management method according to an embodiment of the present application. Figure 1 ;
[0030] Figure 4 This is the process of an optional path management method according to an embodiment of the present application. Figure 2 ;
[0031] Figure 5 This is the process of an optional path management method according to an embodiment of the present application. Figure 3 ;
[0032] Figure 6 is a flow chart of another path management method according to an embodiment of the present application;
[0033] Figure 7 is a structural block diagram of a path management device according to an embodiment of the present application;
[0034] Figure 8 is a structural block diagram of another path management device according to an embodiment of the present application;
[0035] Fig. 9 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0038] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal according to a path management method of an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0039] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the path management method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0040] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0041] Terminology explanation:
[0042] I / O: Input / Output, usually refers to the input and output of data between internal memory and external memory or other peripheral devices.
[0043] SAN: Storage Area Network, refers to a separate data storage network formed by connecting several storage servers through a specific interconnection method.
[0044] Multipath I / O: Multipath refers to using more than one physical path to access network storage devices, providing higher availability and performance advantages for network storage through fault tolerance and load balancing.
[0045] SCSI: Small Computer System Interface, SCSI is a standardized interface between computers and intelligent devices (such as scanners and hard drives), which allows multiple devices to share the same communication path.
[0046] SCSI Address: The data transmission path (Host: Channel: Target: LUN) information between the SCSI device host and the SAN network storage system.
[0047] NVMe: Non-Volatile Memory Express, Non-Volatile Memory Express, NVMe is a protocol specification for accessing non-volatile storage media connected through the PCI Express (PCIe) bus, such as solid-state drives.
[0048] NVMeAddress, data transmission path information between the NVMe device host and the SAN network storage system, that is, Host: Channel: Target: LUN (Logical Unit Number).
[0049] WWID: World Wide Identification, global identification number: a unique identification number worldwide.
[0050] In this embodiment, a path management method running on the above mobile terminal is provided. Figure 2 is a flow chart of a path management method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0051] Step S202, in response to the instruction to create the first path, query whether the attribute information of the first path exists in the global path linked table.
[0052] It should be noted that the execution subject of this embodiment may be a server, a terminal, etc., but is not limited thereto.
[0053] The path in this embodiment is a path used to connect the host and the SAN to implement data transmission between the host and the SAN network storage system, and may be an I / O path. The first path may be an I / O path to be created.
[0054] The creation instruction of the first path may be a path creation instruction triggered by a new path creation event, or may be a path creation instruction triggered after a long-term system failure occurs and the system is restored after troubleshooting. A long-term system failure refers to a failure that occurs for a duration exceeding a timeout threshold of a link driver, such as a long-term path failure, a cold restart of a storage controller, or a storage system upgrade.
[0055] When the execution subject is a server, the server maintains a global path linked list, which is used to cache the attribute information of the path, and the attribute information of the path may include the state, bandwidth, length, etc. of the path. After the event triggers the creation instruction of the first path, the server responds to the creation instruction of the first path and queries whether the attribute information of the first path exists in the global path linked list.
[0056] Step S204: if the attribute information of the first path exists in the global path linked list, query whether the attribute information of the first multipath device to which the first path belongs exists in the global path linked list, wherein the global path linked list is used to cache the attribute information of the path and the attribute information of the multipath device.
[0057] In addition to being used to cache the attribute information of the path, the global path linked list is also used to cache the attribute information of the multipath device. The multipath device refers to a single device identified by the operating system, which can be associated with multiple paths. The attribute information of the multipath device may include a globally unique identifier, a path selector, a path weight, etc. In the case where the attribute information of the first path exists in the global path linked list, it means that the first path existed before, and the attribute information of the first path cached in the global path linked list has not been deleted. Then, the global path linked list is queried to see whether the attribute information of the first multipath device to which the first path belongs exists.
[0058] Step S206, when the attribute information of the first multipath device does not exist in the global path linked list, query whether the attribute information of the first multipath device exists in the global path bitmap, wherein the global path bitmap is used to cache the attribute information of the multipath device, the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered, and the attribute information of the path in the global path linked list and the multipath device in the global path bitmap are deleted when the delayed deletion condition is met.
[0059] When the attribute information of the first multipath device does not exist in the global path linked list, it means that the attribute information of the first multipath device has been deleted in response to the path deletion event. Since the global path bitmap is used to cache the attribute information of the multipath device, it is possible to query whether the attribute information of the first multipath device exists in the global path bitmap.
[0060] Step S208: If the attribute information of the first multipath device exists in the global path bitmap, the attribute information of the first multipath device is added to the global path linked list, and the first path is added to the storage space of the first multipath device.
[0061] In the case where the attribute information of the first multipath device exists in the global path bitmap, it means that the first multipath device existed in the global path linked list before, and the attribute information of the first multipath device did not meet the delayed deletion condition and was not deleted in the global path bitmap. Therefore, the attribute information of the first multipath device can be obtained from the global path bitmap and added to the global path linked list. The first multipath device uses multiple storage spaces for storing paths, which are called slots. The first path is added to the slot of the first multipath device. The first path and the first path device that originally existed in the global path linked list have been restored. The multipath disk of the host can be quickly restored to an available state, so that the host can exchange data with the storage area network through the first path.
[0062] Through the present application, since a global path linked list and a global path bitmap are maintained, the global path linked list is used to cache the attribute information of the path and the attribute information of the multipath device, the global path bitmap is used to cache the attribute information of the multipath device, the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered, and the attribute information of the path in the global path linked list and the multipath device in the global path bitmap are deleted when the delayed deletion condition is met. Therefore, when the fault is recovered, if the attribute information of the first path to be restored exists in the global path linked list, and the attribute information of the first multipath device to which the first path belongs does not exist, if the attribute information of the first multipath device exists in the global path bitmap, the attribute information of the first multipath device is added to the global path linked list, and the first path is added to the storage space of the first multipath device, the problem that the path is deleted and the related data structure is released when the fault of the path or storage area network times out in the related technology, and the multipath disk of the host is restored to an available state in an inefficient manner when the fault is eliminated, and the effect of quickly recovering the path and the multipath device to which the path belongs when the fault is eliminated is achieved, so that the multipath disk of the host is quickly restored to an available state.
[0063] In an exemplary embodiment, a first path is used to connect a host and a disk in a storage area network. In response to a creation instruction of the first path, querying whether there is attribute information of the first path in a global path linked list includes: obtaining target host information of a host to be connected by the first path and a target disk identifier of a disk to be connected by the first path; querying whether there is a path associated with the target host information and the target disk identifier in the global path linked list; if there is a path associated with the target host information and the target disk identifier in the global path linked list, determining that there is attribute information of the first path in the global path linked list; if there is no path associated with the target host information and the target disk identifier in the global path linked list, determining that there is no attribute information of the first path in the global path linked list.
[0064] Specifically, the host to be connected by the first path may be a SCSI host or an NVMe host, the target host information of the SCSI host may be SCSI Address information, and the host information of the NVMe host may be NVMe Address information. The target disk identifier of the disk to be connected by the first path may be WWID information. Query whether there is a path associated with the target SCSI Address information and the target WWID information in the global path linked list, or release the path associated with the target NVMe Address information and the target WWID information. If any of the above paths exists, determine that the first path exists in the global path linked list and that the attribute information of the first path exists. If any of the above paths does not exist, determine that the first path does not exist in the global path linked list and that the attribute information of the first path does not exist.
[0065] Through this embodiment, based on the target host information of the host to be connected by the first path and the target disk identifier of the disk to be connected, it is determined whether the first path exists in the global path list, thereby achieving the effect of quickly and accurately determining whether the attribute information of the first path exists in the global path list.
[0066] In an exemplary embodiment, after querying whether there is attribute information of the first path in the global path linked list, it also includes: if the attribute information of the first path does not exist in the global path linked list, collecting the attribute information of the first path; adding the attribute information of the first path to the global path linked list, and executing the step of querying whether there is attribute information of the first multipath device to which the first path belongs in the global path linked list.
[0067] When the attribute information of the first path does not exist in the global path linked list, it means that the first path is a new path, or the first path is a historical path whose attribute information has been cleared. When the first path is a new path, it is necessary to collect the attribute information of the first path and add the first path and its attribute information to the global path linked list. When the first path is a historical path whose attribute information has been cleared, it is also necessary to re-collect the attribute information of the first path and add the first path and its attribute information to the global path linked list, so as to lay a foundation for querying or creating a multi-path device.
[0068] In an exemplary embodiment, the global path bitmap is also used to store the status of the path in the global path linked list and the delayed deletion flag of the path's attribute information. After querying whether the attribute information of the first path exists in the global path linked list, it also includes: when the attribute information of the first path exists in the global path linked list, setting the status of the first path to a non-removal state in the global path bitmap, setting the delayed deletion flag of the attribute information of the first path to a second preset value, and setting the path reuse flag in the attribute information of the first path to a first preset value.
[0069] Among them, the state of the path in the global path linked list is a removal state or a non-removal state, the delayed deletion flag of the attribute information of the path is a first preset value or a second preset value, the first preset value can be true, indicating that the attribute information of the path is delayed in deletion, and the second preset value can be false, indicating that the attribute information of the path is not delayed in deletion.
[0070] When attribute information of the first path exists in the global path linked list, it means that the first path existed before, the attribute information of the first path cached in the global path linked list has not been deleted, and the current first path is restored, so the global path bitmap needs to be updated. Exemplarily, the state of the first path can be set to a non-removal state, indicating that the first path and the attribute information of the first path exist in the global path link, and the delayed deletion flag of the attribute information of the first path is set to false, indicating that the attribute information of the first path is not delayed in deletion.
[0071] Through this embodiment, if the first path to be created is a historical path that has existed in the global path linked list, when the first path is restored, the status information and delayed deletion flag about the first path in the global path bitmap are updated, so that the global path bitmap can accurately represent the status and delayed deletion attributes of the first path.
[0072] In an exemplary embodiment, after querying whether there is attribute information of the first multipath device to which the first path belongs in the global path linked list, the method further includes: if the attribute information of the first multipath device exists in the global path linked list, executing the step of adding the first path to the storage space of the first multipath device.
[0073] It should be noted that, when the attribute information of the first multipath device exists in the global path linked list, it means that the first multipath device has not been deleted. Since the first path already exists in the global path linked list, the first path can be added to the storage space of the first multipath device, and the first path can be logically integrated and managed at the operating system level through the first multipath device.
[0074] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After the attribute information of the first multipath device is added to the global path linked list, it also includes: setting the status of the first multipath device to a non-removal state in the global path bitmap, and setting the delayed deletion flag of the attribute information of the first multipath device to a second preset value.
[0075] Among them, the state of the multipath device in the global multipath device linked list is a removal state or a non-removal state, and the delayed deletion flag of the attribute information of the multipath device is a first preset value or a second preset value. The first preset value can be true, indicating that the attribute information of the multipath device is delayed in deletion, and the second preset value can be false, indicating that the attribute information of the multipath device is not delayed in deletion.
[0076] After the attribute information of the first multipath device in the global path bitmap is added to the global path linked list, it indicates that the state of the first multipath device has changed, and there is currently no need to delete the first multipath device, so the global path bitmap needs to be updated. Exemplarily, the state of the first multipath device can be set to a non-removable state, indicating that the first multipath device and the attribute information of the first multipath device exist in the global path link, and the delayed deletion flag of the attribute information of the first multipath device is set to false, indicating that the attribute information of the first multipath device will not be delayed in deletion.
[0077] Through this embodiment, after the attribute information of the first multipath device in the global path bitmap is added to the global path linked list, the status information and the delayed deletion flag about the first multipath device in the global path bitmap are updated, so that the global path bitmap can accurately represent the status and delayed deletion attributes of the first multipath device.
[0078] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After querying whether the attribute information of the first multipath device exists in the global path bitmap, it also includes: when the attribute information of the first multipath device does not exist in the global path bitmap, collecting the attribute information of the first multipath device, and adding the attribute information of the first multipath device to the global path linked list; setting the status of the first multipath device in the global path bitmap to a non-removal state, and setting the delayed deletion flag of the attribute information of the first multipath device to a second preset value.
[0079] When the attribute information of the first multipath device does not exist in the global path linked list, it means that the first multipath device is a new device, or the first multipath device is a historical device whose attribute information has been cleared. When the first multipath device is a new device, it is necessary to collect the attribute information of the first multipath device and add the first multipath device and its attribute information to the global path linked list. When the first multipath device is a historical device whose attribute information has been cleared, it is also necessary to re-collect the attribute information of the first multipath device and add the first multipath device and its attribute information to the global path linked list, so that the host connected to the first path can interact with the disk in the network storage system for data.
[0080] After the attribute information of the first multipath device is added to the global path linked list, it indicates that the state of the first multipath device has changed, and there is currently no need to delete the first multipath device, so the global path bitmap needs to be updated. Exemplarily, the state of the first multipath device can be set to a non-removable state, indicating that the first multipath device and the attribute information of the first multipath device exist in the global path link, and the delayed deletion flag of the attribute information of the first multipath device is set to false, indicating that the attribute information of the first multipath device will not be delayed in deletion.
[0081] Through this embodiment, after the collected attribute information of the first multipath device is added to the global path linked list, the status information and the delayed deletion flag about the first multipath device in the global path bitmap are updated, so that the global path bitmap can accurately represent the status and delayed deletion attributes of the first multipath device.
[0082] In an exemplary embodiment, adding a first path to the storage space of a first multipath device includes: querying a path reuse flag in the attribute information of the first path; when the path reuse flag is a second preset value, querying the latest storage space of the first multipath device and adding the first path to the latest storage space; when the path reuse flag is a first preset value, adding the first path to the historical storage space of the first multipath device.
[0083] It should be noted that the path reuse flag is used to indicate whether the path is a reused path. The path reuse flag is a first preset value or a second preset value. The first preset value may be true, indicating that the path is a reused path, that is, a historical path restored after troubleshooting. The second preset value may be false, indicating that the path is not a reused path, but a newly created path.
[0084] Exemplarily, the storage space of the first multipath device is a slot, and multiple slots can be opened according to the data of the managed path. If the path reuse flag of the first path is true, it means that the first path is a historical path restored after troubleshooting, and the first path is added to the historical slot that the first multipath device has applied for. If the path reuse flag of the first path is false, it means that the first path is a newly created path, and the latest slot applied for by the first multipath device is queried, and the first path is added to the latest slot of the first multipath device.
[0085] Through this embodiment, it is determined according to the path reuse flag whether the first path is a newly created path or a historical path restored after troubleshooting, and the first path is added to a corresponding slot in the first multipath device according to the determination result, thereby facilitating the first multipath device to manage different paths.
[0086] Figure 3 This is the process of an optional path management method according to an embodiment of the present application. Figure 1 The method is used to create paths and multipath devices, including:
[0087] Step S301: Obtain host address information (SCSI Address information or NVMeAddress information) of path X.
[0088] Step S302: Obtain WWID information of path X.
[0089] Step S303: Determine whether path X exists in the global path list based on the host address information and WWID information of path X; if path X exists, it means that path X existed before, and the relevant attribute information of path X cached in the global path list has not been deleted, and jump to step S305; if path X does not exist, it means that path X is a new path or an old path whose relevant attribute information has been cleared, and jump to step S304.
[0090] Step S304: Use path X to obtain relevant attribute information, and add this path X to the global path linked list, and jump to step S307.
[0091] Step S305: Update the global path bitmap information: set path X to non-removal, indicating that path X exists in the global path linked list; set the delayed deletion flag of the attribute information of path X to false, indicating that the deletion is not delayed.
[0092] Step S306: Set the path X reuse flag to true, indicating that path X is a reused path.
[0093] Step S307: query the global path linked list to determine whether the multipath device M to which the path X belongs exists; if the multipath device M exists, it means that the multipath device M has not been deleted, and jump to step S313; if the multipath device M does not exist, jump to step S308.
[0094] Step S308: query the global path bitmap information to determine whether the multipath device M to which the path X belongs exists; if the multipath device M exists, it means that an old multipath device M existed before, and the process goes to step S311; if the multipath device M does not exist, it means that it is a new multipath device M or an old multipath device M whose related attribute information has been cleared, and the process goes to step S309.
[0095] Step S309: Acquire attribute information related to the multipath device M, and add the multipath device M to the global path linked list.
[0096] Step S310: Update the global path bitmap information: record the attribute information of the multipath device M, set the multipath device M to be non-removable, set all paths under the multipath device M to be non-removable, set the delayed deletion flag to false, and jump to step S313.
[0097] Step S311: Add path device M to the global path linked list.
[0098] Step S312: Update the global path bitmap information: set the multipath device M to be non-removable, indicating that the multipath device M exists in the global path linked list, and set the delayed deletion flag of the multipath device M attribute information to false, indicating that the deletion is not delayed.
[0099] Step S313: Determine whether the reuse flag of path X is true; if the reuse flag of path X is true, it means that path X is an old path after recovery from a fault, and jump to step S316; if the reuse flag of path X is false, jump to step S314.
[0100] Step S314: query the latest slot information of the paths of the multipath device M.
[0101] Step S315: Add path X to the latest slot of multipath device M, and then end.
[0102] Step S316: Add path X to the old slot of multipath device M, and then end.
[0103] Through this embodiment, when creating a path and a multipath device, if there is a path in the global linked list or the path is added to the global path linked list, it is queried whether there is a multipath device to which the path belongs in the global path linked list. If the multipath device does not exist in the global path linked list, it is queried whether there is a multipath device in the global path bitmap information. If the multipath device does not exist in the global path bitmap, relevant attribute information of the multipath device is obtained and added to the global path linked list. If the multipath device does not exist in the global path linked list, the attribute information of the multipath device in the bitmap information is directly used. This is not only applicable to the scenario of creating a new path and a new multipath device, but also improves the recovery efficiency of the path and multipath device in the fault recovery scenario.
[0104] It should be noted that the management of paths and multipath devices includes not only the management in the scenario of creating devices and multipath devices, but also the management in the scenario of deleting devices and multipath devices.
[0105] It should be noted that the management in the deletion scenario of devices and multipath devices specifically includes deleting devices and multipath devices in the event of path deletion. In an exemplary embodiment, it also includes: responding to the deletion event of the second path, setting the status in the attribute information of the second path to a closed state in the global path linked list; querying the status of all paths of the second multipath device to which the second path belongs in the global path linked list; and when the status of all paths of the second multipath device is the closed state, deleting the attribute information of the second multipath device from the global path linked list.
[0106] Among them, the second path can be an I / O path to be deleted, and the deletion event of the path can be a deletion event triggered in a scenario where a system failure requires deletion of the path. The status in the attribute information of the second path includes a closed state and an activated state. After responding to the deletion event of the second path, the closed state is set to indicate that the second path is currently in an unavailable state. When the status of all paths of the second multipath device are in the closed state, it means that the second multipath device is currently in an unavailable state, and the attribute information of the second multipath device is deleted from the global path linked list. At the same time, the attribute information of the second multipath device is still retained in the global path bitmap.
[0107] This embodiment deletes the device and the multipath device under the path deletion event, which is a pre-deletion of the path and the multipath device, that is, when the path is set to the closed state and the multipath device is deleted in the global path link, the deletion state of the path and the multipath device is set in the global path bitmap, but when the delayed deletion condition is not met, the relevant attribute information of the path is not deleted in the linked list, and the relevant attribute information of the multipath device is not deleted in the global path bitmap, laying a foundation for the subsequent efficient recovery of the path and the multipath device.
[0108] In an exemplary embodiment, the global path bitmap is also used to store the status of the path in the global path linked list and the delayed deletion flag of the path's attribute information. After setting the status in the attribute information of the second path in the global path linked list to a closed state, it also includes: setting the path reuse flag in the attribute information of the first path to a second preset value; setting the status of the second path in the global path bitmap to a removed state, and setting the delayed deletion flag of the attribute information of the second path to a first preset value.
[0109] Among them, the path reuse flag is used to characterize whether the path is a reused path, the path reuse flag is a first preset value or a second preset value, the first preset value can be true, characterizing that the path is a reused path, and the second preset value can be false, characterizing that the path is not a reused path, the state of the path in the global path linked list is a removed state or a non-removed state, and the delayed deletion flag of the attribute information of the path is a first preset value or a second preset value, the first preset value can be true, characterizing that the attribute information of the path is delayed in deletion, and the second preset value can be false, characterizing that the attribute information of the path is not delayed in deletion.
[0110] After the status in the attribute information of the second path in the global path linked list is set to the closed state, the second path cannot be reused, the reuse flag of the second path is initialized to false, and the global path bitmap information is updated. Exemplarily, the status of the second path can be set to the removed state (if the delayed deletion condition is not met, the second path still exists in the global path linked list), and the delayed deletion flag of the attribute information of the second path is set to true, indicating the delayed deletion of the attribute information of the first path.
[0111] Through this embodiment, after the status in the attribute information of the second path in the global path linked list is set to the closed state, the status information about the second path and the delayed deletion flag in the global path bitmap are updated, so that the global path bitmap can accurately characterize the status and delayed deletion attributes of the second path.
[0112] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After querying the status of all paths of the second multipath device to which the second path belongs in the global path linked list, it also includes: when the status of all paths of the second multipath device is a closed state, the status of the second multipath device is set to a removed state in the global path bitmap, and the delayed deletion flag of the attribute information of the second multipath device is set to a first preset value.
[0113] When the status of all paths of the second multipath device is closed, it means that the second multipath device is currently in an unavailable state, and the attribute information of the second multipath device is deleted from the global path linked list. The status of the second multipath device has changed, and therefore the global path bitmap needs to be updated. Exemplarily, the status of the second multipath device can be set to a removed state, indicating that the second multipath device and the attribute information of the second multipath device do not exist in the global path link, and a delayed deletion flag of the attribute information of the second multipath device is set to true, indicating delayed deletion of the attribute information of the second multipath device.
[0114] Through this embodiment, after deleting the attribute information of the second multipath device in the global path linked list, the status information and delayed deletion flag about the second multipath device in the global path bitmap are updated, so that the global path bitmap can accurately represent the status and delayed deletion attributes of the second multipath device.
[0115] Figure 4 This is the process of an optional path management method according to an embodiment of the present application. Figure 2 The method is used to perform pre-deletion of paths and multipath devices (that is, setting a deletion state in a global path bitmap without deleting related attribute information), including:
[0116] Step S401: Set the state of path X to closed state.
[0117] Step S402: setting the reuse flag of path X to false, indicating that path X is not reused.
[0118] Step S403: Update the global path bitmap information: set path X to be removed (if the delayed deletion condition is not met, path X still exists in the global path linked list); set the attribute information delayed deletion flag of path X to true, indicating that the attribute information of path X is delayed to be deleted.
[0119] Step S404: determine whether all paths of the multipath device M to which the path X belongs are in a closed state; if all paths are in a closed state, jump to step S405, otherwise end.
[0120] Step S405: updating the global path bitmap information: setting the multipath device M to be removed, indicating that the multipath device M does not exist in the global path linked list; setting the attribute information delayed deletion flag of the multipath M to true, indicating that the attribute information of the multipath M is delayed to be deleted.
[0121] Step S406: Delete the multipath device M from the global path linked list, and then end.
[0122] In this embodiment, in the event of path deletion, the path is set to a closed state in the global path link, and when all paths under the multipath device to which the path belongs are in a closed state, the multipath device is deleted, and the deletion state of the path and the multipath device is set in the global path bitmap. However, if the delayed deletion condition is not met, the relevant attribute information of the path is not deleted from the linked list, and the relevant attribute information of the multipath device is not deleted from the global path bitmap, thereby laying a foundation for subsequent efficient recovery of the path and the multipath device.
[0123] It should be noted that the management of device and multipath device deletion scenarios specifically includes deleting the attributes of device and multipath devices when the delayed deletion conditions are met. The delayed deletion can be executed in parallel with the creation of paths and multipath devices, and the deletion of devices and multipath devices based on path deletion events.
[0124] In an exemplary embodiment, it also includes: periodically traversing each multipath device in the global path bitmap, determining in turn whether each path of the current multipath device meets the first delayed deletion condition, and if the current path meets the first delayed deletion condition, deleting the attribute information of the current first delayed deletion condition path in the global path linked list until all paths of the current multipath device are traversed.
[0125] Exemplarily, the paths and multipath devices may be deleted periodically through a scheduled task. When the scheduled task is executed, the configuration information in the configuration file needs to be read.
[0126] The configuration information may include condition information of the first delayed deletion condition, and the first delayed deletion condition refers to the delayed deletion condition of the path. When the timer timing period is reached, the timer task reads the delayed deletion condition of the path from the configuration file, determines whether the attribute information of the current path of the current multipath device meets the delayed deletion condition of the path, and if so, deletes the attribute information of the current first path cached in the global path linked list, traverses the next path of the current multipath device, determines whether the attribute information of the next path meets the delayed deletion condition of the path, until all paths of the current multipath device are traversed, and the paths that meet the delayed deletion condition of the path are deleted from the global path linked list.
[0127] In an exemplary embodiment, it also includes: when all paths of the current multipath device are deleted in the global path linked list, determining whether the current multipath device meets the second delayed deletion condition; when the current multipath device meets the second delayed deletion condition, deleting the attribute information of the current multipath device in the global path bitmap until all multipath devices in the global path bitmap are traversed.
[0128] It should be noted that the configuration information in the configuration file may also include condition information of a second delayed deletion condition, where the second delayed deletion condition refers to a delayed deletion condition of a multipath device.
[0129] When the scheduled task has completed traversing all paths of the current multipath device and all paths of the current multipath device have been deleted because they meet the delayed deletion condition of the path, the scheduled task reads the delayed deletion condition of the multipath device from the configuration file, determines whether the attribute information of the current multipath device meets the delayed deletion condition of the multipath device, and if so, deletes the attribute information of the current first multipath device cached in the global path linked list, and traverses the next multipath device of the current multipath device until all multipath devices in the global path bitmap are traversed.
[0130] Through this embodiment, the delayed deletion conditions of the path and the delayed deletion conditions of the multipath device are stored in the configuration file, and the global path bitmap is periodically traversed through the scheduled task to read the configuration information in the configuration file to perform periodic deletion of the path and the multipath device.
[0131] In an exemplary embodiment, determining in turn whether each path of the current multipath device meets the first delayed deletion condition includes: determining whether a delayed deletion flag of the attribute information of the current path is a first preset value; if the delayed deletion flag is the first preset value, determining whether the current path carries a forced deletion flag; if the current path carries a forced deletion flag, determining that the current path meets the first delayed deletion condition; if the current path does not carry a forced deletion flag, determining whether the cache duration of the attribute information of the current path reaches a first cleanup time threshold; if the cache duration of the attribute information of the current path reaches the first cleanup time threshold, determining that the current path meets the first delayed deletion condition.
[0132] The first preset value of the delayed deletion flag may be true, indicating that the deletion can be delayed, and the first delayed deletion condition includes forced deletion of the path and deletion when the cache duration of the path reaches a first cleaning time threshold.
[0133] Exemplarily, a timed task is used to determine whether the delayed deletion flag of the attribute information of the current path is true. If it is true, it means that the deletion can be delayed, and it is determined whether the current path meets the first delayed deletion condition. Specifically, when forced deletion is triggered, a forced deletion flag will be added to the path. First, it is determined whether the current path carries a forced deletion flag. If there is a forced deletion flag, it means that the current path meets the first delayed deletion condition, and the attribute information of the current path is deleted from the global path linked list. If there is no forced deletion flag, it means that forced deletion has not been triggered, and it is continued to determine whether the cache duration of the attribute information of the current path reaches the first cleanup time threshold. When the cache duration of the attribute information of the current path reaches the first cleanup time threshold, it means that the cache of the attribute information of the current path in the global path linked list has timed out, and the current path meets the first delayed deletion condition, and the attribute information of the first path is deleted from the global path linked list.
[0134] Through this embodiment, under the premise that the delayed deletion flag indicates that the path can be delayed in deletion, when forced deletion is triggered or the first cleanup time threshold is reached, it is determined that the path meets the first delayed deletion condition, and the attribute information of the path is deleted from the global path linked list, thereby preventing the attribute information of the path from occupying the storage space of the global path linked list for a long time.
[0135] In an exemplary embodiment, after deleting the attribute information of the current multipath device in the global path bitmap, the method further includes: setting the state of the current path in the global path bitmap to a removal state, and setting a delayed deletion flag of the attribute information of the current path to a second preset value.
[0136] Among them, the second preset value of the delayed deletion flag can be false, indicating that the deletion is not delayed. After the current path is deleted from the global path linked list, it means that the state of the current path has changed, so the global path bitmap needs to be updated. For example, the state of the current path can be set to a removed state, indicating that the current path does not exist in the global path link, and the delayed deletion flag of the attribute information of the current path is set to false, indicating that the attribute information of the current path is not delayed.
[0137] Through this embodiment, after deleting the current path in the global path linked list, the state information and the delayed deletion flag about the current path in the global path bitmap are updated, so that the global path bitmap can accurately represent the state and delayed deletion attribute of the current path.
[0138] In an exemplary embodiment, determining whether the current multipath device meets the second delayed deletion condition includes: determining whether a delayed deletion flag of the attribute information of the current multipath device is a first preset value; if the delayed deletion flag is the first preset value, determining whether the current multipath device carries a forced deletion flag; if the current multipath device carries a forced deletion flag, determining that the current multipath device meets the second delayed deletion condition; if the current multipath device does not carry a forced deletion flag, determining whether the cache duration of the attribute information of the current multipath device reaches a second cleanup time threshold; if the cache duration of the attribute information of the current multipath device reaches the second cleanup time threshold, determining that the current multipath device meets the second delayed deletion condition.
[0139] The first preset value of the delayed deletion flag may be true, indicating that the deletion can be delayed, and the second delayed deletion condition includes forced deletion of the multipath device and deletion of the multipath device when the cache duration reaches a second cleaning time threshold.
[0140] Exemplarily, a timed task is used to determine whether the delayed deletion flag of the attribute information of the current multipath device is true. If it is true, it means that the delayed deletion can be performed, and it is determined whether the current multipath device meets the second delayed deletion condition. Specifically, when forced deletion is triggered, a forced deletion flag will be added to the multipath device. First, it is determined whether the current multipath device carries a forced deletion flag. If there is a forced deletion flag, it means that the current multipath device meets the second delayed deletion condition, and the attribute information of the current multipath device is deleted from the global path bitmap. If there is no forced deletion flag, it means that forced deletion has not been triggered, and it is further determined whether the cache duration of the attribute information of the current multipath device reaches the second cleanup time threshold. When the cache duration of the attribute information of the current multipath device reaches the second cleanup time threshold, it means that the cache of the attribute information of the current multipath device in the global path bitmap has timed out, and the current path meets the second delayed deletion condition, and the attribute information of the first path is deleted from the global path bitmap.
[0141] Through this embodiment, under the premise that the delayed deletion flag indicates that the multipath device can be delayed in deletion, when forced deletion is triggered or the second cleanup time threshold is reached, it is determined that the multipath device meets the second delayed deletion condition, and the attribute information of the multipath device is deleted from the global path bitmap, thereby avoiding the attribute information of the multipath device occupying the storage space of the global path bitmap for a long time.
[0142] In an exemplary embodiment, after deleting the current multipath device in the global path linked list, the method further includes: setting the state of the current multipath device to a removed state in the global path bitmap, and setting a delayed deletion flag of the attribute information of the current multipath device to a second preset value.
[0143] Among them, the second preset value of the delayed deletion flag can be false, indicating that the deletion is not delayed. After the attribute information of the current multipath device is deleted from the global path bitmap, it means that the state of the previous multipath device has changed, so the global path bitmap needs to be updated. For example, the state of the current multipath device can be set to a removed state, indicating that the current multipath device and the attribute information of the current multipath device do not exist in the global path bitmap, and the delayed deletion flag of the attribute information of the current multipath device is set to false, indicating that the attribute information of the current multipath device is not delayed.
[0144] Through this embodiment, after the attribute information of the current multipath device is deleted from the global path bitmap, the status information about the current multipath device and the delayed deletion flag in the global path bitmap are updated, so that the global path bitmap can accurately represent the status and delayed deletion attributes of the current multipath device.
[0145] Figure 5 This is the process of an optional path management method according to an embodiment of the present application. Figure 3 The method is used to perform post-deletion of paths and multipath devices (that is, to delete the relevant attribute information of the paths and multipath devices according to the forced deletion flag and the cleanup time threshold), including:
[0146] Step S501: Start the timer task; read the configuration file (the cleaning time threshold is written in the file) and write it into the memory;
[0147] Step S502: the timer timing period arrives;
[0148] Step S503: determining whether the variable M in the global path bitmap is less than or equal to the total number of multipath devices; if so, it indicates that the multipath devices in the global path bitmap have not been traversed completely, and the process goes to step S504; otherwise, it indicates that the multipath devices in the global path bitmap have been traversed completely, and the process goes to step S515;
[0149] Step S504: determining whether the variable N is less than or equal to the total number of paths of the multipath device M. If so, it means that the paths of the multipath device M have not been traversed completely, and the process goes to step S505. Otherwise, it means that all the paths of the multipath device M have been traversed completely, and the process goes to step S510.
[0150] Step S505: determine whether the attribute information delayed deletion flag of multipath M and path N is true; if true, it means that delayed deletion is possible, and jump to step S506; otherwise, jump to step S509;
[0151] Step S506: Determine whether the path N of the multipath device M has a forced deletion flag; if the forced deletion flag exists, it means forced deletion is required, and jump to step S508; otherwise, it means forced deletion is not required, and jump to step S507;
[0152] Step S507: Determine whether the path N of the multipath device M reaches the cleaning time threshold; if so, it means that cleaning is required, and the process goes to step S508; otherwise, it means that cleaning is not required, and the process goes to step S509;
[0153] Step S508: Delete the path N from the global path list; update the global path bitmap information: set the path N of the multipath device M to be removed, indicating that the path N and its attribute information do not exist in the global path list, and the delayed deletion flag is false, indicating that the deletion is not delayed, and jump to step S509;
[0154] Step S509: the variable N is incremented by 1, and the process jumps to step S504;
[0155] Step S510: Determine whether the multipath M attribute information delayed deletion flag is true; if true, jump to step S511, otherwise jump to step S514;
[0156] Step S511: determine whether the multipath device M has a forced deletion flag; if the forced deletion flag exists, it means forced deletion is required, and jump to step S513; otherwise, it means forced deletion is not required, and jump to step S512;
[0157] Step S512: Determine whether the multipath device M reaches the cleaning time threshold; if so, it is necessary to clean up, and jump to step S513; otherwise, it is not necessary to clean up, and jump to step S514;
[0158] Step S513: Delete the attribute information of the multipath device M from the global path bitmap information, and update the global path bitmap information: set the multipath device M to be removed, indicating that the path N and its attribute information do not exist in the global path bitmap, and the delayed deletion flag is false, indicating that the deletion is not delayed, and jump to step S514;
[0159] Step S514: the variable M is incremented by 1, and the process jumps to step S503;
[0160] Step S515: The timer initial value is reset, and then the process ends.
[0161] In this embodiment, when a path reaches a delayed deletion condition, the path and its attribute information are delayed deleted in the global path link, and the global path bitmap is updated. When a multipath device reaches a delayed deletion condition, the path device and its attribute information are delayed deleted in the global path bitmap, and the global path bitmap is updated, thereby preventing the attribute information of the path or multipath device from occupying the storage space of the global path bitmap for a long time.
[0162] Another path management method is also provided in this embodiment. Figure 6 is a flow chart of another path management method according to an embodiment of the present application, the method comprising:
[0163] S602, periodically traverse each multipath device in the global path bitmap, and when the current path meets the first delayed deletion condition, delete the attribute information of the current path in the global path linked list until all paths of the current multipath device are traversed, wherein the global path linked list is used to cache the attribute information of the path and the multipath device, the global path bitmap is used to cache the attribute information of the multipath device, and the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered.
[0164] Exemplarily, the paths and multipath devices may be deleted periodically through a scheduled task. When the scheduled task is executed, the configuration information in the configuration file needs to be read.
[0165] The configuration information may include condition information of the first delayed deletion condition, and the first delayed deletion condition refers to the delayed deletion condition of the path. When the timer timing period is reached, the timer task reads the delayed deletion condition of the path from the configuration file, determines whether the attribute information of the current path of the current multipath device meets the delayed deletion condition of the path, and if so, deletes the attribute information of the current first path cached in the global path linked list, traverses the next path of the current multipath device, determines whether the attribute information of the next path meets the delayed deletion condition of the path, until all paths of the current multipath device are traversed, and the paths that meet the delayed deletion condition of the path are deleted from the global path linked list.
[0166] S604: If all paths of the current multipath device are deleted in the global path linked list, and the current multipath device meets the second delayed deletion condition, the attribute information of the current multipath device is deleted in the global path bitmap until all multipath devices in the global path bitmap are traversed.
[0167] It should be noted that the configuration information in the configuration file may also include condition information of a second delayed deletion condition, where the second delayed deletion condition refers to a delayed deletion condition of a multipath device.
[0168] When the scheduled task has completed traversing all paths of the current multipath device and all paths of the current multipath device have been deleted because they meet the delayed deletion condition of the path, the scheduled task reads the delayed deletion condition of the multipath device from the configuration file, determines whether the attribute information of the current multipath device meets the delayed deletion condition of the multipath device, and if so, deletes the attribute information of the current first multipath device cached in the global path linked list, and traverses the next multipath device of the current multipath device until all multipath devices in the global path bitmap are traversed.
[0169] In this embodiment, when the path and the multipath device do not meet the delayed deletion condition, the path and its attribute information are retained in the global path link, and the multipath device and its attribute information are retained in the global path bitmap. When the fault is eliminated, the path and the multipath device where the path is located are quickly restored, so that the multipath disk of the host is quickly restored to an available state. When the path meets the delayed deletion condition, the path and its attribute information are delayed deleted in the global path link, and the global path bitmap is updated. When the multipath device meets the delayed deletion condition, the path device and its attribute information are delayed deleted in the global path bitmap, and the global path bitmap is updated, thereby preventing the attribute information of the path or multipath device from occupying the storage space of the global path bitmap for a long time.
[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0171] In this embodiment, a path management device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0172] Figure 7 is a structural block diagram of a path management device according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:
[0173] The first query unit 702 is used to respond to the creation instruction of the first path and query whether the attribute information of the first path exists in the global path linked table.
[0174] The second query unit 704 is used to query whether the global path linked list contains attribute information of the first multipath device to which the first path belongs, if attribute information of the first path exists in the global path linked list, wherein the global path linked list is used to cache attribute information of the path and attribute information of the multipath device.
[0175] The third query unit 706 is used to query whether the attribute information of the first multipath device exists in the global path bitmap when the attribute information of the first multipath device does not exist in the global path linked list, wherein the global path bitmap is used to cache the attribute information of the multipath device, the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered, and the attribute information of the path in the global path linked list and the multipath device in the global path bitmap are deleted when the delayed deletion condition is met.
[0176] The first adding unit 708 is configured to add the attribute information of the first multipath device to the global path linked list and add the first path to the storage space of the first multipath device if the attribute information of the first multipath device exists in the global path bitmap.
[0177] In the embodiment of the present application, a first query unit 702 is used to respond to a creation instruction of a first path and query whether there is attribute information of the first path in a global path linked list; a second query unit 704 queries whether there is attribute information of a first multipath device to which the first path belongs in the global path linked list when the attribute information of the first path exists in the global path linked list, wherein the global path linked list is used to cache the attribute information of the path and the attribute information of the multipath device; a third query unit 706 queries whether there is attribute information of the first multipath device in a global path bitmap when the attribute information of the first multipath device does not exist in the global path linked list, wherein the global path bitmap is used to cache the attribute information of the multipath device, and the attribute information of the multipath device in the global path linked list When a path deletion event is triggered, it is deleted, and the attribute information of the path in the global path linked list and the multipath device in the global path bitmap are deleted when the delayed deletion condition is met; an adding unit is added to add the attribute information of the first multipath device to the global path linked list when the attribute information of the first multipath device exists in the global path bitmap, and the first path is added to the storage space of the first multipath device, which can solve the problem in the related art that the path will be deleted and the related data structure will be released when the fault of the path or storage area network times out, and the multipath disk of the host is inefficient in recovering to an available state when the fault is eliminated, so as to achieve the effect of quickly recovering the path and the multipath device where the path is located when the fault is eliminated, so that the multipath disk of the host is quickly recovered to an available state.
[0178] In an exemplary embodiment, the first path is used to connect a host and a disk in a storage area network. In response to a creation instruction of the first path, the first query unit 702 includes: a first acquisition module, used to obtain target host information of a host to be connected by the first path and a target disk identifier of a disk to be connected by the first path; a first query module, used to query whether there is a path associated with the target host information and the target disk identifier in a global path linked list; a first determination module, used to determine whether attribute information of the first path exists in the global path linked list when there is a path associated with the target host information and the target disk identifier in the global path linked list; and a second determination module, used to determine whether attribute information of the first path does not exist in the global path linked list when there is no path associated with the target host information and the target disk identifier in the global path linked list.
[0179] In an exemplary embodiment, the method further includes: in a case where the attribute information of the first path does not exist in the global path linked list, a first collecting unit is used to collect the attribute information of the first path after querying whether the attribute information of the first path exists in the global path linked list; a second adding unit is used to add the attribute information of the first path to the global path linked list, and execute the step of querying whether the attribute information of the first multipath device to which the first path belongs exists in the global path linked list.
[0180] In an exemplary embodiment, the global path bitmap is also used to store the status of the path in the global path linked list and the delayed deletion flag of the path's attribute information, and also includes: a first setting unit, which is used to, after querying whether there is attribute information of the first path in the global path linked list, if the attribute information of the first path exists in the global path linked list, set the status of the first path to a non-removal state in the global path bitmap, set the delayed deletion flag of the attribute information of the first path to a second preset value, and set the path reuse flag in the attribute information of the first path to the first preset value.
[0181] In an exemplary embodiment, it also includes: an execution unit, which is used to, when there is attribute information of the first multipath device in the global path linked list, after querying whether there is attribute information of the first multipath device to which the first path belongs in the global path linked list, execute the step of adding the path to the storage space of the first multipath device.
[0182] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device, and also includes: a second setting unit, which is used to set the status of the first multipath device to a non-removal state in the global path bitmap after adding the attribute information of the first multipath device to the global path linked list, and set the delayed deletion flag of the attribute information of the first multipath device to a second preset value.
[0183] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device, and also includes: a second collection unit, which is used to collect the attribute information of the first multipath device after querying whether the attribute information of the first multipath device exists in the global path bitmap, if the attribute information of the first multipath device does not exist in the global path bitmap, and add the attribute information of the first multipath device to the global path linked list; a third setting unit, which is used to set the status of the first multipath device to a non-removal state in the global path bitmap, and set the delayed deletion flag of the attribute information of the first multipath device to a second preset value.
[0184] In an exemplary embodiment, the first adding unit 708 includes: a second query module, used to query the path reuse flag in the attribute information of the first path; a third query module, used to query the latest storage space of the first multipath device and add the first path to the latest storage space when the path reuse flag is a second preset value; and an adding module, used to add the first path to the historical storage space of the first multipath device when the path reuse flag is a first preset value.
[0185] In an exemplary embodiment, it also includes: a fourth setting unit, which is used to respond to the deletion event of the second path and set the status in the attribute information of the second path to a closed state in the global path linked list; a fourth query unit, which queries the status of all paths of the second multipath device to which the second path belongs in the global path linked list; and a first deletion unit, which is used to delete the attribute information of the second multipath device from the global path linked list when the status of all paths of the second multipath device is the closed state.
[0186] In an exemplary embodiment, the global path bitmap is also used to store the status of the path in the global path linked list and the delayed deletion flag of the path's attribute information, and also includes: a fifth setting unit, which is used to set the path reuse flag in the attribute information of the first path to a second preset value after setting the status in the attribute information of the second path in the global path linked list to a closed state; a sixth setting unit, which is used to set the status of the second path in the global path bitmap to a removed state, and set the delayed deletion flag of the attribute information of the second path to a first preset value.
[0187] In an exemplary embodiment, the global path bitmap is also used to store the status of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device, and also includes: a seventh setting unit, which is used to query the status of all paths of the second multipath device to which the second path belongs in the global path linked list, and when the status of all paths of the second multipath device is a closed state, set the status of the second multipath device to a removed state in the global path bitmap, and set the delayed deletion flag of the attribute information of the second multipath device to a first preset value.
[0188] In an exemplary embodiment, it also includes: a second deleting unit, which is used to periodically traverse each multipath device in the global path bitmap, and determine in turn whether each path of the current multipath device meets the first delayed deletion condition. If the current path meets the first delayed deletion condition, the attribute information of the current path is deleted from the global path linked list until all paths of the current multipath device are traversed.
[0189] In an exemplary embodiment, it also includes: a third deletion unit, which is used to determine whether the current multipath device meets the second delayed deletion condition when all paths of the current multipath device are deleted in the global path linked list, and delete the attribute information of the current multipath device in the global path bitmap when the current multipath device meets the second delayed deletion condition until all multipath devices in the global path bitmap are traversed.
[0190] In an exemplary embodiment, the second deletion unit includes: a first judgment module, used to judge whether the delayed deletion flag of the attribute information of the current path is a first preset value; a second judgment module, used to judge whether the current path carries a forced deletion flag when the delayed deletion flag is the first preset value; a third determination module, used to determine that the current path meets the first delayed deletion condition when the current path carries a forced deletion flag; the third judgment module is used to judge whether the cache duration of the attribute information of the current path reaches the first cleanup time threshold when the current path does not carry the forced deletion flag; and a fourth determination module is used to determine that the current path meets the first delayed deletion condition when the cache duration of the attribute information of the current path reaches the first cleanup time threshold.
[0191] In an exemplary embodiment, it also includes: an eighth setting unit, which is used to set the state of the current path to a removal state in the global path bitmap after deleting the current multipath device in the global path linked list, and set the delayed deletion flag of the attribute information of the current path to a second preset value.
[0192] In an exemplary embodiment, the third deletion unit includes: a fourth judgment module, used to judge whether the delayed deletion flag of the attribute information of the current multipath device is a first preset value; a fifth judgment module, used to judge whether the current multipath device carries a forced deletion flag when the delayed deletion flag is the first preset value; a fifth determination module, used to determine that the current multipath device meets the second delayed deletion condition when the current multipath device carries the forced deletion flag; a sixth judgment module, used to judge whether the cache duration of the attribute information of the current multipath device reaches the second cleaning time threshold when the current multipath device does not carry the forced deletion flag; and a sixth determination module, used to determine that the current multipath device meets the second delayed deletion condition when the cache duration of the attribute information of the current multipath device reaches the second cleaning time threshold.
[0193] In an exemplary embodiment, it also includes: a ninth setting unit, which is used to set the state of the current multipath device to a removed state in the global path bitmap after deleting the attribute information of the current multipath device in the global path bitmap, and set the delayed deletion flag of the attribute information of the current multipath device to a second preset value.
[0194] Figure 8 is a structural block diagram of another path management device according to an embodiment of the present application, such as Figure 8 As shown, the device comprises:
[0195] A first traversal unit 802 is used to periodically traverse each multipath device in the global path bitmap, and when the current path meets the first delayed deletion condition, delete the attribute information of the current path in the global path linked list until all paths of the current multipath device are traversed, wherein the global path linked list is used to cache the attribute information of the path and the multipath device, the global path bitmap is used to cache the attribute information of the multipath device, and the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered;
[0196] The second traversal unit 804 is used to delete the attribute information of the current multipath device in the global path bitmap if all paths of the current multipath device are deleted in the global path linked list and the current multipath device meets the second delayed deletion condition, until all multipath devices in the global path bitmap are traversed.
[0197] In the embodiment of the present application, the first traversal unit 802 periodically traverses each multipath device in the global path bitmap, and when the current path meets the first delayed deletion condition, deletes the attribute information of the current path in the global path linked list until all paths of the current multipath device are traversed, wherein the global path linked list is used to cache the attribute information of the path and the multipath device, the global path bitmap is used to cache the attribute information of the multipath device, and the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered; the second traversal unit 804, if all paths of the current multipath device are deleted in the global path linked list, when the current multipath device meets the second delayed deletion condition, deletes the attribute information of the current multipath device in the global path bitmap until all multipath devices in the global path bitmap are traversed. When the path and the multipath device do not meet the delayed deletion condition, the path and its attribute information are retained in the global path link, and the multipath device and its attribute information are retained in the global path bitmap, and the path and the multipath device where the path is located are quickly restored when the fault is eliminated, so that the multipath disk of the host is quickly restored to an available state. When a path reaches a delayed deletion condition, the path and its attribute information are delayed deleted in the global path link, and the global path bitmap is updated. When a multipath device reaches a delayed deletion condition, the path device and its attribute information are delayed deleted in the global path bitmap, and the global path bitmap is updated, thereby preventing the attribute information of the path or multipath device from occupying the storage space of the global path bitmap for a long time.
[0198] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0199] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0200] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0201] An embodiment of the present application further provides an electronic device, Fig. 9 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application, such as Fig. 9 As shown, the electronic device 90 includes a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0202] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0203] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0204] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0205] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A path management method, characterized in that: include: In response to the creation instruction of the first path, query whether the attribute information of the first path exists in the global path linked table; In a case where the attribute information of the first path exists in the global path linked table, querying whether the attribute information of the first multipath device to which the first path belongs exists in the global path linked table, wherein the global path linked table is used to cache the attribute information of the path and the attribute information of the multipath device; In the case that the attribute information of the first multipath device does not exist in the global path linked list, querying whether the attribute information of the first multipath device exists in the global path bitmap, wherein the global path bitmap is used to cache the attribute information of the multipath device, the attribute information of the multipath device in the global path linked list is deleted when a path deletion event is triggered, and the attribute information of the path in the global path linked list and the multipath device in the global path bitmap are deleted when a delayed deletion condition is met; When the attribute information of the first multipath device exists in the global path bitmap, the attribute information of the first multipath device is added to the global path linked list, and the first path is added to the storage space of the first multipath device.
2. The method according to claim 1, characterized in that The first path is used to connect the host and the disk in the storage area network. In response to the creation instruction of the first path, querying whether the attribute information of the first path exists in the global path linked table includes: Obtain target host information of a host to be connected by the first path and a target disk identifier of a disk to be connected by the first path; Querying whether there is a path associated with the target host information and the target disk identifier in the global path linked table; In a case where the global path linked list contains a path associated with the target host information and the target disk identifier, determining that the global path linked list contains attribute information of the first path; In a case where the global path linked list does not contain a path associated with the target host information and the target disk identifier, it is determined that the global path linked list does not contain attribute information of the first path.
3. The method according to claim 1, characterized in that After querying whether the global path linked table contains the attribute information of the first path, the method further includes: If the attribute information of the first path does not exist in the global path chain table, collecting the attribute information of the first path; The attribute information of the first path is added to the global path linked list, and a step of querying whether the attribute information of the first multipath device to which the first path belongs exists in the global path linked list.
4. The method according to claim 1, characterized in that: The global path bitmap is also used to store the state of the path in the global path linked list and the delayed deletion flag of the attribute information of the path, and after querying whether the attribute information of the first path exists in the global path linked list, it also includes: When attribute information of the first path exists in the global path linked list, the state of the first path is set to a non-removal state in the global path bitmap, the delayed deletion flag of the attribute information of the first path is set to a second preset value, and the path reuse flag in the attribute information of the first path is set to a first preset value.
5. The method according to claim 1, characterized in that After querying whether the global path linked table contains the attribute information of the first multipath device to which the first path belongs, the method further includes: In a case where the attribute information of the first multipath device exists in the global path linked table, a step of adding the first path to the storage space of the first multipath device is performed.
6. The method according to claim 1, characterized in that The global path bitmap is also used to store the state of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After adding the attribute information of the first multipath device to the global path linked list, it also includes: The state of the first multipath device is set to a non-removal state in the global path bitmap, and a delayed deletion flag of the attribute information of the first multipath device is set to a second preset value.
7. The method according to claim 1, characterized in that The global path bitmap is also used to store the state of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After querying whether the attribute information of the first multipath device exists in the global path bitmap, the method further includes: If the attribute information of the first multipath device does not exist in the global path bitmap, collecting the attribute information of the first multipath device and adding the attribute information of the first multipath device to the global path linked list; The state of the first multipath device is set to a non-removal state in the global path bitmap, and the delayed deletion flag of the attribute information of the first multipath device is set to a second preset value.
8. The method according to claim 1, characterized in that Adding the first path to the storage space of the first multipath device includes: querying a path reuse flag in the attribute information of the first path; When the path reuse flag is a second preset value, querying the latest storage space of the first multipath device and adding the first path to the latest storage space; When the path reuse flag is a first preset value, the first path is added to the history storage space of the first multipath device.
9. The method according to claim 1, characterized in that: Also includes: In response to a deletion event of the second path, setting a state in the attribute information of the second path in the global path linked list to a closed state; Querying the global path linked table for states of all paths of the second multipath device to which the second path belongs; When all paths of the second multipath device are in a closed state, the attribute information of the second multipath device is deleted from the global path linked list.
10. The method according to claim 9, characterized in that The global path bitmap is also used to store the state of the path in the global path linked list and the delayed deletion flag of the attribute information of the path. After the state in the attribute information of the second path is set to the closed state in the global path linked list, it also includes: Setting the path reuse flag in the attribute information of the first path to a second preset value; The state of the second path is set to a removed state in the global path bitmap, and a delayed deletion flag of the attribute information of the second path is set to a first preset value.
11. The method according to claim 9, characterized in that The global path bitmap is further used to store the state of the multipath device in the global path linked list and the delayed deletion flag of the attribute information of the multipath device. After querying the state of all paths of the second multipath device to which the second path belongs in the global path linked list, the method further includes: When all paths of the second multipath device are in a closed state, the state of the second multipath device is set to a removed state in the global path bitmap, and a delayed deletion flag of the attribute information of the second multipath device is set to a first preset value.
12. The method according to claim 1, characterized in that Also includes: Periodically traverse each multipath device in the global path bitmap, determine in turn whether each path of the current multipath device meets the first delayed deletion condition, and if the current path meets the first delayed deletion condition, delete the attribute information of the current path in the global path linked list until all paths of the current multipath device are traversed.
13. The method according to claim 12, characterized in that Also includes: When all paths of the current multipath device are deleted from the global path linked list, determine whether the current multipath device meets a second delayed deletion condition; and when the current multipath device meets the second delayed deletion condition, delete attribute information of the current multipath device from the global path bitmap until all multipath devices in the global path bitmap are traversed.
14. The method according to claim 12, characterized in that Determining in sequence whether each path of the current multipath device meets the first delayed deletion condition includes: Determining whether the delayed deletion flag of the attribute information of the current path is a first preset value; When the delayed deletion flag is a first preset value, determining whether the current path carries a forced deletion flag; In a case where the current path carries the forced deletion flag, determining that the current path meets the first delayed deletion condition; In the case that the current path does not carry the forced deletion flag, determining whether the cache duration of the attribute information of the current path reaches a first cleaning time threshold; When the cache duration of the attribute information of the current path reaches the first cleaning time threshold, it is determined that the current path meets the first delayed deletion condition.
15. The method according to claim 12, characterized in that After deleting the attribute information of the current multipath device in the global path bitmap, the method further includes: The state of the current path is set to a removal state in the global path bitmap, and a delayed deletion flag of the attribute information of the current path is set to a second preset value.
16. The method according to claim 13, characterized in that Determining whether the current multipath device meets the second delayed deletion condition includes: Determining whether a delayed deletion flag of the attribute information of the current multipath device is a first preset value; When the delayed deletion flag is a first preset value, determining whether the current multipath device carries a forced deletion flag; In a case where the current multipath device carries the forced deletion flag, determining that the current multipath device meets the second delayed deletion condition; In a case where the current multipath device does not carry the forced deletion flag, determining whether a cache time length of the attribute information of the current multipath device reaches a second cleaning time threshold; When the cache duration of the attribute information of the current multipath device reaches the second cleaning time threshold, it is determined that the current multipath device meets the second delayed deletion condition.
17. The method according to claim 13, characterized in that After deleting the current multipath device in the global path linked list, the method further includes: The state of the current multipath device is set to a removal state in the global path bitmap, and a delayed deletion flag of the attribute information of the current multipath device is set to a second preset value.
18. A path management method, characterized in that: include: Periodically traverse each multipath device in the global path bitmap, and when the current path meets the first delayed deletion condition, delete the attribute information of the current path in the global path linked list until all paths of the current multipath device are traversed, wherein the global path linked list is used to cache the attribute information of the path and the multipath device, the global path bitmap is used to cache the attribute information of the multipath device, and the attribute information of the multipath device in the global path linked list is deleted when the path deletion event is triggered; If all paths of the current multipath device are deleted from the global path linked list, and the current multipath device meets the second delayed deletion condition, the attribute information of the current multipath device is deleted from the global path bitmap until all multipath devices in the global path bitmap are traversed.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 18 when executed by a processor.
20. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 18 are implemented.
Citation Information
Patent Citations
Method and device for acquiring multi-path disk target port group information
CN113746895A
Processing method and obtaining method for physical link information of paths of multi-path equipment
CN114238181A
