Locking recovery method, storage server, client, device and system

By establishing a direct link between the client and multiple storage servers, and using multiple storage servers to send lock recovery requests, the lock recovery problem when the link is blocked is solved, and the system reliability and data consistency are improved.

WO2024240034A1PCT designated stage expired Publication Date: 2024-11-28HUAWEI TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/093498
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-05
Filing Date
2024-05-15
Publication Date
2024-11-28

AI Technical Summary

Technical Problem

When the link between the client and multiple storage servers is not connected, how to achieve lock recovery, avoid data inconsistency, and improve system reliability.

Method used

By establishing a direct link between the client and multiple storage servers, the lock recovery request is sent using the link between any storage server and the client of any of the multiple storage servers, ensuring the successful sending of the lock recovery request and avoiding multiple processes Data inconsistency caused by accessing target data.

Benefits of technology

Improves the success rate of lock recovery and system reliability, ensuring that the target data is relocked after the server restarts, avoiding the problem of data inconsistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024093498_28112024_PF_FP_ABST
    Figure CN2024093498_28112024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are a locking recovery method, a storage server, a client, a device and a system, relating to the field of computers. The method comprises: according to a first locking request sent by a client, a first storage server locking target data; after the first server restarts, sending a locking recovery request to the client via a link between any server among multiple servers and the client, so as to instruct the client to recover locking for the first server; and then, receiving a second locking request sent by the client, so as to re-lock target data indicated by the second locking request. Thus, the locking recovery request is sent via a link between any server among multiple servers and the client, such that expanding available channels for sending locking recovery requests can increase the probability of successfully sending the locking recovery requests, so as to ensure successful locking recovery, avoiding the problem of data inconsistency caused by multiple processes accessing target data, and improving the system reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Lock recovery method, storage server, client, device and system

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on May 19, 2023, with application number 202310575675.8 and application name “A lock failure recovery method”. This application also claims priority to the Chinese patent application filed with the State Intellectual Property Office on July 5, 2023, with application number 202310820049.0 and application name “Lock recovery method, storage server, client, device and system”. All of these contents are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computers, and in particular to a lock recovery method, storage server, client, device, and system. Background Art

[0003] Currently, clients can mount shared files on storage servers based on a network file system and access shared files on storage servers remotely over the network. Data is transmitted between clients and multiple storage servers over multiple links, increasing the utilization of network resources by increasing concurrency. To prevent different processes from accessing target data in a shared file simultaneously, which could lead to data inconsistencies, the target data accessed in the shared file is locked. After the server is restarted, the target data needs to be locked again. Therefore, when the link between the client and the server is disconnected, how to recover the lock is an urgent problem that needs to be solved.

[0004] Summary of the Invention

[0005] The present application provides a lock recovery method, storage server, client, device and system, thereby realizing lock recovery in a scenario where the link between the client and the storage server is disconnected, avoiding data inconsistency problems and improving system reliability.

[0006] In a first aspect, a lock recovery method is provided. A plurality of storage servers each establish a direct link with a client, wherein the plurality of storage servers include a first storage server. The method comprises: upon receiving a first lock request from the client, the first storage server locks the target data indicated by the first lock request. After the first storage server is restarted, a lock recovery request is sent to the client via a link between any one of the plurality of storage servers and the client, the lock recovery request being used to instruct the client to restore the lock on the first storage server. Furthermore, upon receiving a second lock request from the client, the target data indicated by the second lock request is re-locked.

[0007] In this way, compared to the storage server sending a lock recovery request based on a specific link, when the specific link fails, the lock recovery request cannot be sent, resulting in a lock recovery failure. The solution provided by the present application sends a lock recovery request through the link between any one of the multiple storage servers and the client when the link established between the client and any one of the multiple storage servers is unobstructed. Therefore, by expanding the available channels for sending lock recovery requests, the success rate of sending lock recovery requests is increased, ensuring successful lock recovery. In addition, since different clients or different processes in the client can access the target data in the storage server, data inconsistency may occur when different clients or different processes in the client compete to access the target data. By locking the target data, the problem of data inconsistency caused by competing access to the target data is avoided. Therefore, after the server is restarted, the target data needs to be locked again to ensure that the lock recovery request is sent successfully. The successful lock recovery avoids the problem of data inconsistency caused by multiple processes accessing the target data, thereby improving the reliability of the system.

[0008] In one possible implementation, a lock recovery request is sent to the client through a link between any one of the multiple storage servers and the client, including: sending a lock recovery request to the client through a link between any one of the multiple storage servers except the first storage server and the client.

[0009] For example, when a first link between a first storage server and a client is abnormal, a lock recovery request is sent to the client via a second link between a second storage server other than the first storage server among the multiple storage servers and the client.

[0010] Compared to sending a lock recovery request based solely on the link between the restarted storage server and the client, the lock recovery request fails to be sent due to link anomalies, and lock recovery cannot be achieved. The solution provided by this application is to send a lock recovery request through the link between any storage server other than the first storage server and the client among multiple storage servers until the request is successfully sent, thereby ensuring successful lock recovery, improving lock recovery reliability, avoiding data inconsistency caused by multiple processes accessing target data, and improving system reliability.

[0011] In another possible implementation, sending the lock recovery request to the client via a link between any storage server among the multiple storage servers other than the first storage server and the client includes: sending the lock recovery request to any storage server among the multiple storage servers other than the first storage server, and then sending the lock recovery request to the client via a link between any storage server among the multiple storage servers other than the first storage server and the client. Thus, any storage server can send the lock recovery request to the client.

[0012] In another possible implementation, sending a lock recovery request to the client via a link between any one of the multiple storage servers and the client includes sending a lock recovery request to the client via a link between a first storage server among the multiple storage servers and the client.

[0013] For example, when a first link between a first storage server and a client is normal, the link between the first storage server and the client among the multiple storage servers sends a lock recovery request to the client.

[0014] Thus, in the scenario where multiple storage servers are connected to the client, that is, the client mounts multiple storage servers, a lock recovery request is sent to ensure successful lock recovery.

[0015] In another possible implementation, the first storage server persistently stores the addresses of multiple storage servers. Therefore, if the link between the first storage server and the client is disconnected, any storage server other than the first storage server is selected from the multiple storage servers, and a lock recovery request is sent to the client via the link between the client and any storage server other than the first storage server.

[0016] In another possible implementation, the first storage server stores locking information of multiple storage servers, and the locking information of the multiple storage servers includes the locking information of the target data in the first storage server, so that the first storage server can manage the locking information.

[0017] In another possible implementation, the second lock request is used to instruct the resumption of the lock on the target data performed according to the first lock request. It is understandable that the first lock request and the second lock request both contain the same content, and the second lock request is a retransmission message of the first lock request. For example, the first lock request and the second lock request both contain the lock information of the target data.

[0018] In another possible implementation, the addresses of multiple storage servers belong to the same mount point, so that the same service can be deployed on one mount point, while different services can be isolated using different mount points to avoid mutual interference.

