A path reservation method, device, equipment and medium of a multi-path device

CN116974466BActive Publication Date: 2026-10-20INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310625020.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2026-10-20
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

[0011]为了解决上述技术问题,本发明提供了一种多路径设备的路径施加预留方法、装置、设备及介质,施加预留方法用于解决目前主机集群场景下多路径设备无法进行多个路径的施加预留的问题

Benefits of technology

[0055]本发明中,为了对主机集群中多路径设备进行多个路径的施加预留操作,先选择一条可用路径路径i,在其不存在保留冲突的情况下、进行注册保留键值并施加保留;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116974466B_ABST
    Figure CN116974466B_ABST
Patent Text Reader

Abstract

The application relates to a path reservation method, device and equipment of a multi-path device and a medium, the reservation method comprising: judging whether a path i corresponding to the multi-path device satisfies: a current reservation key value corresponding to the path i is not 0, and the current reservation key value is inconsistent with an initialization registration key value recorded by a local host or a previous registration key value recorded by the local host; if not, performing registration reservation key value on the path i according to the initialization registration key value and performing reservation; when the reservation operation of the multi-path device is successful, performing registration reservation key value on a path j corresponding to the multi-path device according to the initialization registration key value; and increasing the subscript j of the path j in a natural number order within a path range, so as to sequentially perform registration reservation key value on the path j after the reservation operation of the multi-path device is successful. Through the technical scheme, the problem that the multi-path device cannot perform reservation on multiple paths in a host cluster scene can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of path application reservation technology, and in particular to a method, apparatus, device and medium for path application reservation in a multi-path device. Background Technology

[0002] Storage multipath technology refers to using multiple paths to connect a host and a storage array, so that there is more than one visible path from the host to the array; it can cross multiple switches, avoid single points of failure, and provide higher availability and performance advantages.

[0003] High availability means that when any node in a SAN network environment fails, IO requests can be sent through other paths, avoiding interruption. High throughput performance means that IO requests can be sent simultaneously through multiple paths in a load-balanced manner, improving IO throughput.

[0004] Multipath device technology refers to a storage device in a system having multiple paths. This phenomenon mainly occurs in SAN network environments, primarily for data link redundancy to achieve high availability. In other words, a multipath device on the host side may have multiple path devices representing it.

[0005] In existing technologies, in host cluster scenarios, a single storage logical volume needs to be mapped to multiple hosts; when multiple hosts access the volume, a SCSI reservation mechanism is used to avoid conflicts.

[0006] In traditional technologies, the method of reserving disk devices is based on a single path for a single disk; when multiple hosts access the device through this single path, there is no problem using the reservation mechanism.

[0007] However, for multipath devices, when a reservation is applied, only the currently selected path is registered with a reservation key and the reservation is applied. Therefore, when routing for I / O, only the path that has registered a reservation key and applied the reservation can access the volume; other paths that have not registered a reservation key cannot access the volume.

[0008] In host cluster scenarios, it is generally necessary to configure the load balancing algorithm of multi-path devices to be the failover load balancing algorithm, which will only allow a single path to bear IO. Therefore, in such cases, high-concurrency storage technology of multi-path cannot be used in cluster scenarios.

[0009] Therefore, in host cluster scenarios, effectively applying reservations to multi-path devices to achieve the following objectives has become a technical challenge:

[0010] How can a host cluster enable concurrent access to disks via multiple paths while maintaining data consistency, thereby improving the bandwidth and efficiency of accessing multi-path disks? Summary of the Invention

[0011] To address the aforementioned technical problems, this invention provides a method, apparatus, device, and medium for applying path reservations to multi-path devices. The method for applying reservations is used to solve the problem that multi-path devices in current host cluster scenarios cannot apply reservations for multiple paths.

[0012] To achieve the above objectives, the present invention provides a path reservation method for multi-path devices, used to perform multiple path reservation operations on multi-path devices in a host cluster. The reservation method includes:

[0013] When the multipath device receives a small computer system interface reservation instruction, it determines whether the path i corresponding to the multipath device meets the first exclusion condition; wherein, the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initial registration key value of the local initialization record or the previous registration key value of the local previous record.

