Storage disk reservation method, electronic device, storage medium and program product

By setting up a storage disk reserved record and processing instructions in the Ethernet circuit board, the problem that the storage disk reservation cannot be achieved based on the Ethernet storage expansion architecture cannot be achieved, and the effect of reducing the data conflict is achieved.

CN118860915BActive Publication Date: 2025-01-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411313770.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-28
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

In an Ethernet-based storage expansion architecture, the host cannot realize the reservation of storage disks, thus unable to resolve the problem of data conflicts.

Method used

By setting a reserved record reserved record in the Ethernet circuit board, receiving the reserved instructions sent by the storage controller, and when the naming space of the target storage disc Execute the reserved operation.

Benefits of technology

The reservation of the storage disc in the storage expansion architecture based on Ethernet is realized, reducing the occurrence of data conflict.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860915B_ABST
    Figure CN118860915B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of storage technology, and specifically discloses a storage disk reservation method, electronic device, storage medium and program product, wherein the storage disk is connected to an Ethernet circuit board, and the Ethernet circuit board is connected to multiple storage controllers in a controller cluster; the method comprises: receiving a reservation instruction sent by a first storage controller in the controller cluster, the reservation instruction is used to request to perform a reservation operation on a target storage disk; if the namespace of the target storage disk is in an unreserved state in a locally saved storage disk reservation record, the reservation instruction is sent to the target storage disk to indicate that the target storage disk reserves the namespace; if the target storage disk reserves the namespace successfully, the first storage controller is associated with the target storage disk in the storage disk reservation record to indicate that the namespace in the target storage disk is reserved by the first storage controller, and a reservation success response is returned to the first storage controller. Data conflicts can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of storage technology, and in particular to a storage disk reservation method, electronic equipment, storage medium and program product. Background Art

[0002] In actual business scenarios, there may be multiple hosts that need to access the same shared storage disk. To avoid data conflicts, each host can perform a reservation operation on the shared storage disk before accessing it. If a host successfully reserves a shared storage disk, the host can monopolize the shared storage disk and read, write, delete, and modify data in the shared storage disk. During the period when a host monopolizes the shared storage disk, other hosts may not have access to the shared storage disk. In this way, data conflicts are effectively avoided.

[0003] However, in some current technologies, in an Ethernet-based storage expansion architecture, due to the limitation of the reservation implementation mechanism of the protocol adopted by the architecture, the host cannot implement the reservation for the storage disk, thereby failing to solve the problem of data conflict.

[0004] In view of this, a method is urgently needed to implement storage disk reservation under this architecture. Summary of the invention

[0005] In view of this, the implementation method of the present disclosure provides a storage disk reservation method, electronic device, computer-readable storage medium and computer program product, which can implement storage disk reservation and reduce data conflicts in an Ethernet-based storage expansion architecture.

[0006] On one hand, the present disclosure provides a method for reserving a storage disk; the method comprises:

[0007] The storage disk is connected to an Ethernet circuit board, the Ethernet circuit board is connected to multiple storage controllers in a controller cluster, and the method is applied to the Ethernet circuit board; the method includes:

[0008] receiving a reservation instruction sent by a first storage controller in the controller cluster, wherein the reservation instruction is used to request to perform a reservation operation on a target storage disk;

[0009] If the namespace of the target storage disk is in an unreserved state in the locally saved storage disk reservation record, sending the reservation instruction to the target storage disk to instruct the target storage disk to reserve the namespace;

[0010] If the target storage disk reserves the namespace successfully, the first storage controller is associated with the target storage disk in the storage disk reservation record to indicate that the namespace in the target storage disk is reserved by the first storage controller, and a reservation success response is returned to the first storage controller.

[0011] In some embodiments, the method further comprises:

[0012] If the namespace is in a reserved state in the locally saved storage disk reservation record, the process of sending the reservation instruction to the target storage disk is terminated, and a first response indicating a reservation failure is returned to the first storage controller.

[0013] In this way, reservation failure caused by multiple storage controllers initiating reservation operations on the target storage disk at the same time is avoided.

[0014] In some embodiments, the target storage disk is connected to a plurality of Ethernet circuit boards, and the method is applied to a first Ethernet circuit board to which the target storage disk is connected and which receives a reservation instruction; the method further comprises:

[0015] If the target storage disk fails to reserve the namespace, it is determined that the namespace is reserved by a second storage controller in the controller cluster through a second Ethernet circuit board connected to the target storage disk, and a second response indicating the reservation failure is returned to the first storage controller.

[0016] In this way, the reservation failure problem caused by different storage controllers reserving target storage disks through different Ethernet circuit boards can be avoided.

[0017] In some embodiments, after returning the second response to the first storage controller, the method further includes:

[0018] The reservation instruction resent by the first storage controller is received, and the reservation instruction is sent to the target storage disk to re-instruct the target storage disk to reserve the namespace.

