Lock recovery method, storage server, client, equipment 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 between the client and the storage server is blocked, and the system reliability and Data consistency.
Patent Information
- Application Number
- CN202310820049.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-05-19
- Filing Date
- 2023-07-05
- Publication Date
- 2024-11-22
AI Technical Summary
When the link between the client and the storage server is not connected, how to achieve lock recovery, avoid data inconsistency, and improve system reliability.
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.
Improves the success rate of lock recovery and system reliability, ensuring that the target data is relocked after the server restarts, and avoids data inconsistency.
Smart Images

Figure CN119003472A_ABST
Abstract
Description
[0001] This application claims the priority of 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 Fault Recovery Method”. The entire contents of these applications 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, a storage server, a client, a device and a system. Background Art
[0003] Currently, the client can mount the shared files of the storage server based on the network file system and remotely access the shared files of the storage server through the network. Among them, the client and multiple storage servers transmit data based on multiple links, and the utilization rate of network resources is improved by increasing the number of concurrency. In order to avoid different processes accessing the target data in the shared file at the same time, resulting in data inconsistency, 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 not connected, how to realize lock recovery is an urgent problem to be solved. Summary of the invention
[0004] The present application provides a lock recovery method, a storage server, a client, a device and a 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.
[0005] In a first aspect, a lock recovery method is provided, wherein a plurality of storage servers respectively establish direct links with a client, and the plurality of storage servers include a first storage server. The method includes: after the first storage server receives a first lock request sent by the client, the first storage server locks the target data indicated by the first lock request. When the first storage server is restarted, a lock recovery request is sent to the client through a link between any one of the plurality of storage servers and the client, and the lock recovery request is used to instruct the client to restore the lock on the first storage server. Further, a second lock request sent by the client is received, and the target data indicated by the second lock request is re-locked.
[0006] In this way, compared with 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 a 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. Thus, by expanding the available channels for sending the lock recovery request, the success rate of sending the lock recovery request is increased, ensuring the success of the 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 to access 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 problem of data inconsistency caused by multiple processes accessing the target data is avoided through successful lock recovery, thereby improving the reliability of the system.
[0007] In a possible implementation, sending a lock recovery request to the client through a link between any one of the multiple storage servers and the client includes: 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.
[0008] 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 through a second link between a second storage server other than the first storage server among the multiple storage servers and the client.
[0009] Compared with sending a lock recovery request based only on the link between the restarted storage server and the client, the lock recovery request fails to be sent due to link abnormality, and lock recovery cannot be achieved. The solution provided by the present application is to send a lock recovery request through the link between any storage server other than the first storage server among multiple storage servers and the client until the request is successfully sent, thereby ensuring successful lock recovery, improving the reliability of lock recovery, avoiding data inconsistency caused by multiple processes accessing target data, and improving the reliability of the system.
[0010] In another possible implementation, sending a lock recovery request to a client through a link between any storage server among the multiple storage servers except the first storage server and the client includes: sending a lock recovery request to any storage server among the multiple storage servers except the first storage server, and then sending a lock recovery request to the client through a link between any storage server among the multiple storage servers except the first storage server and the client. Thus, any storage server can send a lock recovery request to the client.
[0011] In another possible implementation, sending a lock recovery request to the client through a link between any one of the multiple storage servers and the client includes: sending a lock recovery request to the client through a link between a first storage server among the multiple storage servers and the client.
[0012] 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.
[0013] 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 is sent to ensure successful lock recovery.
[0014] In another possible implementation, the first storage server persistently stores the addresses of multiple storage servers. Thus, when 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 through the link between any storage server other than the first storage server and the client.
[0015] 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.
[0016] In another possible implementation, the second lock request is used to indicate the restoration of the lock performed on the target data according to the first lock request. It can be understood 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.
[0017] 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, and different services can be isolated using different mount points to avoid mutual interference.
[0018] 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.
[0019] In another possible implementation, receiving a first locking request sent by a client includes: receiving the first locking request through a link between a first storage server 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 a designated storage server among the plurality of storage servers and the client.
[0021] Optionally, the first storage server may receive the second locking request in a manner similar to that of receiving the first locking request.
[0022] In a 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 locking of target data belonging to the first storage server. The lock recovery request is used to indicate that the client restores locking of target data belonging to the first storage server. The second lock request is used to indicate re-locking of target data belonging to the first storage server.
[0023] In this way, compared with the client receiving the lock recovery request based on a specific link, when the specific link fails, the lock recovery request cannot be received, resulting in a lock recovery failure. The solution provided by the present application receives the 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. Thus, by expanding the available channels for receiving the lock recovery request, the success rate of receiving the lock recovery request is increased, ensuring the success of the lock recovery. Re-locking the target data avoids the problem of data inconsistency caused by multiple processes accessing the target data, thereby improving the reliability of the system.
[0024] In a 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.
[0025] Compared with receiving the lock recovery request based only on the link between the restarted storage server and the client, the lock recovery request fails to be received due to the link abnormality, and the lock recovery cannot be achieved. The solution provided by the present application is to receive the lock recovery request by means of the link between any storage server other than the first storage server among multiple storage servers and the client until the lock recovery is successfully received, thereby ensuring the success of the lock recovery, improving the reliability of the lock recovery, avoiding the problem of data inconsistency caused by multiple processes accessing the target data, and improving the reliability of the system.
[0026] 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.
[0027] 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 is received to ensure successful lock recovery.
[0028] In another possible implementation, sending the second lock request to the first storage server includes: when 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, the security of the system is improved.
[0029] In another possible implementation, the successful verification of the address of the first storage server in the lock recovery request includes: 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 sending the lock recovery request, determining that the verification is successful.
[0030] In another possible implementation, the client persistently stores the addresses of multiple storage servers, so as to facilitate verification of lock recovery requests.
[0031] In another possible implementation, the client 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. Thus, the client manages the locking information and feeds back the locking information to the storage server.
[0032] 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, and different services can be isolated using different mount points to avoid mutual interference.
[0033] Optionally, the addresses of multiple storage servers belonging to the same mount point may also be alternatively described as multiple storage servers belonging to the same mount point.
[0034] 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.
[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 the first storage server 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 a storage server designated by a plurality of storage servers and the client.
[0037] 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, which is used to lock the target data indicated by the first locking request based on the first locking request of the client; a communication module, which is used to send a lock recovery request to the client through the link between any one of the plurality of storage servers and the client after the first storage server is restarted, and the lock recovery request is used to instruct the client to restore the lock on the first storage server; the communication module is also used to receive a second locking request sent by the client; the locking module is also used to lock the target data indicated by the second locking request.
[0038] 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.
[0039] 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.
[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 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.
[0041] In another possible implementation, the first storage server persistently stores addresses of multiple storage servers.
[0042] 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.
[0043] In another possible implementation, the second lock request is used to instruct to resume locking the target data according to the first lock request.
[0044] In another possible implementation, addresses of multiple storage servers belong to the same mount point.
[0045] 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.
[0046] In another possible implementation, receiving a first locking request sent by a client includes: receiving the first locking request through a link between a first storage server 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 a designated storage server among the plurality of storage servers and the client.
[0048] In a fourth aspect, a client is provided, wherein the client mounts multiple storage servers, and the multiple storage servers include a first storage server. The client includes: a communication module, which is used to send a first locking request to the first storage server, and the first locking request is used to indicate that the target data belonging to the first storage server is locked; the communication module is also used to receive a lock recovery request through a link between any one of the multiple storage servers and the client, and the lock recovery request is used to indicate that the client restores the lock of the target data belonging to the first storage server; the communication module is also used to send a second locking request to the first storage server, and the second locking request is used to indicate that the target data belonging to the first storage server is locked.
[0049] 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.
[0050] 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.
[0051] In another possible implementation, when the communication module sends the second locking request to the first storage server, it is specifically used to: when the address of the first storage server in the lock recovery request is successfully verified, send the second locking request to the first storage server.
[0052] In another possible implementation, the device further includes a locking module, which is used 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.
[0053] In another possible implementation, the client persistently stores addresses of multiple storage servers.
[0054] In another possible implementation, the client 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.
[0055] In another possible implementation, addresses of multiple storage servers belong to the same mount point.
[0056] 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.
[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 the first storage server 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 a storage server designated by a plurality of storage servers and the client.
[0059] 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.
[0060] In a sixth aspect, a communication system is provided, the communication system comprising a client and multiple storage servers, the client mounting multiple storage servers. The storage server is used to execute the operation steps of the lock recovery method in the first aspect or any possible implementation of the first aspect. The client is used to execute the operation steps of the lock recovery method in the second aspect or any possible implementation of the second aspect.
[0061] 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.
[0062] 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.
[0063] The technical effects brought about by any design method from the third aspect to the eighth aspect can refer to the technical effects brought about by the first aspect to the second aspect or different design methods, and will not be repeated here.
[0064] Based on the implementations provided in the above aspects, the present application can be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 A mounting schematic diagram provided for this application;
[0066] Figure 2 A schematic diagram of the architecture of a communication system provided for this application;
[0067] Figure 3 A schematic diagram of the NFS architecture provided for this application;
[0068] Figure 4 A flowchart of a locking method provided by this application;
[0069] Figure 5 A flowchart of a lock recovery method provided by this application;
[0070] Figure 6 A schematic diagram of the structure of a storage server provided for this application;
[0071] Figure 7 A schematic diagram of the structure of a client provided for this application;
[0072] Figure 8 A schematic diagram of the structure of a computer device provided in this application. DETAILED DESCRIPTION
[0073] To facilitate understanding, the main terms involved in this application are first explained.
[0074] Network File System (NFS) is a file sharing protocol in a distributed file system, which enables computers with different operating systems (such as Linux, UNIX, and Windows) to share data through the network. Accessing files on remote computers on the network is like accessing files on a local computer, thus achieving fast and reliable file sharing services. That is, by mounting the file directory of the remote computer on the local directory of the local computer, the files of the remote computer can be accessed by accessing the local directory.
[0075] Mounting means connecting the directory of the remote computer to the subdirectory under the root directory of the local computer. Accessing the subdirectory of the local computer is equivalent to accessing the contents of the directory of the remote computer. The subdirectory under the root directory of the local computer can be an empty directory. The subdirectory name of the local computer can be the same as the name of the directory mounted on the remote computer. For example, Figure 1 As shown in (a) of the Linux system file directory, the root directory " / " includes subdirectories such as / bin, / home, / lib, and / usr. Figure 1 As shown in (b) of the figure, the root directory of the USB flash drive, "sdb1", includes sub-directories such as / a, / b, and / c. Figure 1 (c) in the figure shows the mounting diagram of the USB disk file directory to the Linux system file directory. Create an empty subdirectory in the root directory of the Linux system file directory, and name the subdirectory / sdb1-U. / sdb1-U mounts the USB disk file directory. Accessing / sdb1-U is equivalent to accessing the contents of the USB disk file directory sdb1.
[0076] The mount point refers to the entry directory of the Linux system's file system, similar to the drive letters C:, D:, E:, etc. used to access different partitions in Windows. For example, mount points include / bin, / home, / lib, / usr, and / dev. / bin includes commands and functions required by the system. / home represents the user's default directory. / lib includes library files and kernel information. / usr includes system commands and applications used by users. / dev includes device file storage directories.
[0077] 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.
[0078] For example, assume that file 1 includes the remaining amount of an account. Process A and process B access file 1. Process A modifies the remaining amount in file 1 and writes the modified remaining amount 1 to file 1. Since process B reads the remaining amount in file 1 but does not read the modified remaining amount 1, process B modifies the remaining amount in file 1 and writes the modified remaining amount 2 to file 1. At this time, file 1 may include the modified remaining amount 2 but not the modified remaining amount 1, resulting in data inconsistency.
[0079] 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 the problem of data inconsistency by locking the file.
[0080] File lock refers to a mechanism used to solve the problem of data inconsistency caused by competition for shared resources. For example, the first client accesses the server to read or modify the server's data or write data to the server. The first client requests the server to lock the target data being accessed. After the server locks the data, no client other than the first client is allowed to access the target data, thereby avoiding data inconsistency. For another example, the first process in the client accesses the target data, and no process other than the first process is allowed to access the target data. After the server is restarted, the lock may be lost, and the server requests the client to re-lock it.
[0081] The NFS described in this application can be designed based on the client / server (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 in the server, so that the client can access the server's file system in different languages, operating systems and folders. Optionally, the client can refer to a local computer or a local device or a local computer or a local device. The server can refer to a remote computer or a remote device. The client can also be called an NFS client. The server can also be called an NFS server.
[0082] In some embodiments, a client establishes at least one link with a server, and the client can remotely access a file system of a server through a network based on at least one link between the client and the server. A link refers to a physical line between two nodes. A link can also be called a physical link or a communication link.
[0083] 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, writes the multiple data blocks to multiple servers, improves 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.
[0084] Understandably, a client can establish direct links with at least two servers respectively and access the file systems of at least two servers. Multiple clients can establish direct links with multiple servers, and each client can establish direct links with at least two servers respectively. A server can also be connected to at least two clients, so that a server can be mounted on multiple clients. Direct links or indirect connections can be established between multiple servers. In other words, there can be network devices such as routers and switches between servers, and servers can establish indirect connections through network devices.
[0085] In addition, in a scenario where a client establishes direct links with multiple servers respectively, or multiple clients can establish direct links with multiple servers, when a client accesses target data in 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 in a server, the server locks the target data to prevent processes other than the first process (such as the 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.
[0086] 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.
[0087] In this way, compared with 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 a link between any one of the multiple servers and the client when the link established between the client and any one of the multiple servers is unobstructed. Thus, by expanding the available channels for sending the lock recovery request, the success rate of sending the lock recovery request is increased, ensuring the success of the 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 to access 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 problem of data inconsistency caused by multiple processes accessing the target data is avoided through successful lock recovery, thereby improving the reliability of the system.
[0088] The present application does not limit the type and function of the server. For example, the types of servers include blade servers, tower servers, cabinet servers, and rack servers. For another example, the server includes a storage server with a storage function or a computing server with a computing function, and the computing server also has a storage function.
[0089] The implementation methods of locking and lock recovery provided by the present application are described in detail below with reference to the accompanying drawings.
[0090] The solution provided in this application can be applied to communication systems such as cluster networks, super-node interconnection networks, etc. For example, high performance computing (HPC) networks or high availability (HA) networks.
[0091] For example, Figure 2 This is a schematic diagram of the architecture of a communication system provided by this application. Figure 2 As shown, the communication system 200 includes a client 210 and a plurality of servers 220 .
[0092] 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. A plurality of servers that provide computing functions may constitute a computing cluster. For example, the server 220 may include a computing unit 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.
[0093] 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. A plurality of 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 a plurality of hard disks. The hard disk is used to store data. The hard disk may be a disk or other types of storage media, such as a solid-state hard disk 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. In 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.
[0094] Figure 2 It 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 be connected 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, other devices may also be included in the communication system, such as network devices (such as switches, routers). Multiple servers are connected via network devices and data is transmitted via network devices.
[0095] The client 210 communicates with multiple servers 220 via a network 230. The network 230 may be an internal network of an enterprise (eg, a local area network (LAN)) or the Internet.
[0096] In some embodiments, multiple servers 220 manage data based on a distributed file system 221 (such as NFS). For example, the client 210 and multiple servers 220 deploy the third version of the network file system (Network File System Version 3, NFS V3). The client 210 mounts the file directories in multiple servers 220, so that the client 210 can access the file systems of multiple servers 220 in different languages, operating systems and folders. The client accesses multiple servers through multiple links, and improves the utilization rate of network resources and the data transmission rate by increasing the number of concurrency. For example, the client writes data to multiple servers or reads data from multiple servers through multiple links. Among them, a mount point of the client can mount the directory of a server or the directory of multiple servers. The client can also mount the directories of multiple servers at multiple mount points respectively. Thereby, in order to deploy the same business at one mount point, different mount points are used to isolate different businesses and avoid mutual interference.
[0097] In addition, the client accesses multiple servers through multiple links and can instruct the server to lock, thereby avoiding data inconsistency caused by competition for shared resources.
[0098] For example, Figure 3 This is a schematic diagram of the NFS architecture provided by this application. Figure 3 As shown, the client includes NSM module, NLM module and NFS module. The server includes NSM module, NLM module, NFS module and FS module, so as to realize the client remote access to the server's files and lock, unlock and restore the files on the server.
[0099] 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 operation includes at least one of creating, deleting and querying a file.
[0100] The Network Lock Manager (NLM) module of the client is used to provide functions such as locking, unlocking and lock recovery of the server, and managing lock information in the form of a monitoring group.
[0101] The client's Network State Manager (NSM) module is used to manage monitoring groups and sense lock recovery events, etc. For example, the monitoring group may include the address of the server that successfully locked and the address of the client, such as the Internet Protocol (IP) address.
[0102] The NFS module of the server is used to provide NFS protocol services, such as file reading, writing, deleting, and querying functions.
[0103] The NLM module of the server is used to provide locking services, supporting functions such as locking, unlocking and lock recovery.
[0104] The NSM module of the server is used to manage the monitoring group. For example, after the lock is successfully acquired, the client address and the server address are persisted to the file system. After the server is restarted, the monitoring group containing the server address is obtained, and the lock recovery request is sent to the client through the server address contained in the monitoring group until it succeeds.
[0105] 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.
[0106] The server is also used to manage the server address and query all monitoring groups in the same network segment based on the address.
[0107] Next, the locking phase and the lock recovery phase are described in detail with reference to the accompanying drawings.
[0108] Figure 4 A flowchart of a locking method provided for this application. Assume that the client has established a connection (such as Transmission Control Protocol (TCP) or User Datagram Protocol (UDP)) with four servers (such as 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 can be Figure 1 The server can be Figure 1 The storage servers in the storage cluster described in . Figure 4 As shown, the method includes the following steps.
[0109] Step 410: The client sends a first locking request to the first server.
[0110] The client may send a first locking request to the first server according to the routing strategy.
[0111] Strategy 1: The client sends a first locking request through 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 locking request through the link between the first server and the client.
[0112] Strategy 2: The client sends the first lock request through the link between any one of the multiple servers connected to the client and the client. For example, the client randomly selects the second server from the 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. For another example, the client selects a third server with a load less than a threshold from the four servers based on the load balancing strategy and sends the first lock request through the link between the third server and the client.
[0113] Strategy three, the client sends a first locking request through the link between the server specified in multiple servers and the client. For example, the designated server is the first server, the client instructs the first server to lock, and the client sends the first locking request through the link between the first server and the client; the client instructs the second server to lock, and the client sends the second locking request to the first server through the link between the first server and the client, and the first server forwards the second locking request to the second server. Among them, the first locking request is used to indicate the locking of the first data of the first server. The second locking request is used to indicate the locking of the second data of the second server. The target data described in this application can be the first data or the second data.
[0114] 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), etc. For example, when the client reads data stored in the first server, the lock type may be a read lock. When the client modifies data stored in the first server or writes data to the first server, the lock type may be a write lock.
[0115] 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.
[0116] Step 420: The client stores the first locking information.
[0117] The client stores the information included in the first lock request. For example, the client can 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 end address of the data (optional), and the lock type (read lock or write lock).
[0118] 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 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 belonging 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 belonging 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, and 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 address of the client and the address IP1 of the first server, the association relationship between the address of the client and the address IP2 of the second server, the association relationship between the address of the client and the address IP3 of the third server, and the association relationship between the address of the client and the address IP4 of the fourth server.
[0119] The client can persist the monitoring group, for example, storing the monitoring group in a monitoring directory of the hard disk. The file name of the monitoring group can be group-n. For example, the file name of the first monitoring group can be group-1.
[0120] It should be noted that the addresses of the first server and the server that belongs to the same mount point as the first server may belong to the same network segment or different network segments. The client may mount multiple servers that belong to the same network segment or servers that belong to different network segments. The client may mount multiple servers that belong to the same network segment or multiple servers that belong to different network segments on the same mount point.
[0121] In addition, the client can store locking information in monitoring groups. For example, the client's memory stores locking information of multiple servers belonging to the same mount point in the monitoring group.
[0122] 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, and 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, and 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.
[0123] 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.
[0124] Optionally, after the client establishes a connection with the server, the server sends the monitoring group to the client, and the client stores the monitoring group fed back by the server.
[0125] Optionally, after establishing a connection with the server, the client may also divide the servers belonging to the same network segment into a monitoring group according to the addresses of the servers, and store the monitoring group.
[0126] Step 430: The first server locks the first data indicated by the first locking request based on the first locking request of the client.
[0127] The first server may receive the first locking request through a link selected by the client according to the routing strategy.
[0128] Strategy 1: The client sends a first locking request through a link between the server to be locked and the client. For example, the first server receives the first locking request through a link between the first server and the client.
[0129] Strategy 2: The client sends a first lock request through a link between any server among 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.
[0130] Strategy 3: The client sends a first locking request through a link between a designated server among multiple servers and the client. The first server receives the first locking request from the designated server. For example, the designated server is the first server, and the first server receives the first locking request through a link between the first server and the client.
[0131] 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 the above step 410. Optionally, the first server may also send a response message to the client, indicating that the lock is successful.
[0132] In some embodiments, the first server stores the address relationship between the client and multiple servers, and 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 address of the server that belongs 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 the monitoring directory of the hard disk. The locking information of multiple servers in the monitoring group is stored in the memory of the first server.
[0133] Optionally, the first server may 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 address of the client and the address of the first server, and 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 second monitoring group includes the correspondence between the address of the client and the address of the third server, and 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.
[0134] Thus, by locking the data accessed in the server, the problem of data inconsistency caused by competition for shared resources is avoided. In addition, the client and the server respectively store the address relationship between the client and the locked multiple servers, as well as the locking information, so as to realize lock recovery after the server is restarted.
[0135] After the server locks successfully, due to server failure or other reasons, the server needs to request the client to re-lock after the server restarts. For example, because the lock information stored in the memory is lost after the server restarts, it is necessary to request the client to re-lock. Figure 5 A flowchart of a lock recovery method provided by this application. Figure 4 The difference shown is that after the client locks the first server, the first server restarts and requests the client to re-lock it. Figure 5 As shown, the method also includes the following steps.
[0136] 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.
[0137] After the first server is restarted, since the locking information of the first server is lost, the client needs to request to re-lock, and a lock recovery request is sent to the client.
[0138] In some embodiments, the first server sends a lock recovery request to the client through 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 a lock recovery request to the client through the link between the first server and the client. The normal state of the link can indicate that the link between the client and the server is unobstructed and the client and the server can transmit data to each other.
[0139] In other embodiments, the first server sends a lock recovery request to the client through a link between any one of the multiple servers except 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 through a link between any one of the multiple servers except 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, unavailable, 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 cause of the failure includes a transmission medium failure between the client and the server, a network card failure of the server, and a port failure of the server.
[0140] Optionally, the first server may select any server except the first server from the multiple servers according to the routing strategy. For example, the first server randomly selects any server except the first server from the multiple servers. For another example, the first server selects a server with a load less than a threshold from the multiple servers except the first server according to the load balancing strategy.
[0141] For example, the first server randomly selects the second server from the 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. For another example, the first server selects the third server with a load less than a threshold from the four servers according to the load balancing strategy, 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.
[0142] 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 the above step 410 .
[0143] The multiple servers include a server that belongs to the same mounting point as the first server.
[0144] 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 address of the client, the address of the first server, and the address of the server belonging to the same mount point as the first server. The first server selects any server except the first server from the monitoring group, 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 address of the client, and the address of the first server.
[0145] Assume that the first server selects a second server from multiple servers except the first server, and sends a lock recovery request to the client through the link between the second server and the client. That is, the first server sends a lock recovery request to the second server, and the second server sends a lock recovery request through the link between the second server and the client. The lock recovery request includes a source address, a destination address, and an address of a server for 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 refers to the source address of sending the lock recovery request. The address of the client refers to the destination address of receiving the lock recovery request.
[0146] If the first server and the second server belong to the same network segment, the first server can directly send a lock recovery request to the second server. If the first server and the second server belong to different network segments, the first server can forward the lock recovery request through a network device (such as a switch, a router) and send the lock recovery request to the second server.
[0147] Understandably, the link used by the first server to send the lock recovery request to the client is an available link, and an available link refers to a link in a normal state. Optionally, if the lock recovery request fails to be sent through the link between the server selected by the first server and the client, a server is re-selected from the multiple servers, and the lock recovery request is sent through the link between the re-selected server and the client until it is sent successfully.
[0148] Step 520: The client receives a lock recovery request through a link between any one of the multiple servers and the client.
[0149] Since the first server sends a lock recovery request to the client through a link between any one of the multiple servers and the client, the client receives the lock recovery request through a link between any one of the multiple servers and the client. For example, the client receives the lock recovery request through a link between the first server among the multiple servers and the client. For another example, the client receives the lock recovery request through a link between any one of the multiple servers except the first server and the client. For an explanation of the link between any one of the multiple servers and the client, reference can be made to the description of step 510, which will not be repeated here.
[0150] Step 530: The client sends a second locking request to the first server.
[0151] 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 after 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 end address of the data (optional), and the lock type (read lock or write lock).
[0152] In some embodiments, the first server and the client store a monitoring group, and the monitoring group includes the address of the first server and the address of the server belonging 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 monitoring group includes the address of the first server and the address of the server belonging to the same mount point as the first server, it is determined that the verification is successful. For example, the first server selects any server except the first server from the monitoring group and sends a lock recovery request. The client obtains at least one monitoring group, and at least one monitoring group includes the source address of sending the lock recovery request, traverses each monitoring group, and determines whether the monitoring group includes the address of the first server. When the monitoring group includes the address of the first server that needs lock recovery, it is determined that the verification is 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. The client obtains at least one monitoring group based on the address of the first server, and the monitoring group includes the address of the first server that needs lock recovery, and determines that the verification is successful.
[0153] 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 monitoring group including the address of the second server, determines that the monitoring group includes the address of the first server, and determines that the verification is successful.
[0154] The client may send a second locking request to the first server according to the routing strategy.
[0155] Strategy 1: The client sends a second lock request through the link between the server that needs to be locked and the client.
[0156] 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.
[0157] Strategy three: the client sends a second lock request through a link between a server designated by a plurality of servers and the client.
[0158] Strategy 4: The client sends a second lock request through the link between the server that sent the lock recovery request and the client. For example, the client receives the lock recovery request through the link between the second server and the client, and the client sends a second lock request through the link between the client and the second server.
[0159] For strategies 1 to 3 of sending the second lock request, reference may be made to the description of step 410 above.
[0160] Step 540: The first server receives a second locking request sent by the client.
[0161] The first server may receive the second locking request through the link selected by the client according to the routing strategy. For the explanation of receiving the second locking request, reference may be made to the explanation of receiving the first locking request described in step 430 above.
[0162] Step 550: The first server locks the first data indicated by the second lock request.
[0163] Understandably, both the first lock request and the second lock request 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.
[0164] 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 restored 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.
[0165] 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 caused by multiple processes accessing target data, and improving system reliability.
[0166] The server described in the above embodiment may 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.
[0167] It is understandable that, in order to implement the functions in the above embodiments, the client and the server (such as a storage server) include hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by 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.
[0168] Combined with the above Figures 1 to 5 , describes in detail the locking method and lock recovery method provided by the present application, and will be combined with Figure 6 to Figure 7 , describing the apparatus provided according to the present application. These apparatuses can be used to implement the functions of the client or the storage server in the above method embodiment, and thus can also achieve the beneficial effects possessed by the above method embodiment. In this embodiment, the apparatus can be as follows Figure 2 or Figure 3 The device shown may also be a module (such as a chip) applied to a server or a module (such as a chip) applied to a client.
[0169] like Figure 6 As shown, 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 above Figure 4 or Figure 5 The functions of the server in the method embodiment shown in FIG.
[0170] The communication module 610 is used to send a lock recovery request to the client through a link between any one of the multiple servers and the client after the first server is restarted. The lock recovery request is used to instruct the client to restore the lock on the first server. Figure 5 Step 510.
[0171] The locking module 620 is used to lock the target data indicated by the first locking request based on the first locking request of the client. For example, the locking module 620 is used to execute Figure 4 Step 430.
[0172] The communication module 610 is further configured to receive a second lock request sent by the client. Figure 5 Step 540.
[0173] The locking module 620 is further configured to lock the target data indicated by the second locking request. Figure 5 Step 550.
[0174] Optionally, the communication module 610 is specifically configured to send a lock recovery request to the client through a link between any server among the multiple servers except the first server and the client.
[0175] Optionally, the communication module 610 is specifically configured to send a lock recovery request to the client through a link between a first server among the multiple servers and the client.
[0176] The storage module 630 is used to store the address relationship and locking information between the client and the server, so that the client and the server can perform the lock recovery process.
[0177] like Figure 7 As shown, 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 above Figure 4 or Figure 5 The functionality of the client in the method embodiment is shown in FIG.
[0178] The communication module 710 is used to send a first locking request to the first server, where the first locking request is used to instruct to lock the target data of the first server. Figure 4 Step 410.
[0179] The communication module 710 is further configured to receive a lock recovery request through 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 of the first server. Figure 5 Step 520.
[0180] 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. Figure 5 Step 530.
[0181] Optionally, the communication module 710 is specifically configured to receive a lock recovery request through a link between any server among the multiple servers except the first server and the client.
[0182] 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.
[0183] 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.
[0184] The storage module 730 is used to store the address relationship and locking information between the client and the server, so that the client and the server can perform the lock recovery process.
[0185] 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 PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. It can also be implemented by software. Figure 4 The locking method shown or Figure 5 When the lock recovery method is shown, its various modules may also be software modules, and the storage server 600 and the client 700 and their various modules may also be software modules.
[0186] The storage server 600 and the client 700 according to the embodiment of the present application may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of each unit in the storage server 600 and the client 700 are respectively to implement Figure 4 or Figure 5 For the sake of brevity, the corresponding processes of each method in are not repeated here.
[0187] Figure 8 FIG. 8 is a schematic diagram of the structure of a computer device 800 provided in this application. Figure 8As shown, the 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). The processor 810 , the memory 830 , the memory unit 850 , and the communication interface 840 are connected via the bus 820 .
[0188] It should be understood that in this embodiment, the processor 810 may be a CPU, and the processor 810 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.
[0189] 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.
[0190] The communication interface 840 is used to implement the communication between the computer device 800 and an external device or device. Figure 4 When the client functions shown in FIG. 8 , the communication interface 840 is used to send a lock request. The computer device 800 is used to implement Figure 5 When the client functions shown in FIG. 8A and FIG. 8B are used, the communication interface 840 is used to obtain a lock recovery request so that the processor 810 can instruct the server to re-lock the lock based on the lock recovery request. Figure 4 or Figure 5 When the server functions as shown, 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.
[0191] The bus 820 may include a path for transmitting information between the above 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, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a computer 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.
[0192] As an example, the computer device 800 may include multiple processors. The processor may be a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions).
[0193] It is worth mentioning that Figure 8 In the example, a computer device 800 including one processor 810 and one memory 830 is taken. 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.
[0194] 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. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (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 but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM). Memory unit 850 is used to store lock information, etc.
[0195] 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 disk.
[0196] 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), etc. Alternatively, the computer device 800 may also be a server or other device with computing capabilities.
[0197] 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 the computer device 800 executing the Figure 4 or Figure 5 The corresponding subject in any method, and the above and other operations and / or functions of each module in the storage server 600 and the client 700 are respectively to implement Figure 4 or Figure 5 For the sake of brevity, the corresponding processes of each method in are not repeated here.
[0198] 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 a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist in a computing device as discrete components.
[0199] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part 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 instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may 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 may 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 may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD). The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A lock recovery method, 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, 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, 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, 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, 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, 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, characterized in that The addresses of the multiple storage servers belong to the same mount point.
8. A lock recovery method, 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, 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, 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, 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, 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, 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
Cited By
Locking recovery method, storage server, client, device and system
EP4697191A1
Locking recovery method, storage server, client, device and system
WO2024240034A1
Method and apparatus for file lock, and electronic device and computer program product
WO2026118440A1