[0014] If the first exclusion condition is not met, then register a retention key value for path i according to the initial registration key value and apply retention;

[0015] When the reservation operation for path i is successful, determine whether the reservation operation for the multipath device is successful.

[0016] When the reservation operation of the multipath device is successfully applied, the path j corresponding to the multipath device is registered and reserved according to the initial registration key value; wherein the subscripts i and j are different.

[0017] Within the path range, the index j of path j is incremented sequentially according to natural numbers, which is used to register and reserve key values ​​for path j in sequence after the reservation operation of the multipath device is successfully applied.

[0018] Furthermore, before registering a reservation key value for path i based on the initial registration key value and applying reservation, the reservation application method further includes:

[0019] Determine whether path i satisfies a first determination condition; wherein the first determination condition is: the currently retained key value corresponding to path i is inconsistent with the previously registered key value previously recorded on the local machine;

[0020] If the first judgment condition is met, then the current reserved key value corresponding to the path i is cleared and the current reserved key value is set to 0;

[0021] Determine whether the current reserved key value is 0; if it is not 0, generate information that the current storage volume is not reserved by other hosts, which is used to register a reserved key value for path i and apply reservation according to the initial registration key value.

[0022] Furthermore, registering and retaining a key value for path i based on the initial registration key value and applying retention specifically includes:

[0023] The path i is registered according to the initial registration key value;

[0024] Determine whether the registration operation for path i was successful; if the registration operation was successful, generate a message indicating that the registration retention key value operation was successful.

[0025] Set the registration success flag of path i to true; reserve path i according to the initialization registration key value recorded in the local machine initialization record.

[0026] Furthermore, before determining whether path i corresponding to the multipath device meets the first exclusion condition, the reservation application method further includes:

[0027] Determine whether the index i of path i exceeds the path range; if it does, generate information indicating that all paths have been processed.

[0028] Furthermore, determining whether path i corresponding to the multipath device satisfies the first exclusion condition specifically includes:

[0029] If the path i corresponding to the multipath device satisfies the first exclusion condition, then conflict retention information is generated.

[0030] A reservation conflict flag is set for path i, and reservation failure information is generated.

[0031] Furthermore, after registering a reserved key value for path i based on the initial registration key value and applying reservation, the reservation application method further includes:

[0032] Determine whether the reservation operation for path i was successful;

[0033] If the reservation operation fails, unregister the local key value for path i.

[0034] Within the path range, the index i of path i is incremented sequentially according to natural numbers, which is used to register reserved key values ​​and apply reservations to path i in turn when there are no reservation conflicts.

[0035] Furthermore, based on the initial registration key value, a reserved key value is registered for path j corresponding to the multipath device, specifically including:

[0036] Determine whether path j exceeds the path range;

[0037] If the path range is not exceeded, determine whether the registration success flag of path j is true; if it is true, generate the previously completed registration and retention key value operation information.

[0038] The path j is registered according to the initialization registration key value recorded in the local machine initialization record;

[0039] Determine whether the registration operation for path j was successful; if successful, generate a message indicating that the registration of the retained key value was successful.

[0040] Set the registration success flag for path j to true.

[0041] The present invention also provides a path application reservation device for a multi-path device, used to implement the aforementioned path application reservation method for a multi-path device, the application reservation device comprising:

[0042] The first exclusion condition judgment unit is used for:

[0043] When the multipath device receives a small computer system interface reservation instruction, it determines whether the path i corresponding to the multipath device meets the first exclusion condition; wherein, the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initial registration key value of the local initialization record or the previous registration key value of the local previous record.

[0044] Register a reserved key value and apply a reserved unit, which is used for:

[0045] If the first exclusion condition is not met, then register a retention key value for path i according to the initial registration key value and apply retention;

[0046] The multipath device applies a reserved judgment unit, which is used for:

[0047] When the reservation operation for path i is successful, determine whether the reservation operation for the multipath device is successful.

[0048] The remaining path registration retains key-value units, which are used for:

[0049] When the reservation operation of the multipath device is successfully applied, the path j corresponding to the multipath device is registered and reserved according to the initial registration key value; wherein the subscripts i and j are different.