[0019] In this way, by trying to resend the instruction, a namespace can be reserved for the first storage controller in time after the namespace of the target storage disk is released.

[0020] In some embodiments, after resending the reservation instruction to the target storage disk, the method further includes:

[0021] If the target storage disk successfully reserves the namespace based on the resent reservation instruction, the first storage controller is associated with the target storage disk in the local storage disk reservation record, and a reservation success response is returned to the first storage controller.

[0022] In this way, the namespace is reserved for the first storage controller in a timely manner.

[0023] In some embodiments, after the first storage controller resends the reservation instruction a preset number of times, if the namespace is not successfully reserved, the method further includes:

[0024] receiving a preemption instruction sent by the first storage controller, and sending the preemption instruction to the target storage disk to instruct the target storage disk to preempt the namespace for the first storage controller;

[0025] If the namespace is seized successfully, the first storage controller is associated with the target storage disk in the local storage disk reservation record, and a seizure success response is returned to the first storage controller.

[0026] This preemption mechanism can prevent the reserved namespace of the first storage controller from being affected when the second storage controller is abnormal, and has high reliability.

[0027] In some embodiments, after the first storage controller completes accessing the namespace, the method further includes:

[0028] A release instruction sent by the first storage controller is received, and in the storage disk reservation record, the first storage controller is disassociated from the target storage disk to indicate that the namespace is released by the first storage controller.

[0029] In some embodiments, after successfully reserving the namespace for the first storage controller, the method further includes:

[0030] If an event is received from the target storage disk indicating that the namespace is preempted by a storage controller other than the first storage controller, the first storage controller is disassociated from the target storage disk in the local storage disk reservation record to indicate that the namespace is released by the first storage controller.

[0031] This preemption mechanism can prevent the abnormality of the first storage controller from affecting the reserved namespace of other storage controllers, and has high reliability.

[0032] In some embodiments, before receiving the reservation instruction, the method further includes:

[0033] receiving a registration instruction sent by the first storage controller, wherein the registration instruction is used to specify a designated storage disk to which the first storage controller is to be registered;

[0034] The registration instruction is sent to the designated storage disk to register the first storage controller with the designated storage.

[0035] In some embodiments, after receiving the reservation instruction, the method further includes:

[0036] Determine whether the first storage controller is registered with the target storage disk;

[0037] If not, returning a third response indicating reservation failure to the first storage controller;

[0038] If yes, a reservation operation is performed on the target storage disk.

[0039] In this way, an unregistered storage controller is prevented from using the target storage disk.

[0040] In some embodiments, the registration instruction for registering the first storage controller to the target storage disk further includes first authentication information for authenticating the first storage controller, and the reservation instruction sent by the first storage controller further includes second authentication information for authenticating the first storage controller;

[0041] After receiving the reservation instruction sent by the first storage controller, the method further includes:

[0042] Determine whether the first authentication information and the second authentication information are the same; if they are the same, perform a reservation operation on the target storage disk; if they are not the same, return a fourth response indicating a reservation failure to the first storage controller.

[0043] In some embodiments, in the controller cluster, authentication information used to authenticate at least some of the storage controllers is the same.

[0044] Another aspect of the present disclosure provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method described above is implemented.

[0045] Another aspect of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0046] Another aspect of the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method as described above is implemented.

[0047] In the technical solutions of some embodiments of the present disclosure, a storage disk reservation record is set in the Ethernet circuit board, and the storage disk reservation record is used to record whether the storage disk connected to the Ethernet circuit board is in a reserved state. In this way, when the Ethernet circuit board receives a reservation instruction sent by the first storage controller in the controller cluster to the target storage disk, it can be judged in the storage disk reservation record whether the namespace of the target storage disk is in a reserved state, and when the namespace is in an unreserved state, the reservation instruction is sent to the target storage disk to indicate that the target storage disk reserves the namespace. And, in the case where the target storage disk reserves the namespace successfully, the namespace of the target storage disk is set to be reserved by the first storage controller in the storage disk reservation record. In this way, the Ethernet circuit board can refuse other storage controllers other than the first storage controller to initiate a reservation operation for the target storage disk based on the storage disk reservation record. That is, in the solution of the present disclosure, by setting the control logic corresponding to the reservation method in the Ethernet circuit board, the reservation operation initiated by each storage controller for the target storage disk can be implemented when the target storage disk cannot distinguish between each storage controller, thereby greatly reducing data conflicts. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:

[0049] Figure 1 A schematic diagram of an Ethernet-based storage expansion architecture provided by an embodiment of the present disclosure is shown;

[0050] Figure 2 A schematic diagram of a flow chart of a reservation method provided by an embodiment of the present disclosure is shown;

[0051] Figure 3 A schematic diagram showing a connection between a target storage disk and an Ethernet circuit board provided by an embodiment of the present disclosure is shown;