[0019] In another possible implementation, receiving the first locking request sent by the client includes: receiving the first locking request through a link between any one of the plurality of storage servers and the client.

[0020] In another possible implementation, receiving the first locking request sent by the client includes: receiving the first locking request through a link between the first storage server and the client.

[0021] In another possible implementation, receiving the first locking request sent by the client includes: receiving the first locking request through a link between a designated storage server among the plurality of storage servers and the client.

[0022] Optionally, the first storage server may receive the second locking request in a manner similar to that of receiving the first locking request.

[0023] On the second aspect, a lock recovery method is provided, in which a client mounts multiple storage servers, and the multiple storage servers include a first storage server. The method includes: after the client sends a first lock request to the first storage server, the client receives a lock recovery request through a link between any one of the multiple storage servers and the client, and sends a second lock request to the first storage server. The first lock request is used to indicate that the target data belonging to the first storage server is locked. The lock recovery request is used to instruct the client to restore the lock on the target data belonging to the first storage server. The second lock request is used to indicate that the target data belonging to the first storage server is re-locked.

[0024] In this way, compared to a client receiving a lock recovery request based on a specific link, when that specific link fails, the lock recovery request cannot be received, resulting in a lock recovery failure. The solution provided by this application receives the lock recovery request through the link between any of the multiple storage servers and the client, provided that the link established between the client and any of the multiple storage servers is unobstructed. This increases the probability of successfully receiving the lock recovery request by expanding the available channels for receiving lock recovery requests, ensuring a successful lock recovery. Relocking the target data avoids data inconsistencies caused by multiple processes accessing the target data, thereby improving system reliability.

[0025] In one possible implementation, receiving the lock recovery request through a link between any one of the multiple storage servers and the client includes: receiving the lock recovery request through a link between any one of the multiple storage servers except the first storage server and the client.

[0026] Compared to receiving a lock recovery request based solely on the link between the restarted storage server and the client, where the lock recovery request fails to be received due to a link anomaly, and lock recovery cannot be achieved, the solution provided by this application is to receive a lock recovery request through a link between any storage server other than the first storage server and the client among multiple storage servers until the request is successfully received, thereby ensuring successful lock recovery, improving lock recovery reliability, avoiding data inconsistency caused by multiple processes accessing target data, and improving system reliability.

[0027] In another possible implementation, receiving the lock recovery request through a link between any one of the multiple storage servers and the client includes: receiving the lock recovery request through a link between a first storage server among the multiple storage servers and the client.

[0028] Thus, in a scenario where multiple storage servers are connected to the client, that is, the client mounts multiple storage servers, a lock recovery request can be received to ensure successful lock recovery.

[0029] In another possible implementation, sending the second lock request to the first storage server includes: after the address of the first storage server in the lock recovery request is successfully verified, sending the second lock request to the first storage server. Thus, by verifying the legitimacy of the lock recovery, system security is improved.

[0030] In another possible implementation, the successful verification of the address of the first storage server in the lock recovery request includes: determining that the verification is successful when the addresses of multiple storage servers stored by the client include the address of the first storage server and the address of the storage server that sends the lock recovery request.

[0031] In another possible implementation, the client persistently stores the addresses of multiple storage servers to facilitate verification of lock recovery requests.

[0032] In another possible implementation, the client stores locking information of multiple storage servers, including the locking information of the target data in the first storage server, so that the client can manage the locking information and feed the locking information back to the storage server.

[0033] In another possible implementation, the addresses of multiple storage servers belong to the same mount point, so that the same service can be deployed on one mount point, while different services can be isolated using different mount points to avoid mutual interference.

[0034] Optionally, the addresses of multiple storage servers belonging to the same mount point can also be alternatively described as multiple storage servers belonging to the same mount point.

[0035] In another possible implementation, sending the first locking request to the first storage server includes: sending the first locking request through a link between any one of the plurality of storage servers and the client.

[0036] In another possible implementation, sending the first locking request to the first storage server includes: sending the first locking request through a link between the first storage server and the client.

[0037] In another possible implementation, sending the first locking request to the first storage server includes: sending the first locking request through a link between a designated storage server among the multiple storage servers and the client.

[0038] In a third aspect, a storage server is provided, wherein a plurality of storage servers respectively establish direct links with clients, and the plurality of storage servers include a first storage server. For example, the first storage server includes: a locking module for locking the target data indicated by the first locking request based on the first locking request of the client; a communication module for sending a lock recovery request to the client via the link between any one of the plurality of storage servers and the client after the first storage server is restarted, wherein the lock recovery request is used to instruct the client to restore the lock on the first storage server; the communication module is further used to receive a second locking request sent by the client; and the locking module is further used to lock the target data indicated by the second locking request.

[0039] In one possible implementation, when the communication module sends a lock recovery request to the client through a link between any one of the multiple storage servers and the client, it is specifically used to: send a lock recovery request to the client through a link between any one of the multiple storage servers except the first storage server and the client.

[0040] In another possible implementation, when the communication module sends a lock recovery request to the client through a link between any one of the multiple storage servers except the first storage server and the client, it is specifically used to: send a lock recovery request to any one of the multiple storage servers except the first storage server.

[0041] In another possible implementation, when the communication module sends a lock recovery request to the client through a link between any one of the multiple storage servers and the client, it is specifically used to: send a lock recovery request to the client through a link between the first storage server among the multiple storage servers and the client.

[0042] In another possible implementation, the first storage server persistently stores addresses of multiple storage servers.

[0043] In another possible implementation, the first storage server stores locking information of multiple storage servers, where the locking information of the multiple storage servers includes the locking information of the target data in the first storage server.

[0044] In another possible implementation, the second lock request is used to instruct resumption of locking the target data performed according to the first lock request.

[0045] In another possible implementation, addresses of multiple storage servers belong to the same mount point.

[0046] In another possible implementation, receiving the first locking request sent by the client includes: receiving the first locking request through a link between any one of the plurality of storage servers and the client.

[0047] In another possible implementation, receiving the first locking request sent by the client includes: receiving the first locking request through a link between the first storage server and the client.

[0048] In another possible implementation, receiving the first locking request sent by the client includes: receiving the first locking request through a link between a designated storage server among the plurality of storage servers and the client.

[0049] In a fourth aspect, a client is provided, wherein the client mounts multiple storage servers, the multiple storage servers including a first storage server. The client includes: a communication module for sending a first lock request to the first storage server, the first lock request being used to instruct to lock target data belonging to the first storage server; the communication module is further used to receive a lock recovery request through a link between any one of the multiple storage servers and the client, the lock recovery request being used to instruct the client to restore locks on the target data belonging to the first storage server; and the communication module is further used to send a second lock request to the first storage server, the second lock request being used to instruct to lock the target data belonging to the first storage server.