[0050] The remaining path index incrementing unit is used for:

[0051] Within the path range, the index j of path j is incremented sequentially according to natural numbers, which is used to register and reserve key values ​​for path j in sequence after the reservation operation of the multipath device is successfully applied.

[0052] The present invention also provides a computer device, including a memory, a processor, and a computer program, wherein the computer program is stored in the memory and can run on the processor, and the processor executes the computer program to implement the steps of the aforementioned path application reservation method for multipath devices.

[0053] The present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned path application reservation method for multipath devices.

[0054] The above-described technical solution of the present invention has the following technical effects compared with the prior art:

[0055] In this invention, in order to apply reservation operations to multiple paths of multi-path devices in a host cluster, an available path i is first selected, and if there is no reservation conflict, a reservation key value is registered and a reservation is applied.

[0056] When selecting path i, it is first determined whether it meets the first exclusion condition, that is, whether path i satisfies: the current reserved key value corresponding to path i is not 0, and the current reserved key value is inconsistent with the initial registration key value of the local initialization record or the previous registration key value of the local previous record.

[0057] If the first exclusion condition is not met, it means that there is no retention conflict for path i, and a retention key value can be registered for it and retention can be applied.

[0058] After successfully registering and reserving the key value for path i, and successfully applying the reservation operation for the multi-path device, the registration operation for the key value for the remaining path is performed sequentially.

[0059] The index j of path j is incremented in natural number order. As long as path j meets the conditions, the key values ​​can be registered and retained in sequence.

[0060] Therefore, compared to the traditional method of applying reservations to disk devices, the above method first registers the reservation key value and applies the reservation through an available path, in the absence of reservation conflicts;

[0061] If the reservation operation is successful, the remaining paths will then be registered and reserved with key values. This achieves the following purpose: while the host is reserving the volume, multiple paths can access the disk concurrently, improving the bandwidth and efficiency of accessing the multi-path disk. Attached Figure Description

[0062] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0063] Figure 1 This is a flowchart illustrating the path reservation method for multi-path devices in Embodiment 1 of the present invention.

[0064] Figure 2 This is a schematic diagram of the overall process of the multi-path application reservation method in an actual embodiment of the present invention;

[0065] Figure 3 This is a structural block diagram of the path application reservation device for the multi-path device in Embodiment 2 of the present invention;

[0066] Figure 4 This is an internal structural diagram of the computer device in Embodiment 2 of the present invention. Detailed Implementation

[0067] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0068] Example 1:

[0069] like Figure 1 As shown, this embodiment of the invention provides a method for applying path reservation to multi-path devices, used to perform multiple path reservation operations on multi-path devices in a host cluster. The method includes:

[0070] When a multipath device receives a reserved instruction for a small computer system interface, it determines whether path i corresponding to the multipath device meets the first exclusion condition. The first exclusion condition is that the current reserved key value corresponding to path i is not 0, and the current reserved key value is inconsistent with the initial registration key value recorded in the local initialization record or the previous registration key value recorded in the local record.

[0071] If the first exclusion condition is not met, then register the reserved key value for path i according to the initial registration key value and apply the reservation;

[0072] When the reservation operation for path i is successful, determine whether the reservation operation for the multipath device is successful.

[0073] When the reservation operation for the multipath device is successfully applied, the path j corresponding to the multipath device is registered and reserved according to the initial registration key value; where the subscripts i and j are different.

[0074] Within the path range, the index j of path j is incremented sequentially by natural numbers. This is used to register and reserve key values ​​for path j sequentially after the reservation operation on the multipath device is successfully completed.

[0075] In a specific embodiment, in order to apply reservation operations to multiple paths of multi-path devices in the host cluster, an available path i is first selected, and if there is no reservation conflict, a reservation key value is registered and a reservation is applied.

[0076] When selecting path i, it is first determined whether it meets the first exclusion condition, that is, whether path i satisfies: the current reserved key value corresponding to path i is not 0, and the current reserved key value is inconsistent with the initial registration key value of the local initialization record or the previous registration key value of the local previous record.