[0052] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical scheme and advantages of the implementation method of the present disclosure clearer, the technical scheme in the implementation method of the present disclosure will be clearly and completely described below in conjunction with the drawings in the implementation method of the present disclosure. Obviously, the implementation method described is a part of the implementation method of the present disclosure, not all of the implementation methods. Based on the implementation method in the present disclosure, all other implementation methods obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0054] In actual business scenarios, one of the situations where multiple hosts need to access the same shared storage disk is when a cluster system has a split-brain situation. Specifically, in a cluster system, each node can serve as a host. The nodes are divided into multiple subsets that cannot communicate with each other due to communication failures and other reasons, which is called a split-brain situation. In the case of a split-brain situation, nodes in different subsets of the cluster system may think that they are the master node or the only active node, and thus start to independently provide services or perform operations. To avoid data conflicts, nodes in different subsets will reach a consensus through a quorum disk. The so-called quorum disk is a storage disk shared by nodes in different subsets. After a split-brain situation occurs in the cluster system, nodes in different subsets write cluster status events to the quorum disk to determine which nodes in the subsets should continue to provide services and which nodes in the subsets should exit the service. The quorum disk allows only one node to access it at a time. When different nodes access the quorum disk, they need to perform a reservation operation on the quorum disk first. Only when the reservation is successful can the node have the right to access the quorum disk.

[0055] In some current technologies, in an Ethernet-based storage expansion architecture, nodes in a cluster system cannot perform reservation operations on storage disks, which means that the arbitration disk function cannot be implemented in an Ethernet-based storage expansion architecture. Figure 1 , is a schematic diagram of an Ethernet-based storage expansion architecture provided for one embodiment of the present disclosure. Figure 1 In the embodiment, the storage expansion architecture includes a controller cluster 11, at least one Ethernet circuit board 12, a storage disk expansion card 14 and a plurality of storage disks 13. Among them:

[0056] The controller cluster 11 includes a plurality of storage controllers 111. For example, Figure 1In the example, two storage controllers 111 are included. Each storage controller 111 can be used as one of the nodes (i.e., host) in the controller cluster 11. The storage controller 111 is mainly used to connect to the business server, and based on the data operation request sent by the business server, perform data operation management in the storage disk 13. For example, when the business server needs to write data to the storage disk 13, the data can be sent to the storage controller 111, and the storage controller 111 determines the storage location of the data in the storage disk 13. After determining the storage location of the data, the storage controller 111 can write the data to the storage disk 13 through the Ethernet circuit board 12.

[0057] The Ethernet circuit board 12 may also be referred to as an Ethernet-attached Bunch of Flash (EBOF), and includes an Ethernet port 121 and a PCIe port 122. The Ethernet port 121 in each Ethernet circuit board 12 may be used to connect to at least some storage controllers 111 of the controller cluster 11. For example, Figure 1 In the example, each Ethernet port 121 is connected to all storage controllers 111 of the controller cluster 11. Based on the Ethernet port 121, the storage controller 111 and the Ethernet circuit board 12 can be connected via Ethernet. The PCIe port 122 can be used to connect the storage disk expansion card 14. Each storage disk expansion card 14 can be connected to a plurality of storage disks 13, and each storage disk 13 is connected to one of the Ethernet circuit boards 12 through the storage disk expansion card 14. In this way, the expansion of the storage disk 13 is achieved based on the Ethernet structure.

[0058] In some embodiments, Figure 1 In the storage expansion architecture shown, a switch is also included between the controller cluster 11 and the Ethernet circuit board 12. The storage controller 111 communicates with the Ethernet circuit board 12 via the Fabric-based NVMe (Non-Volatile Memory Express, non-volatile memory host controller interface specification) protocol, and the storage disk 13 communicates with the Ethernet circuit board 12 via the PCIe-based NVMe protocol. In simple terms, the Ethernet circuit board 12 can complete the conversion of the communication protocol, that is, convert the Fabric-based NVMe protocol to the PCIe-based NVMe protocol.

[0059] Based on the above description, when the controller cluster 11 does not have a brain split, different storage controllers 111 can communicate with each other and coordinate work. For example, based on the mutual communication and coordination between the storage controllers 111, it can be determined whether the data sent by the business server is written to the storage disk 13 by storage controller A, or written to the storage disk 13 by storage controller B, or whether storage controller A and storage controller B each complete a part of the data writing work. However, when the controller cluster 11 has a brain split, different storage controllers 111 independently perform data reading and writing operations, which may cause the risk of data conflict. For example, storage controller A and storage controller B may repeatedly write the same data to the storage disk 13.

[0060] In view of this, some storage disks 13 can be used as arbitration disks. When a brain split occurs in the controller cluster 11, different storage controllers 111 can determine which controller clusters 11 can continue to provide services and which controller clusters 11 need to exit services by writing cluster status events to the arbitration disk. Specifically, for any storage controller 111, before writing data to the arbitration disk, the storage controller 111 can issue a reservation instruction to request to reserve the arbitration disk. Only when the reservation is successful can data be written to the arbitration disk.