[0050] In one possible implementation, when the communication module receives a lock recovery request through a link between any one of the multiple storage servers and the client, it is specifically used to: receive a lock recovery request through a link between any one of the multiple storage servers except the first storage server and the client.

[0051] In another possible implementation, when the communication module receives the lock recovery request through a link between any one of the multiple storage servers and the client, it is specifically used to: receive the lock recovery request through a link between a first storage server among the multiple storage servers and the client.

[0052] In another possible implementation, when the communication module sends the second locking request to the first storage server, it is specifically configured to: send the second locking request to the first storage server after the address of the first storage server in the lock recovery request is successfully verified.

[0053] In another possible implementation, the device further includes a locking module, which is configured to determine that the verification is successful when the addresses of multiple storage servers stored by the client include the address of the first storage server and the address of the storage server that sends the lock recovery request.

[0054] In another possible implementation, the client persistently stores addresses of multiple storage servers.

[0055] In another possible implementation, the client stores locking information of multiple storage servers, where the locking information of the multiple storage servers includes the locking information of the target data in the first storage server.

[0056] In another possible implementation, addresses of multiple storage servers belong to the same mount point.

[0057] In another possible implementation, when the communication module sends the first locking request to the first storage server, it is specifically configured to: send the first locking request through a link between any one of the plurality of storage servers and the client.

[0058] In another possible implementation, when the communication module sends the first locking request to the first storage server, it is specifically configured to: send the first locking request through a link between the first storage server and the client.

[0059] In another possible implementation, when the communication module sends the first locking request to the first storage server, it is specifically configured to: send the first locking request through a link between a designated storage server among the multiple storage servers and the client.

[0060] In a fifth aspect, a computer device is provided, which includes at least one processor and a memory, wherein the memory is used to store a set of computer instructions; when the processor executes the set of computer instructions as a storage server in the first aspect or any possible implementation of the first aspect, the operating steps of the lock recovery method in the first aspect or any possible implementation of the first aspect are executed; when the processor executes the set of computer instructions as a client in the second aspect or any possible implementation of the second aspect, the operating steps of the lock recovery method in the second aspect or any possible implementation of the second aspect are executed.

[0061] In a sixth aspect, a communication system is provided, comprising a client and multiple storage servers, wherein the client is connected to the multiple storage servers. The storage servers are configured to execute the steps of the lock recovery method according to the first aspect or any possible implementation of the first aspect. The client is configured to execute the steps of the lock recovery method according to the second aspect or any possible implementation of the second aspect.

[0062] In the seventh aspect, a computer-readable storage medium is provided, comprising: computer software instructions; when the computer software instructions are executed in a computer device, the computer device executes the operating steps of the method described in the first aspect or any possible implementation of the first aspect; or, executes the operating steps of the method described in the second aspect or any possible implementation of the second aspect.

[0063] In an eighth aspect, a computer program product is provided. When the computer program product runs on a computer, it enables the computer to execute the operating steps of the method described in the first aspect or any possible implementation of the first aspect; or, execute the operating steps of the method described in the second aspect or any possible implementation of the second aspect.

[0064] The technical effects brought about by any design method from the third aspect to the eighth aspect can be referred to the technical effects brought about by the first aspect to the second aspect or different design methods, and will not be repeated here.

[0065] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] FIG1 is a schematic diagram of a mounting method provided by the present application;

[0067] FIG2 is a schematic diagram of the architecture of a communication system provided by the present application;

[0068] FIG3 is a schematic diagram of an NFS architecture provided by this application;

[0069] FIG4 is a flow chart of a locking method provided by the present application;

[0070] FIG5 is a flow chart of a lock recovery method provided by the present application;

[0071] FIG6 is a schematic diagram of the structure of a storage server provided by the present application;

[0072] FIG7 is a schematic diagram of the structure of a client provided by this application;

[0073] FIG8 is a schematic structural diagram of a computer device provided in this application. DETAILED DESCRIPTION

[0074] To facilitate understanding, the main terms involved in this application are first explained.

[0075] The Network File System (NFS) is a file sharing protocol in a distributed file system. It enables computers running different operating systems (such as Linux, UNIX, and Windows) to share data over a network. Accessing files on remote computers on the network is like accessing files on a local computer, providing fast and reliable file sharing services. Specifically, NFS mounts the remote computer's file directory on the local computer's local directory, allowing access to the remote computer's files by accessing the local directory.

[0076] Mounting refers to connecting a directory on a remote computer to a subdirectory under the root directory of the local computer. Accessing the subdirectory on the local computer is equivalent to accessing the contents of the directory on the remote computer. The subdirectory under the root directory of the local computer can be an empty directory. The name of the subdirectory on the local computer can be the same as the name of the directory mounted on the remote computer. For example, as shown in (a) of Figure 1, the Linux system file directory, the root directory " / " includes subdirectories such as / bin, / home, / lib, and / usr. As shown in (b) of Figure 1, the USB flash drive file directory, the root directory "sdb1" of the USB flash drive includes subdirectories such as / a, / b, and / c. As shown in (c) of Figure 1, this is a schematic diagram of mounting a USB flash drive file directory to a Linux system file directory. Create an empty subdirectory under the root directory of the Linux system file directory, named / sdb1-U. / sdb1-U mounts the USB flash drive file directory. Accessing / sdb1-U is equivalent to accessing the contents of the USB flash drive file directory sdb1.

[0077] A mount point is the entry point for the Linux file system, similar to the C:, D:, and E: drive letters used to access different partitions in Windows. For example, mount points include / bin, / home, / lib, / usr, and / dev. / bin contains system commands and functions. / home represents the user's default directory. / lib contains library files and kernel information. / usr contains user-generated system commands and applications. / dev is the directory where device files are stored.

[0078] In Linux, software and hardware resources are recorded in the form of files, which can be shared in a multi-user environment. When multiple processes access a target file, they compete for the shared resources in the target file.

[0079] For example, suppose File 1 contains the remaining balance of an account. Processes A and B access File 1. Process A modifies the remaining balance in File 1 and writes the modified remaining balance (1) to File 1. Because Process B reads the remaining balance in File 1 but not the modified remaining balance (1), Process B modifies the remaining balance in File 1 and writes the modified remaining balance (2) to File 1. At this point, File 1 may contain the modified remaining balance (2) but not the modified remaining balance (1), resulting in data inconsistency.

[0080] In order to avoid data inconsistency caused by competition for shared resources, file locks are used to ensure the "serialization" of operations, that is, to overcome data inconsistency by locking files.

[0081] File locks are a mechanism used to resolve data inconsistencies caused by contention for shared resources. For example, a client accesses a server to read, modify, or write data to the server. The client requests that the server lock the target data. After the server locks the data, no other client is allowed to access the target data, thereby preventing data inconsistencies. Another example is when a client process accesses target data, no other process is allowed to access the target data. If the server restarts, the lock may be lost, and the server will request that the client relock the data.