[0077] If the first exclusion condition is not met, it means that there is no retention conflict for path i, and a retention key value can be registered for it and retention can be applied.

[0078] After successfully registering and reserving the key value for path i, and successfully applying the reservation operation for the multi-path device, the registration operation for the key value for the remaining path is performed sequentially.

[0079] The index j of path j is incremented in natural number order. As long as path j meets the conditions, the key values ​​can be registered and retained in sequence.

[0080] Therefore, compared to the traditional method of applying reservations to disk devices, the above method first registers the reservation key value and applies the reservation through an available path, in the absence of reservation conflicts;

[0081] If the reservation operation is successful, the remaining paths will then be registered and reserved with key values. This achieves the following purpose: while the host is reserving the volume, multiple paths can access the disk concurrently, improving the bandwidth and efficiency of accessing the multi-path disk.

[0082] In practice, SCSI, or Small Computer System Interface, represents a dedicated interface for small computer systems. It is an expansion interface designed for small computers, allowing the computer to add other peripheral devices to improve system performance or add new functions, such as hard drives, optical drives, and scanners.

[0083] SCSI reservation is a mechanism that allows a SCSI initiator to reserve a LUN for exclusive access and prevent other initiators from making changes. This feature is typically used in clusters.

[0084] I / O technology enables data exchange between computers and storage devices. SCSI technology is an intermediate technology that facilitates the I / O path from the CPU to the storage system.

[0085] In summary, the above-mentioned method for reserving paths for multi-path devices can effectively reserve paths for multi-path devices in host cluster scenarios, enabling the host cluster to access the disk concurrently via multiple paths while ensuring data consistency, thereby improving the bandwidth and efficiency of accessing multi-path disks.

[0086] In a preferred embodiment, before registering a reservation key value for path i based on the initial registration key value and applying reservation, the reservation application method further includes:

[0087] Determine whether path i satisfies the first judgment condition; wherein, the first judgment condition is: the current retained key value corresponding to path i is inconsistent with the previously registered key value previously recorded on the local machine;

[0088] If the first condition is met, then clear the current retained key value corresponding to path i and set the current retained key value to 0;

[0089] Determine if the current reserved key value is 0; if it is not 0, generate information that the current storage volume is not reserved by other hosts, which is used to register a reserved key value for path i and apply reservation based on the initial registration key value.

[0090] In practice, the host may have previously successfully performed a retention operation and obtained access to the volume. However, due to reasons such as the host restarting, power failure, or reloading the multipath driver, the retention key value of the current host may change. This can lead to the problem that the same host cannot apply retention due to host failure (i.e., the same host in path i has inconsistent key values ​​before and after).

[0091] In practical embodiments, for these scenarios, the above-mentioned reservation method can first determine the case where the key values ​​of the same host in path i are inconsistent;

[0092] If there are inconsistencies in the key values ​​of the same host in path i, the previously registered key value is cleared and the new reserved key value is used for registration and reservation operations, further improving the applicability of abnormal scenarios for applying reservation operations.

[0093] In a preferred embodiment, registering a retention key value for path i based on the initial registration key value and applying retention specifically includes:

[0094] Register path i according to the initial registration key value;

[0095] Determine whether the registration operation for path i was successful; if the registration operation was successful, generate a message indicating that the registration retention key-value operation was successful.

[0096] Set the registration success flag for path i to true; reserve path i according to the initialization registration key value in the local initialization record.

[0097] In a practical implementation, if the current reserved key value of path i is 0, then the reserved key value is registered and reserved according to the specific process.

[0098] In a preferred embodiment, before determining whether path i corresponding to the multipath device meets the first exclusion condition, the reservation method further includes:

[0099] Determine if the index i of path i is outside the path range; if it is, generate information indicating that all paths have been processed.

[0100] In a practical implementation, it is first determined whether the path index I is outside the path range; only if it is not outside the path range can the path i be further registered and the retention key value be applied.

[0101] In a preferred embodiment, determining whether path i corresponding to the multipath device satisfies the first exclusion condition specifically includes:

[0102] If path i corresponding to the multipath device meets the first exclusion condition, then information about retained conflicts is generated.

[0103] Set a reservation conflict flag for path i and generate a reservation failure message.

[0104] In a practical implementation, if path i has a reservation conflict, a reservation failure message is generated.

[0105] In a preferred embodiment, after registering a reservation key value for path i based on the initial registration key value and applying reservation, the reservation application method further includes:

[0106] Determine whether the reservation operation for path i was successful;

[0107] If the reservation operation fails, unregister the local key value for path i;

[0108] Within the path range, the index i of path i is incremented sequentially by natural numbers. This is used to register reserved key values ​​for path i and apply reservations in turn, provided there are no reservation conflicts.

[0109] In a practical implementation, if the current reserved key value of path i is 0, a reserved key value is registered and a reservation is applied; if the reservation operation fails, corresponding remedial measures are taken.

[0110] In a preferred embodiment, registering and reserving key values ​​for path j corresponding to the multipath device based on the initial registration key value specifically includes:

[0111] Determine if path j exceeds the path range;

[0112] If the path range is not exceeded, check if the registration success flag for path j is true; if it is true, generate the previously completed registration key-value operation information.

[0113] Register path j according to the initialization registration key value in the local initialization record;

[0114] Determine whether the registration operation for path j was successful; if successful, generate a message indicating that the registration of the retained key value was successful.

[0115] Set the registration success flag for path j to true.

[0116] In a practical implementation, firstly, through an available path, and assuming no retention conflicts, a reserved key value is registered and reserved. If the retention operation is successful, subsequent registration of reserved key values ​​is performed on the remaining paths.

[0117] In a preferred embodiment, when the multipath device receives the small computer system interface reservation instruction, it first initializes the index i of path i to 1;

[0118] Next, determine whether the index i of path i is outside the path range;

[0119] If the path range is not exceeded, read the currently reserved key value corresponding to path i;

[0120] Determine whether path i corresponding to the multipath device meets the first exclusion condition; wherein, the first exclusion condition is: the current reserved key value corresponding to path i is not 0, and the current reserved key value is inconsistent with the initial registration key value of the local initialization record or the previous registration key value of the local previous record;

[0121] If the first exclusion condition is not met, then determine whether path i meets the first judgment condition; wherein, the first judgment condition is: the current retained key value corresponding to path i is inconsistent with the previously registered key value previously recorded on the local machine;

[0122] If the first condition is met, then clear the current retained key value corresponding to path i and set the current retained key value to 0;

[0123] Determine if the current reserved key value is 0; if it is not 0, generate information that the current storage volume is not reserved by other hosts, which is used to register a reserved key value for path i and apply reservation based on the initial registration key value;

[0124] Register the reserved key value for path i based on the initial registration key value and apply the reservation.

[0125] Therefore, by first using an available path, in the absence of retention conflicts, the retention key value is registered and the retention is applied.

[0126] like Figure 2 As shown in the actual embodiment of the present invention, the method for applying reservations to a multi-path device includes the following steps:

[0127] Step S101: The multipath device receives the reserved SCSI command (i.e., the small computer system interface reserved command); initializes the path index i to 1;

[0128] Step S102: Determine whether the path index I exceeds the path range; if true, it means that all paths have been processed and proceed to step S115; otherwise, proceed to step S103.

[0129] Step S103: Read the current reserved key value of path i;

[0130] Step S104: Determine whether the current reserved key value of path i is not 0 and whether the value is inconsistent with the registration key value recorded during local initialization or previously recorded. If it is true, it means that other hosts have successfully performed the reservation operation and obtained access to the volume, which conflicts with the reservation operation to be performed by this host. Jump to step S114; otherwise, jump to step S105.

[0131] Step S105: Determine whether the current reserved key value of path i is inconsistent with the previously registered key value recorded on the local machine; if true, proceed to step S106; otherwise, proceed to step S107.

[0132] When the key value of the same host in path i is inconsistent before and after, it means that the host has successfully performed the reservation operation and obtained access to the volume before, but the reservation key value of the host may have changed due to the host restarting, power failure, reloading of multipath driver, etc.; therefore, the key value is inconsistent before and after.