[0061] However, in Figure 1 In the storage expansion architecture shown, the storage controller 111 and the Ethernet circuit board 12 are in a many-to-one mapping relationship based on the NVMe protocol. Therefore, the Ethernet circuit board 12 can distinguish the reservation instructions issued by different storage controllers 111 based on the links between the Ethernet circuit board 12 and each storage controller 111. However, when the Ethernet circuit board 12 sends the reservation instruction to the storage disk 13 (i.e., the arbitration disk), the storage disk 13 cannot distinguish the storage controller 111 that issued the reservation instruction. For example Figure 1 In the example, it is assumed that storage disk m1 is the arbitration disk. Because Ethernet circuit board a is connected to storage controller A and storage controller B respectively, Ethernet circuit board a can distinguish the reservation instructions issued by storage controller A and storage controller B. However, when Ethernet circuit board a issues the reservation instruction to storage disk 13, for storage disk m1, storage disk m1 only knows that it is the reservation instruction received through Ethernet circuit board a, and does not know whether it is the reservation instruction issued by storage controller A or storage controller B, and further does not know whether to grant data write permission to storage controller A or storage controller B. In this way, the reservation operation of storage disk m1 cannot be completed.

[0062] In view of this, the present disclosure provides a storage disk reservation method, which can realize storage disk reservation in an Ethernet-based storage expansion architecture and reduce data conflicts. The reservation method can be applied to Figure 1Ethernet circuit board 12 in. Figure 2 , which is a flowchart of a reservation method provided in one embodiment of the present disclosure. Figure 2 In the reservation method, the steps include:

[0063] Step S201: receiving a reservation instruction sent by a first storage controller in the controller cluster 11, where the reservation instruction is used to request to perform a reservation operation on a target storage disk.

[0064] Specifically, the first storage controller may be one of the storage controllers 111 in the controller cluster 11. The first storage controller may send the reservation instruction to the Ethernet circuit board 12 connected to the target storage disk. Figure 1 In the example, when the storage controller A needs to perform a reservation operation on the storage disk m1, the reservation instruction may be sent to the Ethernet circuit board a. After receiving the reservation instruction, the Ethernet circuit board a may execute the reservation method disclosed in the present invention.

[0065] The target storage disk may be the storage disk 13 on which the reservation operation needs to be performed, such as Figure 1 The storage disk m1 in the reservation instruction. The reservation instruction may include a reservation field representing the reservation operation and a storage disk identifier of the target storage disk, such as acquire m1. Among them, acquire is the reservation field, and m1 is the storage disk identifier of the target storage disk. When the Ethernet circuit board 12 receives the instruction acquire m1 sent by the first storage controller, since the instruction includes acquire, it can be determined that the instruction is a reservation instruction. At the same time, based on the storage disk identifier in the reservation instruction, it can be determined that the target storage disk on which the reservation operation needs to be performed is the storage disk m1.

[0066] In this embodiment, after receiving the reservation instruction, the Ethernet circuit board 12 can determine the first storage controller that issues the reservation instruction according to the link that receives the reservation instruction. Figure 1 In the example, if Ethernet circuit board a receives a reservation instruction through link L1, it can be determined that storage controller A is the first storage controller; if Ethernet circuit board a receives a reservation instruction through link L2, it can be determined that storage controller B is the first storage controller.

[0067] Step S202: If the namespace of the target storage disk is in an unreserved state in the locally saved storage disk reservation record, a reservation instruction is sent to the target storage disk to instruct the target storage disk to reserve the namespace.

[0068] Specifically, the namespace can be understood as the accessible medium in the target storage disk, that is, the storage space provided by the target storage disk. Generally, as a disk object, the target storage disk may include other parts such as ports in addition to the namespace. However, the reservation operation for the target storage disk is actually to reserve the namespace corresponding to the target storage disk.

[0069] When the target storage disk is connected to the Ethernet circuit board 12, the Ethernet circuit board 12 can obtain the namespace of the target storage disk and write the namespace into the locally saved storage disk reservation record. In the storage disk reservation record, it can be maintained whether the namespace is in a reserved state. Specifically, in the case where the namespace is not reserved, if the Ethernet circuit board 12 receives a first reservation instruction for the target storage disk, the state of the namespace can be modified to a reserved state in the storage disk reservation record. After the state of the namespace is modified to a reserved state, if the Ethernet circuit board 12 receives a second reservation instruction for the target storage disk, at this time, by checking the locally maintained storage disk reservation record, it can be known that the namespace is in a reserved state, and therefore, a response indicating a reservation failure can be returned to the storage controller 111 that initiated the second reservation instruction.