[0082] The NFS described in this application can be designed based on a client / server (C / S) architecture. The client installs the NFS client software, the server installs the NFS server software, and the client mounts the file directory on the server, allowing the client to access the server's file system in different languages, operating systems, and folders. Optionally, the client can refer to a local computer or local device, or a local computer or local device. The server can refer to a remote computer or remote device. The client can also be called an NFS client. The server can also be called an NFS server.

[0083] In some embodiments, a client establishes at least one link with a server. Based on the at least one link between the client and the server, the client can remotely access the file system of the server over a network. A link refers to the physical line between two nodes. A link may also be referred to as a physical link or a communication link.

[0084] In other embodiments, the client establishes direct links with multiple servers respectively, accesses the file systems of multiple servers, and improves the utilization rate of network resources by increasing the number of concurrency. For example, the client divides the data to be written into multiple data blocks, and writes the multiple data blocks to multiple servers, thereby improving the utilization rate of network resources and the rate of data transmission. The addresses of multiple servers can be different. The addresses used by the client to connect to multiple servers can also be different. For example, the client includes multiple network cards, and the addresses of the multiple network cards are different. The client establishes direct links with multiple servers through different network cards. When a server establishes a direct link with the client, it means that the server can communicate with the client without forwarding through other servers. In other words, there can be network devices such as routers and switches between the server and the client, but no other servers are included. The client generally runs on a computing device, such as a mobile phone, a host, a laptop, etc.

[0085] Understandably, a client can establish direct links with at least two servers, accessing the file systems of at least two servers. Multiple clients can establish direct links with multiple servers, with each client establishing direct links with at least two servers. A server can also connect to at least two clients, allowing a single server to be mounted on multiple clients. Multiple servers can establish direct links or indirect connections. In other words, network devices such as routers and switches can be located between servers, establishing indirect connections between servers through these network devices.

[0086] In addition, in scenarios where a client establishes direct links with multiple servers, or where multiple clients can establish direct links with multiple servers, when a client accesses target data on a server, the client can instruct the server to lock the target data to prevent other clients from accessing the target data again. Alternatively, when a first process accesses target data on a server, the server locks the target data to prevent processes other than the first process (e.g., a second process) from accessing the target data again. The first process and the processes other than the first process can be processes run by the same client, or processes run by different clients.

[0087] In order to solve the problem of how to achieve lock recovery in a scenario where data is transmitted between a client and multiple servers based on multiple links and the link between the client and the server is disconnected, the present application provides a lock recovery method, that is, after the first server among multiple servers is restarted, a lock recovery request is sent to the client through the link between any one of the multiple servers and the client, so that the first server receives the lock request sent by the client and re-locks the server.

[0088] In this way, compared to the server sending a lock recovery request based on a specific link, when the specific link fails, the lock recovery request cannot be sent, resulting in a lock recovery failure. The solution provided by the present application sends a lock recovery request through the link between any of the multiple servers and the client when the link established between the client and any of the multiple servers is unobstructed. Therefore, by expanding the available channels for sending lock recovery requests, the success rate of sending lock recovery requests is increased, ensuring successful lock recovery. In addition, since different clients or different processes in the client can access the target data in the server, data inconsistency may occur when different clients or different processes in the client compete to access the target data. By locking the target data, the problem of data inconsistency caused by competing access to the target data is avoided. Therefore, after the server is restarted, the target data needs to be locked again to ensure that the lock recovery request is sent successfully. The successful lock recovery avoids the problem of data inconsistency caused by multiple processes accessing the target data, thereby improving the reliability of the system.

[0089] This application does not limit the type and function of the server. For example, server types include blade servers, tower servers, cabinet servers, and rack servers. In another example, the server may include a storage server with storage capabilities or a computing server with computing capabilities, where the computing server also has storage capabilities.

[0090] The following describes in detail the locking and lock recovery implementations provided by this application with reference to the accompanying drawings.

[0091] The solution provided in this application can be applied to communication systems such as cluster networks, super-node interconnected networks, etc. For example, high performance computing (HPC) networks or high availability (HA) networks.

[0092] For example, FIG2 is a schematic diagram of the architecture of a communication system provided by the present application. As shown in FIG2 , the communication system 200 includes a client 210 and multiple servers 220 .

[0093] The server 220 may be a computing node that provides computing functions, such as a controller of a storage array. A computing node may also be referred to as a computing server. Multiple servers that provide computing functions may constitute a computing cluster. For example, the server 220 may include computing units with computing capabilities, such as a central processing unit (CPU), a graphics processing unit (GPU), a data processing unit (DPU), a neural processing unit (NPU), and an embedded neural-network processing unit (NPU), to provide high-performance computing.

[0094] The server 220 may also be a storage node that provides storage functions, and the storage node may also be referred to as a storage server. Multiple servers that provide storage functions may constitute a storage cluster. For example, the server 220 may include one or more controllers, a network card, and multiple hard disks. The hard disk is used to store data. The hard disk may be a magnetic disk or other types of storage media, such as a solid-state drive or a shingled magnetic recording hard disk. The network card is used to communicate with the computing node or with the client 210. The controller is used to write data to the hard disk or read data from the hard disk according to the read / write data request sent by the computing node. During the process of reading and writing data, the controller needs to convert the address carried in the read / write data request into an address that the hard disk can recognize.

[0095] Figure 2 is only a schematic diagram. The embodiments of the present application do not limit the number of devices included in the communication system. For example, the communication system may include multiple clients. A client can connect to multiple servers and mount directories of different servers. Different clients establish connections with different servers and mount directories of different servers. The same server can also be mounted on different clients. Optionally, the communication system may also include other devices, such as network devices (such as switches and routers). Multiple servers are connected via network devices and transmit data via the network devices.

[0096] The client 210 communicates with multiple servers 220 via a network 230. The network 230 may be an intranet (eg, a local area network (LAN)) or the Internet.

[0097] In some embodiments, multiple servers 220 manage data based on a distributed file system 221 (e.g., NFS). For example, the client 210 and multiple servers 220 deploy the third version of the Network File System Version 3 (NFS V3). The client 210 mounts file directories from multiple servers 220, allowing the client 210 to access the file systems of multiple servers 220 in different languages, operating systems, and folders. The client accesses multiple servers through multiple links, improving the utilization of network resources and the data transmission rate by increasing the number of concurrency. For example, the client writes data to or reads data from multiple servers through multiple links. Among them, one mount point of the client can mount the directory of one server or the directories of multiple servers. The client can also mount the directories of multiple servers at multiple mount points. Thus, the same business can be deployed at one mount point, and different mount points can be used to isolate different businesses to avoid mutual interference.

[0098] In addition, when a client accesses multiple servers through multiple links, it can instruct the server to lock, thereby avoiding data inconsistency caused by competition for shared resources.

[0099] For example, Figure 3 is a schematic diagram of the NFS architecture provided by this application. As shown in Figure 3, the client includes an NSM module, an NLM module, and an NFS module. The server includes an NSM module, an NLM module, an NFS module, and an FS module, thereby enabling the client to remotely access files on the server and perform functions such as locking, unlocking, and restoring locks on the server files.