[0133] Step S106: Clear the reserved key value on path i; set the current reserved key value to 0;

[0134] Step S107: Determine if the current reserved key value is 0; if it is true, it means that the current storage volume has not been reserved by other hosts, and proceed to step S108; otherwise, proceed to step S115.

[0135] Step S108: Path i performs a registration operation using the key value of the local initialization record;

[0136] Step S109: Determine whether the registration operation for path i was successful; if true, it means that the registration operation to retain the key value has been successful, and proceed to step S110; otherwise, proceed to step S113.

[0137] Step S110: Set the registration success flag of path i to true; apply reservation to path i using the key value of the local initialization record;

[0138] Step S111: Determine whether the reservation operation for path i was successful; if true, it means that the reservation operation for path i has been successful, and proceed to step S115; otherwise, proceed to step S112.

[0139] Step S112: Unregister the local key value for path i;

[0140] Step S113: Increment the path index i; jump to step S102;

[0141] Step S114: Set a reservation conflict flag to indicate that reservation failed;

[0142] Step S115: Determine whether the reservation application for the multipath device was successful; if true, it means that the reservation application operation for the multipath device was successful, and further registration of the key value for each path is required, then proceed to step S116; otherwise, end.

[0143] Step S116: Initialize the path j index to 1;

[0144] Step S117: Determine whether path j exceeds the path range; if true, it means that all paths have been processed and the process ends; otherwise, proceed to step S118.

[0145] Step S118: Determine if the registration success flag for path j is true; if it is true, it means that the registration and key-value retention operation has been completed previously, and proceed to step S119; otherwise, proceed to step S122.

[0146] Step S119: Path j uses the key value of the local initialization record to perform the registration operation;

[0147] Step S120: Determine whether the registration operation for path j was successful; if true, it means that the registration operation to retain the key value has been successful, and proceed to step S121; otherwise, proceed to step S122.

[0148] Step S121: Set the registration success flag of path j to true;

[0149] Step S122: The path index j is incremented in natural number order, and the process jumps to step S117 (i.e., continue the registration operation of the remaining paths with preserved key values).

[0150] In summary, the above-mentioned method for reserving paths for multi-path devices can effectively reserve paths for multi-path devices in host cluster scenarios, enabling the host cluster to access the disk concurrently via multiple paths while ensuring data consistency, thereby improving the bandwidth and efficiency of accessing multi-path disks.

[0151] It is important to note that although the steps in the flowchart are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the exact order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps; they can be executed in other orders. Furthermore, at least some steps in the flowchart may include multiple sub-steps or stages. These sub-steps or stages do not necessarily complete at the same time, but can be executed at different times. The execution order of these sub-steps or stages is also not necessarily sequential, but can be performed alternately or in rotation with other steps or at least some of the sub-steps or stages of other steps.

[0152] Example 2:

[0153] like Figure 3 As shown, this embodiment of the invention also provides a path reservation device for a multi-path device, used to implement the aforementioned path reservation method for a multi-path device. The reservation device includes:

[0154] The first exclusion condition judgment unit is used for:

[0155] When a multipath device receives a reserved instruction for a small computer system interface, it determines whether path i corresponding to the multipath device meets the first exclusion condition. The first exclusion condition is that the current reserved key value corresponding to path i is not 0, and the current reserved key value is inconsistent with the initial registration key value recorded in the local initialization record or the previous registration key value recorded in the local record.

[0156] Register a reserved key value and apply a reserved unit, which is used for:

[0157] If the first exclusion condition is not met, then register the reserved key value for path i according to the initial registration key value and apply the reservation;

[0158] The multipath device applies a reserved judgment unit, which is used for:

[0159] When the reservation operation for path i is successful, determine whether the reservation operation for the multipath device is successful.

[0160] The remaining path registration retains key-value units, which are used for:

[0161] When the reservation operation for the multipath device is successfully applied, the path j corresponding to the multipath device is registered and reserved according to the initial registration key value; where the subscripts i and j are different.

[0162] The remaining path index incrementing unit is used for:

[0163] Within the path range, the index j of path j is incremented sequentially by natural numbers. This is used to register and reserve key values ​​for path j sequentially after the reservation operation on the multipath device is successfully completed.

[0164] In a preferred embodiment, the reservation application device further includes a remedy unit for failure to apply reservation, which is used to:

[0165] Determine whether path i satisfies the first judgment condition; wherein, the first judgment condition is: the current retained key value corresponding to path i is inconsistent with the previously registered key value previously recorded on the local machine;

[0166] If the first condition is met, then clear the current retained key value corresponding to path i and set the current retained key value to 0;

[0167] Determine if the current reserved key value is 0; if it is not 0, generate information that the current storage volume is not reserved by other hosts, which is used to register a reserved key value for path i and apply reservation based on the initial registration key value.

[0168] In a preferred embodiment, registering and retaining key values ​​and applying the retention unit specifically serves to:

[0169] Register path i according to the initial registration key value;

[0170] Determine whether the registration operation for path i was successful; if the registration operation was successful, generate a message indicating that the registration retention key-value operation was successful.

[0171] Set the registration success flag for path i to true; reserve path i according to the initialization registration key value in the local initialization record.

[0172] In a preferred embodiment, the reservation device further includes a path range exceedance determination unit, which is used to:

[0173] Determine if the index i of path i is outside the path range; if it is, generate information indicating that all paths have been processed.

[0174] In a preferred embodiment, the first exclusion condition judgment unit is specifically used for:

[0175] If path i corresponding to the multipath device meets the first exclusion condition, then information about retained conflicts is generated.

[0176] Set a reservation conflict flag for path i and generate a reservation failure message.

[0177] In a preferred embodiment, the reservation application device further includes a reservation application operation failure recovery unit, which is used for:

[0178] Determine whether the reservation operation for path i was successful;

[0179] If the reservation operation fails, unregister the local key value for path i;

[0180] Within the path range, the index i of path i is incremented sequentially by natural numbers. This is used to register reserved key values ​​for path i and apply reservations in turn, provided there are no reservation conflicts.

[0181] In a preferred embodiment, the remaining path registration key-value unit is specifically used for:

[0182] Determine if path j exceeds the path range;

[0183] If the path range is not exceeded, check if the registration success flag for path j is true; if it is true, generate the previously completed registration key-value operation information.

[0184] Register path j according to the initialization registration key value in the local initialization record;

[0185] Determine whether the registration operation for path j was successful; if successful, generate a message indicating that the registration of the retained key value was successful.

[0186] Set the registration success flag for path j to true.

[0187] For specific limitations on the aforementioned apparatus, please refer to the limitations on the method described above, which will not be repeated here.

[0188] Each module in the aforementioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0189] Among them, such as Figure 4 As shown, the aforementioned computer device can be a terminal, comprising a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse, etc.

[0190] The structures shown in the above figures are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer device to which the present invention is applied. Specific computer devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.

[0191] It is understood that the implementation of all or part of the processes in the above embodiments can be accomplished by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.

[0192] Any references to memory, storage, database, or other media used in the embodiments provided in this invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0193] It should be noted that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A method for applying path reservation in a multi-path device, characterized in that, This method is used to apply reservation operations for multiple paths to multipath devices in a host cluster. The reservation method includes: When the multipath device receives a small computer system interface reservation instruction, it determines whether the path i corresponding to the multipath device meets the first exclusion condition; wherein, the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initial registration key value of the local initialization record or the previous registration key value of the local previous record. If the first exclusion condition is not met, then register a retention key value for path i according to the initial registration key value and apply retention; When the reservation operation for path i is successful, determine whether the reservation operation for the multipath device is successful. When the reservation operation of the multipath device is successfully applied, the path j corresponding to the multipath device is registered and reserved according to the initial registration key value; wherein the subscripts i and j are different. Within the path range, the index j of path j is incremented sequentially according to natural numbers, which is used to register and reserve key values ​​for path j in sequence after the reservation operation of the multipath device is successfully applied.