[0070] Of course, it is understandable that after the storage controller 111 that sends the first reservation instruction has accessed the target storage disk, a release instruction can be sent to the Ethernet circuit board 12. The release instruction may include a release field that represents the release operation and a storage disk identifier of the target storage disk, such as release m1. Among them, release is the release field, and m1 is the storage disk identifier of the target storage disk. When the Ethernet circuit board 12 receives the instruction release m1 sent by the storage controller 111, since the instruction includes release, it can be determined that the instruction is a release instruction. At the same time, based on the storage disk identifier in the release instruction, it can be determined that the target storage disk on which the release operation needs to be performed is storage disk m1. In this way, the state of the namespace can be modified to an unreserved state in the storage disk reservation record.

[0071] Based on the above description of the storage disk reservation record, after the Ethernet circuit board 12 receives the reservation instruction sent by the first storage controller, if the namespace of the target storage disk is in an unreserved state in the local storage disk reservation record, the reservation instruction can be sent to the target storage disk to indicate that the target storage disk reserves the namespace. In the embodiment shown in the present disclosure, the first storage controller that sends the reservation instruction can be saved and maintained in the Ethernet circuit board 12. When reserving the namespace, the target storage disk can directly execute the namespace reservation operation without knowing which specific controller is the first storage controller that sends the reservation instruction.

[0072] Step S203, if the target storage disk reserves the namespace successfully, the first storage controller is associated with the target storage disk in the storage disk reservation record to indicate that the namespace of the target storage disk is reserved by the first storage controller, and a reservation success response is returned to the first storage controller.

[0073] Specifically, if the target storage disk successfully reserves the namespace, the target storage disk may return a success response to the Ethernet circuit board 12. If a successful response is received, the Ethernet circuit board 12 may associate the first storage controller with the target storage disk in the storage disk reservation record to indicate that the namespace of the target storage disk is reserved by the first storage controller.

[0074] In the embodiment shown in the present disclosure, when the target storage disk has an associated storage controller, it can be indicated that the target storage disk is in a reserved state; when the target storage disk does not have an associated storage controller, it can be indicated that the target storage is in an unreserved state. That is, by determining whether the target storage disk has an associated storage controller, it can be determined whether the namespace of the target storage disk is in a reserved state.

[0075] Furthermore, when the Ethernet circuit board 12 receives an access request initiated by a storage controller to a target storage disk, it can determine whether the storage controller that initiates the access request is the storage controller associated with the target storage disk in the storage disk reserved record. If so, the access is released; if not, the access request initiated by the storage controller to the target storage disk is rejected.

[0076] In summary, in the technical solutions of some embodiments of the present disclosure, a storage disk reservation record is set in the Ethernet circuit board 12, and the storage disk reservation record is used to record whether the storage disk 13 connected to the Ethernet circuit board 12 is in a reserved state. In this way, when the Ethernet circuit board 12 receives a reservation instruction for the target storage disk sent by the first storage controller in the controller cluster, it can be determined in the storage disk reservation record whether the namespace of the target storage disk is in a reserved state, and when the namespace is in an unreserved state, the reservation instruction is sent to the target storage disk to indicate that the target storage disk reserves the namespace. And, in the case where the target storage disk reserves the namespace successfully, the namespace of the target storage disk is set to be reserved by the first storage controller in the storage disk reservation record. In this way, the Ethernet circuit board 12 can refuse other storage controllers other than the first storage controller to initiate a reservation operation for the target storage disk based on the storage disk reservation record. That is, in the scheme disclosed in the present invention, by setting the control logic corresponding to the reservation method in the Ethernet circuit board 12, it is possible to implement the reservation operation initiated by each storage controller for the target storage disk when the target storage disk cannot distinguish between the various storage controllers 111, thereby greatly reducing data conflicts.

[0077] In some embodiments, Figure 1 The method shown may also include: if the namespace is in a reserved state in the locally saved storage disk reservation record, terminating the process of sending the reservation instruction to the target storage disk, and returning a first response indicating reservation failure to the first storage controller.

[0078] In this way, reservation failure caused by multiple storage controllers initiating reservation operations on the target storage disk at the same time is avoided.

[0079] In some embodiments, after returning the first response indicating the reservation failure to the first storage controller, a reservation instruction resent by the first storage controller may be received, and based on the storage disk reservation record, it may be determined whether the namespace of the target storage disk is in an unreserved state. If the namespace is already in an unreserved state at this time, the namespace may be reserved for the first storage controller; if the namespace is still in a reserved state at this time, the first response indicating the reservation failure may continue to be returned to the first storage controller.

[0080] Furthermore, considering that the duration of each storage controller 111 accessing the target storage disk each time may have a rough duration range, such as a maximum access duration of 3 milliseconds, if the duration of the storage controller 111 reserving the target storage disk exceeds a duration threshold (such as 3 milliseconds) and no release instruction for the target storage disk has been initiated, it can be considered that the storage controller 111 is abnormal. In this case, the target storage disk can be forcibly released to facilitate other storage controllers 111 to reserve the target storage disk.

[0081] Based on the above description, in some embodiments, after returning the first response indicating reservation failure to the first storage controller, if the association duration between the first storage controller and the target storage disk in the storage disk reservation record exceeds the duration threshold, the first storage controller may be disassociated from the target storage disk to forcibly release the target storage disk. In this way, the problem of other storage controllers 111 being unable to reserve the target storage disk due to the abnormality of the first storage controller is avoided.