[0100] The NFS module of the client is used to provide functions such as mounting directories of multiple servers and performing file operations on the servers. For example, the file operations include at least one of creating, deleting, and querying files.

[0101] The Network Lock Manager (NLM) module on the client is used to provide functions such as locking, unlocking, and lock recovery for the server, as well as managing lock information in the form of a monitoring group.

[0102] The client's Network State Manager (NSM) module is used to manage monitoring groups and detect lock recovery events. For example, the monitoring group may include the address of the server that successfully locked the lock and the address of the client, such as the Internet Protocol (IP) address.

[0103] The NFS module of the server is used to provide NFS protocol services, such as file reading, writing, deleting, and querying functions.

[0104] The server's NLM module is used to provide locking services, supporting functions such as locking, unlocking, and lock recovery.

[0105] The server's NSM module manages listener groups. For example, after a lock is successfully acquired, the client's and server's addresses are persisted to the file system. After the server restarts, it retrieves the listener group containing the server's address and sends lock recovery requests to the client using the server's address in the listener group until the lock is successfully recovered.

[0106] The server's file system (FS) is used to store the server's locking information and, optionally, also stores the client's address and the server's address.

[0107] The server is also used to manage the server's address and query all monitoring groups in the same network segment based on the address.

[0108] Next, the locking phase and the lock recovery phase are described in detail with reference to the accompanying drawings.

[0109] FIG4 is a flowchart of a locking method provided by the present application. Assume that the client has established a connection (e.g., Transmission Control Protocol (TCP) or User Datagram Protocol (UDP)) with four servers (e.g., the first server to the fourth server), and the client has mounted the directories of the four servers. Here, the client accesses the first server as an example. The client may be the client shown in FIG2 . The server may be a storage server in the storage cluster described in FIG2 . As shown in FIG4 , the method includes the following steps.

[0110] Step 410: The client sends a first lock request to the first server.

[0111] The client may send a first locking request to the first server according to the routing strategy.

[0112] Strategy 1: The client sends a first lock request via the link between the server to be locked and the client. For example, the client instructs the first server to lock, and the client sends the first lock request via the link between the first server and the client.

[0113] In Strategy 2, the client sends a first lock request through a link between any one of the multiple servers connected to the client and the client. For example, the client randomly selects a second server from four servers and sends the first lock request through the link between the second server and the client. The second server forwards the first lock request to the first server. In another example, based on a load balancing strategy, the client selects a third server from four servers with a load below a threshold and sends the first lock request through the link between the third server and the client.

[0114] Strategy three, the client sends a first lock request through the link between the designated server and the client among multiple servers. For example, the designated server is the first server, the client instructs the first server to lock, and the client sends the first lock request through the link between the first server and the client; the client instructs the second server to lock, and the client sends a second lock request to the first server through the link between the first server and the client, and the first server forwards the second lock request to the second server. The first lock request is used to indicate locking the first data of the first server. The second lock request is used to indicate locking the second data of the second server. The target data described in this application can be the first data or the second data.

[0115] In some embodiments, the first lock request includes the starting address of the data, the length of the data, the ending address of the data (optional), and the lock type (read lock or write lock). For example, when the client reads data stored on the first server, the lock type may be a read lock. When the client modifies data stored on the first server or writes data to the first server, the lock type may be a write lock.

[0116] The first lock request may further include an address of the client and an address of the first server. The address of the client may refer to a source address of the first lock request, and the address of the first server may refer to a destination address of the first lock request.

[0117] Step 420: The client stores the first locking information.

[0118] The client stores the information included in the first lock request. For example, the client may store the first lock information in the client's memory. The first lock information includes the starting address of the data, the length of the data, the ending address of the data (optional), and the lock type (read lock or write lock).

[0119] In some embodiments, the client stores the locking relationship between the client and multiple servers (such as the address relationship between the client and the locked multiple servers), and the addresses of the multiple servers may belong to the same mount point. For example, the client generates a monitoring group based on the first server and the server that belongs to the same mount point as the first server. The monitoring group may include the address of the client, the address of the first server, and the address of the server that belongs to the same mount point as the first server. The address includes but is not limited to the IP address. For example, assuming that the client mounts the first server to the fourth server, the first server, the second server, the third server, and the fourth server belong to the same mount point, the monitoring group may include the address IP1 of the first server, the address IP2 of the second server, the address IP3 of the third server, and the address IP4 of the fourth server. For example, the monitoring group may include the association relationship between the client's address and the address IP1 of the first server, the association relationship between the client's address and the address IP2 of the second server, the association relationship between the client's address and the address IP3 of the third server, and the association relationship between the client's address and the address IP4 of the fourth server.

[0120] The client can persist the monitoring group, for example, by storing the monitoring group in a monitoring directory on the hard disk. The monitoring group file name can be group-n. For example, the file name of the first monitoring group can be group-1.

[0121] It should be noted that the addresses of the first server and the server that shares the same mount point with the first server can be in the same network segment or different network segments. The client can mount multiple servers in the same network segment or in different network segments. The client can mount multiple servers in the same network segment or in different network segments using the same mount point.

[0122] In addition, the client can store lock information in monitoring groups. For example, the client's memory stores the lock information of multiple servers in the monitoring group that belong to the same mount point.

[0123] Optionally, the client can store multiple monitoring groups and locking information of multiple monitoring groups. The addresses of servers included in different monitoring groups belong to different mount points. For example, the first server and the second server belong to the same mount point, and the first monitoring group includes the correspondence between the address of the client and the address of the first server, as well as the correspondence between the address of the client and the address of the second server. The locking information of the first monitoring group includes the locking information of the first server and the locking information of the second server. The third server and the fourth server belong to the same mount point, and the second monitoring group includes the correspondence between the address of the client and the address of the third server, as well as the correspondence between the address of the client and the address of the fourth server. The locking information of the second monitoring group includes the locking information of the third server and the locking information of the fourth server.

[0124] Optionally, after establishing a connection with the server, the client may mount the server's directory under the client's directory to create a monitoring group.

[0125] Optionally, after the client establishes a connection with the server, the server may send the monitoring group to the client, and the client may store the monitoring group fed back by the server.

[0126] Optionally, after establishing a connection with the server, the client may also divide servers belonging to the same network segment into a monitoring group according to the addresses of the servers, and store the monitoring group.

[0127] Step 430: The first server locks the first data indicated by the first lock request based on the first lock request of the client.

[0128] The first server may receive the first locking request through a link selected by the client according to the routing policy.

[0129] Strategy 1: The client sends a first lock request via a link between the server to be locked and the client. For example, the first server receives the first lock request via a link between the first server and the client.

[0130] In Strategy 2, the client sends a first lock request through a link between any one of the multiple servers connected to the client and the client. The first server receives the first lock request from any server selected by the client. For example, the first server receives the first lock request from the second server.