2. The path reservation method for multi-path devices according to claim 1, characterized in that, Before registering a reservation key value for path i based on the initial registration key value and applying reservation, the reservation application method further includes: Determine whether path i satisfies a first determination condition; wherein the first determination condition is: the currently retained key value corresponding to path i is inconsistent with the previously registered key value previously recorded on the local machine; If the first judgment condition is met, then the current reserved key value corresponding to the path i is cleared and the current reserved key value is set to 0; Determine whether the current reserved key value is 0; if it is not 0, generate information that the current storage volume is not reserved by other hosts, which is used to register a reserved key value for path i and apply reservation according to the initial registration key value.

3. The method for applying path reservation for a multi-path device according to claim 1 or 2, characterized in that, Register and retain key values ​​for path i based on the initial registration key value, and apply retention accordingly. Specifically, this includes: The path i is registered according to the initial registration key value; Determine whether the registration operation for path i was successful; if the registration operation was successful, generate a message indicating that the registration retention key value operation was successful. Set the registration success flag of path i to true; reserve path i according to the initialization registration key value recorded in the local machine initialization record.

4. The path reservation method for a multi-path device according to claim 3, characterized in that, Before determining whether path i corresponding to the multipath device meets the first exclusion condition, the reservation application method further includes: Determine whether the index i of path i exceeds the path range; if it does, generate information indicating that all paths have been processed.

5. The path reservation method for a multi-path device according to claim 4, characterized in that, Determining whether path i corresponding to the multipath device meets the first exclusion condition specifically includes: If the path i corresponding to the multipath device satisfies the first exclusion condition, then conflict retention information is generated. A reservation conflict flag is set for path i, and reservation failure information is generated.

6. The path reservation method for a multi-path device according to claim 5, characterized in that, After registering a reserved key value for path i according to the initial registration key value and applying reservation, the reservation application method further includes: Determine whether the reservation operation for path i was successful; If the reservation operation fails, unregister the local key value for path i. Within the path range, the index i of path i is incremented sequentially according to natural numbers, which is used to register reserved key values ​​and apply reservations to path i in turn when there are no reservation conflicts.

7. The method for applying path reservation for a multi-path device according to claim 1, characterized in that, Registering and reserving key values ​​for path j corresponding to the multipath device based on the initial registration key value specifically includes: Determine whether path j exceeds the path range; If the path range is not exceeded, determine whether the registration success flag of path j is true; if it is true, generate the previously completed registration and retention key value operation information. The path j is registered according to the initialization registration key value recorded in the local machine initialization record; Determine whether the registration operation for path j was successful; if successful, generate a message indicating that the registration of the retained key value was successful. Set the registration success flag for path j to true.

8. A path application reservation device for a multi-path device, characterized in that, For implementing the path reservation method for a multipath device as described in any one of claims 1-7, the reservation device comprises: The first exclusion condition judgment unit is used for: When the multipath device receives a small computer system interface reservation instruction, it determines whether the path i corresponding to the multipath device meets the first exclusion condition; wherein, the first exclusion condition is: the current reserved key value corresponding to the path i is not 0, and the current reserved key value is inconsistent with the initial registration key value of the local initialization record or the previous registration key value of the local previous record. Register a reserved key value and apply a reserved unit, which is used for: If the first exclusion condition is not met, then register a retention key value for path i according to the initial registration key value and apply retention; The multipath device applies a reserved judgment unit, which is used for: When the reservation operation for path i is successful, determine whether the reservation operation for the multipath device is successful. The remaining path registration retains key-value units, which are used for: When the reservation operation of the multipath device is successfully applied, the path j corresponding to the multipath device is registered and reserved according to the initial registration key value; wherein the subscripts i and j are different. The remaining path index incrementing unit is used for: Within the path range, the index j of path j is incremented sequentially according to natural numbers, which is used to register and reserve key values ​​for path j in sequence after the reservation operation of the multipath device is successfully applied.

9. A computer device comprising a memory, a processor, and a computer program, wherein the computer program is stored in the memory and can run on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the path application reservation method for the multipath device as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the path application reservation method for the multipath device as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Processing method for I / O (input / output) data access interrupt, system and equipment

    CN102495815A

  • Computer system and access restriction method

    CN103384875A