[0082] Further, see Figure 3 , which is a schematic diagram of the connection between the target storage disk and the Ethernet circuit board 12 provided in one embodiment of the present disclosure. Figure 3In the embodiment, the target storage disk can be connected to multiple Ethernet circuit boards 12. That is, each storage controller 111 can issue a reservation instruction for the target storage disk through Ethernet circuit board a or through Ethernet circuit board b. The reservation method disclosed in the present invention can be applied to the first Ethernet circuit board to which the target storage disk is connected and which receives the reservation instruction. For example, if Ethernet circuit board a receives the reservation instruction, Ethernet circuit board a can act as the first Ethernet circuit board and execute the reservation method; if Ethernet circuit board b receives the reservation instruction, Ethernet circuit board b can act as the first Ethernet circuit board and execute the reservation method.

[0083] Among the multiple Ethernet circuit boards 12 connected to the target storage disk, each Ethernet circuit board 12 can maintain a storage disk reservation record locally. For any Ethernet circuit board 12, when the Ethernet circuit board 12 executes the reservation method, it is based on the storage disk reservation record maintained locally by the Ethernet circuit board 12 to determine whether the target storage disk is in a reserved state, and when the namespace is successfully reserved for the target storage disk, the storage disk reservation record maintained locally by the Ethernet circuit board 12 is updated. In other words, different Ethernet circuit boards 12 maintain their own storage disk reservation records independently of each other. The problem is that when one Ethernet circuit board 12 determines that the namespace of the target storage disk is in an unreserved state based on the storage disk reservation record maintained locally, the namespace may be in a reserved state in the storage disk reservation record maintained locally by another Ethernet circuit board 12. For example, the storage controller B first sends a reservation instruction for the target storage disk through the Ethernet circuit board b, and the namespace is successfully reserved. At this time, in the storage disk reservation record maintained locally by the Ethernet circuit board b, the namespace of the target storage disk is in a reserved state. In the case where storage controller B successfully reserves the namespace, if storage controller A issues a reservation instruction for the target storage disk through Ethernet circuit board a, then, in the storage disk reservation record maintained locally by Ethernet circuit board a, since the namespace of the target storage disk is in an unreserved state, Ethernet circuit board a will send the reservation instruction issued by storage controller A to the target storage disk to instruct the target storage disk to reserve the namespace. However, since the namespace of the target storage disk is actually in a reserved state, the target storage disk can return a response to Ethernet circuit board a indicating that the namespace reservation failed.

[0084] based on Figure 3 In the following scheme description, Ethernet circuit board a is described as the first Ethernet circuit board.

[0085] Specifically, based on Figure 3If the target storage disk fails to reserve the namespace, Ethernet circuit board a can determine that the namespace is reserved by the second Ethernet circuit board a connected to the second storage controller in the controller cluster 11 through the target storage disk. In this case, Ethernet circuit board a can return a second response indicating the reservation failure to the first storage controller.

[0086] In this way, the reservation failure problem caused by different storage controllers reserving target storage disks through different Ethernet circuit boards 12 can be avoided.

[0087] In some embodiments, after the Ethernet circuit board a returns the second response to the first storage controller, the method of the present disclosure may further include:

[0088] The Ethernet circuit board a receives the reservation instruction resent by the first storage controller, and sends the reservation instruction to the target storage disk to re-instruct the target storage disk to reserve a namespace.

[0089] Specifically, the first storage controller may resend a reservation instruction to the previous Ethernet circuit board 12 at a preset time interval (e.g., 1 millisecond) to try to reserve the namespace of the target storage disk. The previous Ethernet circuit board 12 refers to the Ethernet circuit board 12 that returns the second response to the first storage controller. For example, the first storage controller sends a reservation instruction to Ethernet circuit board a, and Ethernet circuit board a returns the second response to the first storage controller. Then, after receiving the second response, the first storage controller may resend a reservation instruction to Ethernet circuit board a at a preset time interval.

[0090] In this way, by trying to resend the instruction, a namespace can be reserved for the first storage controller in time after the namespace of the target storage disk is released.

[0091] In some embodiments, after the Ethernet circuit board a resends the reservation instruction to the target storage disk, the method of the present disclosure may further include:

[0092] If the target storage disk reserves the namespace successfully based on the resent reservation instruction, Ethernet circuit board a can associate the first storage controller with the target storage disk in the local storage disk reservation record and return a reservation success response to the first storage controller.

[0093] In this way, the namespace is reserved for the first storage controller in a timely manner.

[0094] In some embodiments, after the first storage controller resends the reservation instruction a preset number of times, if the namespace is not successfully reserved, the method of the present disclosure may further include:

[0095] The Ethernet circuit board a receives the preemption instruction sent by the first storage controller, and sends the preemption instruction to the target storage disk to instruct the target storage disk to preempt the namespace for the first storage controller;

[0096] If the namespace is seized successfully, Ethernet circuit board a can associate the first storage controller with the target storage disk in the local storage disk reservation record, and return a successful seizure response to the first storage controller.

[0097] Specifically, after the first storage controller resends the reservation instruction a preset number of times, if the namespace is not successfully reserved, it may indicate that the above-mentioned second storage controller has an abnormality and cannot release the namespace of the target storage disk in time. In this case, the first storage controller may send a preemption instruction to the Ethernet circuit board a to preempt the namespace. The mandatory instruction may include a preemption field representing the preemption operation and a storage disk identifier of the target storage disk, for example, preempt m1. Among them, preempt is the preemption field, and m1 is the storage disk identifier of the target storage disk. When the Ethernet circuit board 12 receives the instruction preempt m1 sent by the first storage controller, since the instruction includes preempt, it can be determined that the instruction is a preemption instruction. At the same time, based on the storage disk identifier in the reservation instruction, it can be determined that the target storage disk on which the preemption operation needs to be performed is storage disk m1. In this way, the Ethernet circuit board a can send the preemption instruction to the target storage disk.

[0098] Under normal circumstances, after receiving the preemption instruction, the target storage disk can bind the namespace to Ethernet circuit board a and release the binding relationship with Ethernet circuit board b. At the same time, the target storage disk can report to Ethernet circuit board b the event indicating that the namespace is preempted by the first storage controller, so as to trigger Ethernet circuit board b to set the state of the namespace to an unreserved state in the storage disk reservation record maintained locally.

[0099] Similarly, in some embodiments, after the Ethernet circuit board a successfully reserves a namespace for the first storage controller, the method of the present disclosure may further include:

[0100] If Ethernet circuit board a receives an event reported by the target storage disk indicating that the namespace is preempted by a storage controller other than the first storage controller, the first storage controller is disassociated from the target storage disk in the local storage disk reservation record to indicate that the namespace is released by the first storage controller. This scenario is when an abnormality occurs in the first storage controller, the duration of the namespace reserved by the first storage controller exceeds the duration threshold, and therefore, the reserved namespace is preempted by another storage controller through Ethernet circuit board b. Through this preemption mechanism, it is possible to avoid affecting the reserved namespace of other storage controllers when the first storage controller is abnormal, and the reliability is high.

[0101] In some embodiments, after the first storage controller completes accessing the namespace, the method of the present disclosure may further include:

[0102] A release instruction sent by the first storage controller is received, and the first storage controller is disassociated from the target storage disk in the storage disk reservation record to indicate that the namespace is released by the first storage controller.

[0103] In this way, the namespace can be released in time after the first storage controller finishes using the target storage disk.

[0104] In some embodiments, before receiving the reservation instruction, the method of the present disclosure may further include:

[0105] receiving a registration instruction sent by the first storage controller, where the registration instruction is used to specify a designated storage disk to which the first storage controller is to be registered;

[0106] A registration instruction is sent to the designated storage disk to register the first storage controller to the designated storage.

[0107] Specifically, the registration instruction may include a registration field representing the registration operation and a storage disk identifier of the target storage disk, for example, register m1. Among them, register is the registration field, and m1 is the storage disk identifier of the target storage disk. When the Ethernet circuit board 12 receives the instruction register m1 sent by the first storage controller, since the instruction includes register, it can be determined that the instruction is a registration instruction. At the same time, based on the storage disk identifier in the reserved instruction, it can be determined that the target storage disk on which the registration operation needs to be performed is storage disk m1. In this way, the Ethernet circuit board a can send the registration instruction to the target storage disk.

[0108] This registration mechanism can improve system security.

[0109] In some embodiments, after receiving the reservation instruction, the method of the present disclosure may further include:

[0110] Determining whether the first storage controller is registered in the target storage disk;

[0111] If not, returning a third response indicating reservation failure to the first storage controller;

[0112] If yes, perform a reservation operation on the target storage disk.

[0113] In this way, an unregistered storage controller is prevented from using the target storage disk.

[0114] In some embodiments, the registration instruction for registering the first storage controller to the target storage disk also includes first authentication information for authenticating the first storage controller, and the reservation instruction sent by the first storage controller also includes second authentication information for authenticating the first storage controller. After the registration is successful, the Ethernet circuit board 12 can save the first authentication information. After receiving the reservation instruction sent by the first storage controller, the method of the present disclosure can also include:

[0115] It is determined whether the first authentication information and the second authentication information are the same. If they are the same, a reservation operation is performed on the target storage disk. If they are not the same, a fourth response indicating a reservation failure is returned to the first storage controller.

[0116] In this way, the system security is guaranteed.