[0131] In Strategy 3, the client sends a first lock request via a link between a designated server among the multiple servers and the client. The first server receives the first lock request from the designated server. For example, the designated server is the first server, and the first server receives the first lock request via a link between the first server and the client.

[0132] The first server locks the first data based on the information included in the first lock request. For an explanation of the first lock request, refer to the explanation of step 410 above. Optionally, the first server may also send a response message to the client, indicating that the lock is successful.

[0133] In some embodiments, the first server stores the address relationship between the client and multiple servers, as well as the locking information of the first server. The addresses of multiple servers belong to the same mount point. For example, the first server can generate a monitoring group based on the first server and the servers that belong to the same mount point as the first server. The monitoring group may include the address of the client, the address of the first server, and the addresses of the servers that belong to the same mount point as the first server. The first server stores the locking information in the monitoring group, and the locking information of the monitoring group includes the locking information of the first server. Optionally, the first server can persist the monitoring group, for example, storing the monitoring group in a monitoring directory on the hard disk. The locking information of multiple servers in the monitoring group is stored in the memory of the first server.

[0134] Optionally, the first server can store multiple monitoring groups and locking information of multiple monitoring groups. For example, the first server persists the first monitoring group and the second monitoring group. The first monitoring group includes the correspondence between the client's address and the address of the first server, and the correspondence between the client's address and the address of the second server. The locking information of the first monitoring group includes the locking information of the first server and the locking information of the second server. The second monitoring group includes the correspondence between the client's address and the address of the third server, and the correspondence between the client's address and the address of the fourth server. The locking information of the second monitoring group includes the locking information of the third server and the locking information of the fourth server.

[0135] Thus, by locking the data accessed on the server, data inconsistencies caused by competition for shared resources are avoided. In addition, the client and server each store the address relationship between the client and the multiple locked servers, as well as the locking information, so that locks can be restored after the server is restarted.

[0136] After the server successfully locks the connection, due to reasons such as server failure, the server may need to request the client to relock the connection after the server restarts. For example, after the server restarts, the lock information stored in the memory is lost, and the client may need to be requested to relock the connection. Figure 5 is a flow chart of a lock recovery method provided by this application. The difference from Figure 4 is that after the client locks the first server, the first server restarts and requests the client to relock the connection. As shown in Figure 5, the method further includes the following steps.

[0137] Step 510: After the first server is restarted, the first server sends a lock recovery request to the client through a link between any one of the multiple servers and the client.

[0138] After the first server is restarted, since the locking information of the first server is lost, the client needs to request to re-lock the server and send a lock recovery request to the client.

[0139] In some embodiments, the first server sends a lock recovery request to the client via a link between the first server and the client. For example, when the link between the first server and the client is in a normal state, the first server sends the lock recovery request to the client via the link between the first server and the client. A normal link state may indicate that the link between the client and the server is unobstructed and that the client and the server can transmit data to each other.

[0140] In other embodiments, the first server sends a lock recovery request to the client via a link between any one of the multiple servers other than the first server and the client. For example, when the link between the first server and the client is in an abnormal state, the first server sends a lock recovery request to the client via a link between any one of the multiple servers other than the first server and the client. The abnormal state of the link may indicate that the link between the client and the server is faulty, disconnected, or unable to transmit data. The abnormal state of the link may be caused by a link failure or a server failure. For example, the causes of the failure include a failure of the transmission medium between the client and the server, a failure of the server's network card, a failure of the server's port, etc.

[0141] Alternatively, the first server may select any server other than the first server from the plurality of servers based on a routing strategy. For example, the first server may randomly select any server other than the first server from the plurality of servers. In another example, the first server may select a server other than the first server from the plurality of servers whose load is less than a threshold based on a load balancing strategy.

[0142] For example, the first server randomly selects a second server from four servers, forwards the lock recovery request to the second server, and sends the lock recovery request through the link between the second server and the client. In another example, based on a load balancing policy, the first server selects a third server from four servers with a load below a threshold, forwards the lock recovery request to the third server, and sends the lock recovery request through the link between the third server and the client.

[0143] Regarding the method of sending the lock recovery request, reference may be made to the description of the method for the first lock request in step 410 above.

[0144] The multiple servers include servers that belong to the same mounting point as the first server.

[0145] Optionally, the first server obtains a monitoring group. The monitoring group includes the address relationship between the client and multiple servers. For example, the monitoring group includes the client's address, the first server's address, and the addresses of servers that share the same mount point as the first server. The first server selects any server in the monitoring group other than the first server and sends a lock recovery request through the selected server. The lock recovery request includes the address of the server sending the lock recovery request, the client's address, and the address of the first server.

[0146] Assume that the first server selects a second server from multiple servers other than the first server and sends a lock recovery request to the client via the link between the second server and the client. That is, the first server sends the lock recovery request to the second server, and the second server sends the lock recovery request via the link between the second server and the client. The lock recovery request includes a source address, a destination address, and the address of the server performing the lock recovery. For example, the lock recovery request includes the address of the second server, the address of the client, and the address of the first server. The address of the second server is the source address of the lock recovery request. The address of the client is the destination address of the lock recovery request.

[0147] If the first server and the second server are in the same network segment, the first server can directly send the lock recovery request to the second server. If the first server and the second server are in different network segments, the first server can forward the lock recovery request through network equipment (such as switches and routers) and send the lock recovery request to the second server.

[0148] Understandably, the link used by the first server to send the lock recovery request to the client is an available link, which refers to a link in a normal state. Optionally, if sending the lock recovery request through the link between the server selected by the first server and the client fails, a new server is selected from the multiple servers and the lock recovery request is sent through the link between the newly selected server and the client until the request is successfully sent.

[0149] Step 520: The client receives a lock recovery request through a link between any one of the multiple servers and the client.

[0150] Because the first server sends the lock recovery request to the client via a link between any one of the multiple servers and the client, the client receives the lock recovery request via a link between any one of the multiple servers and the client. For example, the client receives the lock recovery request via a link between the first server among the multiple servers and the client. In another example, the client receives the lock recovery request via a link between any one of the multiple servers, other than the first server, and the client. For an explanation of the link between any one of the multiple servers and the client, please refer to the description of step 510 and will not be repeated here.

[0151] Step 530: The client sends a second lock request to the first server.

[0152] The client receives the lock recovery request through a link between any one of the multiple servers and the client, verifies the address of the first server in the lock recovery request, and upon successful verification, sends a second lock request to the first server. The second lock request includes the information included in the first lock request described in step 410. For example, the second lock request includes the starting address of the data in the first lock request, the data length, the ending address of the data (optional), and the lock type (read lock or write lock).

[0153] In some embodiments, the first server and the client store a listening group, which includes the address of the first server and the addresses of servers that belong to the same mount point as the first server. Since the server selected when the first server sends the lock recovery request belongs to the same mount point as the first server, when the listening group includes the address of the first server and the addresses of servers that belong to the same mount point as the first server, the verification is determined to be successful. For example, the first server selects any server from the listening group except the first server and sends a lock recovery request. The client obtains at least one listening group, at least one listening group including the source address of the lock recovery request, traverses each listening group, and determines whether the listening group includes the address of the first server. When the listening group includes the address of the first server that requires lock recovery, the verification is determined to be successful. Optionally, the client receives the lock recovery request through the link between the first server and the client, and the source address in the lock recovery request can be the address of the first server. Based on the address of the first server, the client obtains at least one listening group, the listening group including the address of the first server that requires lock recovery, and determines that the verification is successful.

[0154] For example, the client receives a lock recovery request through a link between the second server and the client, the lock recovery request including the address of the second server and the address of the first server. The client obtains a listening group including the address of the second server, determines that the listening group includes the address of the first server, and determines that the verification is successful.

[0155] The client may send a second locking request to the first server according to the routing strategy.

[0156] Strategy 1: The client sends a second lock request through the link between the server that needs to be locked and the client.

[0157] Strategy 2: The client sends a second lock request through a link between any one of the multiple servers connected to the client and the client.

[0158] Strategy three: the client sends a second lock request through a link between a designated server among multiple servers and the client.

[0159] Strategy 4: The client sends a second lock request via the link between the server that sent the lock recovery request and the client. For example, the client receives the lock recovery request via the link between the second server and the client, and the client sends a second lock request via the link between the client and the second server.

[0160] Regarding strategies 1 to 3 for sending the second lock request, reference may be made to the description of step 410 above.

[0161] Step 540: The first server receives the second lock request sent by the client.

[0162] The first server may receive the second lock request via the link selected by the client according to the routing strategy. The explanation of receiving the second lock request may refer to the explanation of receiving the first lock request in step 430 above.

[0163] Step 550: The first server locks the first data indicated by the second lock request.

[0164] It is understandable that the first lock request and the second lock request both contain the same content, and the second lock request is a retransmission message of the first lock request. The first server re-locks the first data based on the information included in the second lock request. That is, the first server re-locks the target data indicated by the first lock request based on the second lock request. The first server stores the address relationship between the client and the first server, as well as the locking information of the first server. Optionally, the first server updates the monitoring group and the locking information of the monitoring group, the monitoring group includes the address relationship between the client and the first server, and the locking information of the monitoring group includes the locking information of the first server.

[0165] This application monitors the lock recovery events sent by the server in the form of a monitoring group, and persists the name and address list of the monitoring group on the client's file system. After the server fails and restarts, the address of the client to be recovered and the address of the server are read from the file system, and then the addresses of all servers in the same network segment are searched on the system, and the lock recovery request is sent to the client through any of the servers in turn until it succeeds. When the client receives the lock recovery request from the server, it will obtain the server address from the link and match it with the persistent address list. If the match is successful, the lock recovery process will be entered. If the match fails, the request will be discarded.

[0166] In this way, when the link established between the client and multiple servers is unobstructed, a lock recovery request is sent through the link between any one of the multiple servers and the client, that is, by expanding the available channels for sending lock recovery requests, the success rate of sending lock recovery requests is increased, thereby ensuring successful lock recovery, avoiding data inconsistency problems caused by multiple processes accessing target data, and improving system reliability.

[0167] The server described in the above embodiment can be an independent physical device or a virtual device such as a virtual machine in a physical device, and this application does not limit this.

[0168] It is understandable that in order to implement the functions in the above embodiments, the client and server (such as a storage server) include hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.

[0169] In the above, in conjunction with Figures 1 to 5, the locking method and lock recovery method provided by the present application are described in detail. The following will be combined with Figures 6 to 7 to describe the device provided by the present application. These devices can be used to implement the functions of the client or the storage server in the above method embodiments, and thus can also achieve the beneficial effects of the above method embodiments. In this embodiment, the device can be a device as shown in Figure 2 or Figure 3, or it can be a module (such as a chip) applied to the server or a module (such as a chip) applied to the client.

[0170] As shown in Figure 6, the storage server 600 includes a communication module 610, a locking module 620, and a storage module 630. The storage server 600 is used to implement the functions of the server in the method embodiment shown in Figure 4 or Figure 5 above.

[0171] The communication module 610 is configured to send a lock recovery request to the client via a link between any one of the multiple servers and the client after the first server is restarted. The lock recovery request is configured to instruct the client to restore the lock on the first server. For example, the communication module 610 is configured to execute step 510 in FIG. 5 .

[0172] The locking module 620 is configured to lock the target data indicated by the first locking request based on the first locking request from the client. For example, the locking module 620 is configured to execute step 430 in FIG4 .

[0173] The communication module 610 is further configured to receive a second lock request sent by the client. For example, the communication module 610 is configured to execute step 540 in FIG5 .

[0174] The locking module 620 is further configured to lock the target data indicated by the second lock request. For example, the locking module 620 is configured to execute step 550 in FIG5 .

[0175] Optionally, the communication module 610 is specifically configured to send a lock recovery request to the client via a link between any one of the multiple servers except the first server and the client.

[0176] Optionally, the communication module 610 is specifically configured to send a lock recovery request to the client via a link between a first server among the multiple servers and the client.

[0177] The storage module 630 is used to store the address relationship and locking information of the client and the server, so that the client and the server can perform the lock recovery process.

[0178] As shown in Figure 7, the client 700 includes a communication module 710, a locking module 720, and a storage module 730. The client 700 is used to implement the functions of the client in the method embodiment shown in Figure 4 or Figure 5 above.

[0179] The communication module 710 is configured to send a first lock request to the first server, where the first lock request is used to instruct to lock the target data of the first server. For example, the communication module 710 is configured to execute step 410 in FIG4 .

[0180] The communication module 710 is further configured to receive a lock recovery request via a link between any one of the plurality of servers and the client, the lock recovery request being used to instruct the client to restore locking the first server. For example, the communication module 710 is configured to execute step 520 in FIG5 .

[0181] The communication module 710 is further configured to send a second lock request to the first server, where the second lock request is used to instruct to lock the target data of the first server. For example, the communication module 710 is configured to execute step 530 in FIG5 .

[0182] Optionally, the communication module 710 is specifically configured to receive a lock recovery request through a link between any one of the multiple servers except the first server and the client.

[0183] Optionally, the communication module 710 is specifically configured to receive a lock recovery request through a link between a first server among the multiple servers and the client.

[0184] The locking module 720 is configured to determine that the verification is successful when the addresses of the multiple servers stored in the client include the address of the first server and the address of the server that sends the lock recovery request.

[0185] The storage module 730 is used to store the address relationship and locking information of the client and the server, so that the client and the server can perform the lock recovery process.

[0186] It should be understood that the storage server 600 and the client 700 of the embodiment of the present application can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the above-mentioned PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. When the locking method shown in Figure 4 or the lock recovery method shown in Figure 5 is implemented by software, their respective modules can also be software modules, and the storage server 600 and the client 700 and their respective modules can also be software modules.