[0117] In some embodiments, considering that in a system based on the NVMe protocol, only storage controllers 111 with the same authentication information can preempt each other's namespace, that is, if the authentication information is different, the preemption may fail. Therefore, in a controller cluster, the authentication information used to authenticate at least part of the storage controllers can be the same, so as to ensure that different storage controllers 111 in the same cluster can preempt each other's namespace.

[0118] This completes the description of the method disclosed herein.

[0119] Combined with reference Figure 4 , is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. The electronic device includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the above method is implemented.

[0120] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0121] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.

[0122] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor 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.

[0123] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above method is implemented.

[0124] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above method is implemented.

[0125] One embodiment of the present disclosure further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method as described above is implemented.

[0126] Although the implementation method of the present disclosure has been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for reserving a storage disk, characterized in that: The storage disk is connected to an Ethernet circuit board, the Ethernet circuit board is connected to multiple storage controllers in a controller cluster, and the method is applied to the Ethernet circuit board; the method includes: receiving a reservation instruction sent by a first storage controller in the controller cluster, wherein the reservation instruction is used to request to perform a reservation operation on a target storage disk; If the namespace of the target storage disk is in an unreserved state in the locally saved storage disk reservation record, sending the reservation instruction to the target storage disk to instruct the target storage disk to reserve the namespace; If the target storage disk successfully reserves the namespace, then in the storage disk reservation record, the first storage controller is associated with the target storage disk to indicate that the namespace in the target storage disk is reserved by the first storage controller, and a reservation success response is returned to the first storage controller; If the namespace is in a reserved state in the locally saved storage disk reservation record, the process of sending the reservation instruction to the target storage disk is terminated, and a first response indicating reservation failure is returned to the first storage controller.

2. The method according to claim 1, characterized in that The target storage disk is connected to a plurality of the Ethernet circuit boards, and the method is applied to the first Ethernet circuit board to which the target storage disk is connected and which receives the reservation instruction; the method further comprises: If the target storage disk fails to reserve the namespace, it is determined that the namespace is reserved by a second storage controller in the controller cluster through a second Ethernet circuit board connected to the target storage disk, and a second response indicating the reservation failure is returned to the first storage controller.

3. The method according to claim 2, characterized in that After returning the second response to the first storage controller, the method further includes: The reservation instruction resent by the first storage controller is received, and the reservation instruction is sent to the target storage disk to re-instruct the target storage disk to reserve the namespace.

4. The method according to claim 3, characterized in that After resending the reservation instruction to the target storage disk, the method further includes: If the target storage disk successfully reserves the namespace based on the resent reservation instruction, the first storage controller is associated with the target storage disk in the local storage disk reservation record, and a reservation success response is returned to the first storage controller.

5. The method according to claim 3, characterized in that After the first storage controller resends the reservation instruction a preset number of times, if the namespace is not successfully reserved, the method further includes: receiving a preemption instruction sent by the first storage controller, and sending the preemption instruction to the target storage disk to instruct the target storage disk to preempt the namespace for the first storage controller; If the namespace is seized successfully, the first storage controller is associated with the target storage disk in the local storage disk reservation record, and a seizure success response is returned to the first storage controller.

6. The method according to claim 1 or 5, characterized in that After the first storage controller completes accessing the namespace, the method further includes: A release instruction sent by the first storage controller is received, and in the storage disk reservation record, the first storage controller is disassociated from the target storage disk to indicate that the namespace is released by the first storage controller.

7. The method according to claim 1 or 5, characterized in that After successfully reserving the namespace for the first storage controller, the method further includes: If an event is received from the target storage disk indicating that the namespace is preempted by a storage controller other than the first storage controller, the first storage controller is disassociated from the target storage disk in the local storage disk reservation record to indicate that the namespace is released by the first storage controller.

8. The method according to claim 1, characterized in that Before receiving the reservation instruction, the method further includes: receiving a registration instruction sent by the first storage controller, wherein the registration instruction is used to specify a designated storage disk to which the first storage controller is to be registered; The registration instruction is sent to the designated storage disk to register the first storage controller with the designated storage.

9. The method according to claim 8, characterized in that After receiving the reservation instruction, the method further includes: Determine whether the first storage controller is registered with the target storage disk; If not, returning a third response indicating reservation failure to the first storage controller; If yes, a reservation operation is performed on the target storage disk.

10. The method according to claim 8, characterized in that The registration instruction for registering the first storage controller to the target storage disk further includes first authentication information for authenticating the first storage controller, and the reservation instruction sent by the first storage controller further includes second authentication information for authenticating the first storage controller; After receiving the reservation instruction sent by the first storage controller, the method further includes: Determine whether the first authentication information and the second authentication information are the same; if they are the same, perform a reservation operation on the target storage disk; if they are not the same, return a fourth response indicating a reservation failure to the first storage controller.

11. The method according to claim 10, characterized in that In the controller cluster, authentication information used to authenticate at least some of the storage controllers is the same.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

13. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 11 is implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Data processing method and related storage equipment

    CN106484327A

  • Memory disk arbitration method and device, equipment and storage medium

    CN117591034A