[0187] According to the embodiments of the present application, the storage server 600 and the client 700 may correspond to executing the methods described in the embodiments of the present application, and the above-mentioned and other operations and / or functions of the various units in the storage server 600 and the client 700 are respectively for implementing the corresponding processes of the various methods in Figure 4 or Figure 5. For the sake of brevity, they will not be repeated here.

[0188] FIG8 is a schematic diagram of the structure of a computer device 800 provided in this application. As shown in FIG8 , computer device 800 includes a processor 810, a bus 820, a memory 830, a communication interface 840, and a memory unit 850 (also referred to as a main memory unit). Processor 810, memory 830, memory unit 850, and communication interface 840 are connected via bus 820.

[0189] It should be understood that in this embodiment, the processor 810 may be a CPU, but may also be other general-purpose processors, digital signal processors (DSP), ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0190] The processor may also be a graphics processing unit (GPU), a neural network processing unit (NPU), a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the present application.

[0191] The communication interface 840 is used to implement communication between the computer device 800 and an external device or component. In the present application, when the computer device 800 is used to implement the function of the client shown in Figure 4, the communication interface 840 is used to send a lock request. When the computer device 800 is used to implement the function of the client shown in Figure 5, the communication interface 840 is used to obtain a lock recovery request so that the processor 810 can instruct the server to relock based on the lock recovery request. When the computer device 800 is used to implement the function of the server shown in Figure 4 or Figure 5, the communication interface 840 is used to obtain a lock request and send a lock recovery request so that the processor 810 can lock the server.

[0192] The bus 820 may include a path for transmitting information between the above-mentioned components (such as the processor 810, the memory unit 850, and the memory 830). In addition to the data bus, the bus 820 may also include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus 820 in the figure. The bus 820 may be a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 820 can be divided into an address bus, a data bus, a control bus, etc.

[0193] As an example, computer device 800 may include multiple processors. The processor may be a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions).

[0194] It is worth noting that FIG8 only takes the computer device 800 including one processor 810 and one memory 830 as an example. Here, the processor 810 and the memory 830 are respectively used to indicate a type of device or equipment. In a specific embodiment, the number of each type of device or equipment can be determined according to business requirements.

[0195] The memory unit 850 may be a volatile memory pool or a non-volatile memory pool, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). Memory unit 850 is used to store lock information, etc.

[0196] The memory 830 may correspond to a storage medium used to store information such as the address relationship between the client and the server in the above method embodiment, for example, a disk such as a mechanical hard disk or a solid-state drive.

[0197] The computer device 800 may be a general-purpose device or a dedicated device. For example, the computer device 800 may be an edge device (e.g., a box carrying a chip with processing capabilities). Alternatively, the computer device 800 may be a server or other device with computing capabilities.

[0198] It should be understood that the computer device 800 according to this embodiment may correspond to the storage server 600 and the client 700 in this embodiment, and may correspond to executing the corresponding subjects in any method in Figure 4 or Figure 5, and the above-mentioned and other operations and / or functions of each module in the storage server 600 and the client 700 are respectively for realizing the corresponding processes of each method in Figure 4 or Figure 5. For the sake of brevity, they will not be repeated here.

[0199] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and storage medium can also exist as discrete components in a computing device.

[0200] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is performed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program or instruction can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, a hard disk, or a tape; it can also be an optical medium, such as a digital video disc (DVD); it can also be a semiconductor medium, such as a solid state drive (SSD). The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A lock recovery method, It is characterized in that A plurality of storage servers and a client respectively establish direct links, the plurality of storage servers include a first storage server, the method is performed by the first storage server, and the method includes: Based on the first lock request of the client, lock the target data indicated by the first lock request; After the first storage server is restarted, sending a lock recovery request to the client through a link between any one of the multiple storage servers and the client, wherein the lock recovery request is used to instruct the client to restore locking of the first storage server; Receiving a second lock request sent by the client; The target data indicated by the second lock request is locked.

2. The method according to claim 1, It is characterized in that Sending a lock recovery request to the client through a link between any one of the multiple storage servers and the client includes: A lock recovery request is sent to the client through a link between any storage server among the multiple storage servers except the first storage server and the client.

3. The method according to claim 1, It is characterized in that Sending a lock recovery request to the client through a link between any one of the multiple storage servers and the client includes: A lock recovery request is sent to the client through a link between the first storage server among the multiple storage servers and the client.

4. The method according to any one of claims 1 to 3, It is characterized in that The first storage server persistently stores the addresses of the multiple storage servers.

5. The method according to any one of claims 1 to 4, It is characterized in that The first storage server stores locking information of the plurality of storage servers, and the locking information of the plurality of storage servers includes locking information of the target data in the first storage server.

6. The method according to any one of claims 1 to 5, It is characterized in that The second lock request is used to instruct to resume the lock performed on the target data according to the first lock request.

7. The method according to any one of claims 1 to 6, It is characterized in that The addresses of the multiple storage servers belong to the same mount point.

8. A lock recovery method, It is characterized in that The client mounts multiple storage servers, the multiple storage servers include a first storage server, and the method is executed by the client, the method comprising: Sending a first locking request to the first storage server, where the first locking request is used to instruct to lock target data belonging to the first storage server; receiving a lock recovery request through a link between any one of the plurality of storage servers and the client, the lock recovery request being used to instruct the client to recover and lock the target data belonging to the first storage server; A second locking request is sent to the first storage server, where the second locking request is used to instruct to lock the target data belonging to the first storage server.

9. The method according to claim 8, It is characterized in that Receiving a lock recovery request through a link between any one of the plurality of storage servers and the client, comprising: The lock recovery request is received through a link between any one of the plurality of storage servers except the first storage server and the client.

10. A storage server, It is characterized in that The storage server includes a module for executing the operation steps of any one of the methods of claims 1-7.

11. A client, It is characterized in that The client comprises a module for executing the operation steps of the method according to any one of claims 8 to 9.

12. A computer device, It is characterized in that The computer device includes a memory and a processor, the memory is used to store a set of computer instructions; when the processor executes the set of computer instructions, the operation steps of the method described in any one of claims 1-7 are executed; or, the operation steps of the method described in any one of claims 8-9 are executed.

13. A communication system, It is characterized in that The communication system includes a client and multiple storage servers, the client mounts the multiple storage servers, the storage servers are used to execute the operation steps of the method described in any one of claims 1-7, and the client is used to execute the operation steps of the method described in any one of claims 8-9.

Citation Information

Patent Citations

  • Lock recovery method, storage server, client, equipment and system

    CN119003472A

  • Lock recovery method, equipment and network file system

    CN103501338A

  • Lock request handling methods and servers

    CN107466456B

  • Fault notification method, device and apparatus and computer readable storage medium

    CN111125048A

  • Method and system for locking file in network file system, equipment and medium

    CN113986855A