Method for data processing using an intermediate device, computer system, and intermediate device
By introducing an intermediate device into the computer system to manage storage space metadata, the problems of computing node load and latency are solved, enabling more efficient data writing and processing.
Patent Information
- Application Number
- CN202411171666.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-07-02
- Filing Date
- 2020-11-13
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2040-11-13
AI Technical Summary
In multi-node computer systems, the data write latency between compute nodes and storage nodes is relatively long, and the compute nodes are under heavy load. Existing technologies require compute nodes to communicate with storage nodes multiple times to allocate write addresses, which increases the load and latency.
By introducing an intermediate device (such as a network switch) between compute nodes and storage nodes, the metadata of the storage space is managed on the intermediate device. The compute node only needs to send write requests to the intermediate device, which is responsible for address allocation and data writing, thus reducing the load and latency of the compute node.
It reduces the load on computing nodes, decreases data write latency, and improves data processing efficiency and reliability through load balancing and sequential processing of intermediate devices.
Smart Images

Figure CN119292514B_ABST
Abstract
Description
[0001] This application is a divisional application of the original application with the application number 202011269034.2 and the original filing date of November 13, 2020, and the entire contents of the original application are incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the technical field of computer, in particular to a method for processing data using an intermediate device, a computer system and the intermediate device. BACKGROUND
[0003] In a multi-node computer system, it usually includes multiple computing nodes and multiple storage nodes. In order to realize concurrent access to the storage space of an application by multiple computing nodes, the related art manages the storage space of the application through the storage nodes, and when the computing nodes access the data of the application stored in the storage nodes, the load of the computing nodes is increased and the time delay of data processing is affected. For example, when the computing node needs to write the data of the application into the storage space corresponding to the application, the computing node first requests the storage node to allocate a write address for the data in the storage space corresponding to the application, and after obtaining the write address, the computing node sends a write request to the storage node to write the data into the write address. In this way, when writing data, the computing node first needs to apply for allocating a write address to the storage node, and after the write address is allocated, the computing node sends a write request to the storage node to write the data into the write address, that is, the computing node needs to send at least two requests to the storage node, which not only increases the load of the computing node, but also increases the time delay of data writing. SUMMARY
[0004] The embodiments of the present application aim to provide a method for processing data, a computer system and an intermediate device, which manage the storage space of an application through the intermediate device connected between the computing node and the storage node, effectively reducing the load of the computing node and the time delay of data writing.
[0005] To achieve the above-mentioned purpose, the first aspect of the present application provides a computer system. The computer system includes a computing node, a storage node and an intermediate device. The computing node runs a service, and the storage node stores the data of the service. The service is allocated with a storage space, and the service operates the data of the service in the storage node by accessing the storage space, for example, a persistent log space (PLOG). The embodiments of the present application store the metadata of the storage space in the intermediate device, manage the metadata of the storage space by the intermediate device, and realize the data operation between the computing node and the storage node according to the metadata of the storage space.
[0006] By storing the metadata of the storage space of the service on the intermediate device, the intermediate device manages the storage space of the service through the metadata, which can reduce the load of the computing node and reduce the latency of data writing. For example, when the operation is a write operation, the computing node only needs to send a write request to the intermediate device, and the intermediate device allocates an address in the storage space for the write request according to the metadata and writes data into the storage device according to the allocated address. Since the computing node only needs to send a request to the intermediate device, the load of the computing node is reduced, and the latency of data writing is also reduced.
[0007] In an implementation form of the first aspect, the metadata of the storage space includes metadata of a logical storage space, and the metadata of the logical storage space includes an identifier of the logical storage space, address information of the logical storage space, and address information of a physical storage space corresponding to the logical storage space, the physical storage space belonging to the storage node.
[0008] By recording the address information of the logical storage space of the application and the address information of the physical storage space in the storage node in the metadata, the intermediate device can map the operation on the logical storage space to the operation on the physical storage space in the storage node, thereby realizing the operation on the service data stored in the physical storage space in the storage node.
[0009] In an implementation form of the first aspect, a plurality of intermediate devices are included between the computing node and the storage node, and the computing node specifies a first intermediate device for the logical storage space in the plurality of intermediate devices, and the first intermediate device is used to save the metadata of the logical storage space. For example, the computing node can select the first intermediate device from the plurality of intermediate devices according to the identifier of the logical storage space.
[0010] In this way, the plurality of storage spaces of the application can be distributed to different intermediate devices, thereby realizing load balancing of the intermediate devices and improving the processing efficiency of the data of the application.
[0011] In an implementation form of the first aspect, the logical storage space is a persistent log space.
[0012] In an implementation form of the first aspect, the intermediate device is a network switch device.
[0013] Since the communication between the computing node and the storage node passes through the network switch, storing the metadata of the storage space of the application in the network switch can more conveniently realize the management of the storage space of the application.
[0014] In an implementation form of the first aspect of the application, when the computing node writes data of a service to the storage node, the write request is first sent to the intermediate device, the intermediate device allocates a first address in the logical storage space for the to-be-written data, then determines a second address corresponding to the first address for writing the to-be-written data to the storage node, and then requests the requesting node to write the to-be-written data to the second address.
[0015] When writing data, the computing node only needs to send a write request to the intermediate device, so that the load of the computing node is reduced, and the time delay of the write request is reduced.
[0016] In an implementation form of the first aspect of the application, after the computing node allocates a logical storage space for an application, the intermediate device is requested to allocate a physical storage space in the storage node for the logical storage space. After receiving the request, the intermediate device requests the storage node to allocate a physical storage space for the logical storage space. In this way, the correspondence between the logical storage space of the application and the physical storage space in the storage node can be established, and the application can access the data of the physical storage space through the logical storage space.
[0017] In an implementation form of the first aspect of the application, the intermediate device allocates an address of the logical storage space for each write request based on the receiving order of the at least two write requests, or the intermediate device returns a completion message of each write request to the computing node based on the receiving order of the at least two write requests.
[0018] Returning the completion message of the write request or allocating the address in the order of the write request can realize the sequential storage of the to-be-written data of the write request in the storage node, and avoid the occurrence of holes in the storage medium in the storage node.
[0019] In an implementation form of the first aspect of the application, after receiving the read-only setting request for the logical storage space sent by the computing node, the intermediate device sets the state of the logical storage space to a read-only state if there is no conflict in the logical storage space.
[0020] In an implementation form of the first aspect of the application, the intermediate device is further configured to, after receiving the deletion request for the logical storage space sent by the computing node, set the state of the logical storage space to a deletion-in-process state if there is no conflict in the logical storage space, and instruct the storage node to delete the physical storage space corresponding to the logical storage space.
[0021] In the above two implementation forms, whether there is a conflict operation on the logical storage space is determined by the intermediate device, so as to realize state mutual exclusion control, reduce the number of communications between the computing node and the storage node, and improve the processing efficiency of the computer system.
[0022] In an implementation form of the first aspect, after receiving the first write request sent by the computing node, the intermediate device is further configured to obtain a plurality of shards of the to-be-written data in the first write request, wherein determining to write the to-be-written data in the first write request to the first address of the storage node comprises determining to write the plurality of shards to a plurality of first addresses of a plurality of storage nodes respectively.
[0023] In this implementation form, the plurality of shards of the to-be-written data are respectively stored in the plurality of storage nodes by the intermediate device, which guarantees the reliability of the data, and meanwhile, the intermediate device is used to take advantage of the location advantage as a centralized point and the high-performance packet processing capability, so that the amount of data to be transmitted by the computing node is reduced while the reliability is guaranteed.
[0024] In an implementation form of the first aspect, the intermediate device allocates the second address for the first write request from the unallocated space of the logical storage space in ascending order of address.
[0025] In an implementation form of the first aspect, the storage node comprises a first storage node and a second storage node, the second address corresponds to a first address in the first storage node for writing the to-be-written data and a first address in the second storage node for writing the to-be-written data, and the request to write the to-be-written data to the first address comprises: a request to write the to-be-written data to the first address in the first storage node for writing the to-be-written data; and a request to write the to-be-written data to the first address in the second storage node for writing the to-be-written data.
[0026] In this implementation form, the intermediate device writes the data copies to the plurality of storage nodes, which guarantees the reliability of the data, and meanwhile, the intermediate device is used to take advantage of the network location advantage and the high-performance packet processing capability, so that the amount of data to be transmitted by the computing node to the intermediate device is reduced while the reliability is guaranteed.
[0027] In an implementation form of the first aspect, the intermediate device records a queue, the queue records the write requests received from the computing node in a time order, and when it is determined that the first write request is the write request received earliest in time in the queue, it is determined that other write requests for the logical storage space received before the first write request have been completed.
[0028] In this implementation form, the receiving order of the write requests is recorded by the queue, so that the order of the completion information return of the write requests can be controlled more conveniently and accurately.
[0029] In an implementation form of the first aspect, the intermediate device is further configured to establish a QP queue corresponding to the compute node and N QP queues corresponding to the N storage nodes respectively, to maintain connection information, so that one-to-N groupcast reliable communication can be achieved.
[0030] In an implementation form of the first aspect, when the intermediate device receives a read request for accessing the logical storage space, if the state of the logical storage space is in the deleting state, the intermediate device blocks the read request, or returns information that the state of the logical storage space is in the deleting state to the compute node.
[0031] The second aspect of the present application provides a method applied to the computer system provided in the first aspect of the present application, wherein each step in the method is executed by the compute node, the intermediate device and the storage node of the computer system, and the function of each step in the method is the same as the function of the compute node, the intermediate device and the storage node of the computer system, and the beneficial effects achieved are the same, which will not be described here.
[0032] The third aspect of the present application provides a data processing method executed by an intermediate device, wherein the intermediate device is connected to a compute node and a storage node, the compute node runs a service, and the storage node stores data of the service. The intermediate device stores metadata of a storage space corresponding to the data of the service. The intermediate device first receives a first write request for the data of the service sent by the compute node, then determines a first address of the storage node to which the data to be written in the first write request is written according to the metadata of the storage space, and requests the storage node to write the data to be written into the first address after the first address is determined.
[0033] By storing the metadata of the storage space of the service on the intermediate device, the compute node only needs to send a write request to the intermediate device, the intermediate device allocates an address in the storage space for the write request according to the metadata, and writes data into the storage device according to the allocated address. Since the compute node only needs to send a request to the intermediate device, the load of the compute node is reduced, and the time delay of data writing is also reduced.
[0034] The functions of other steps of the method executed by the intermediate device are the same as the functions of the intermediate device of the computer system in the first aspect and the beneficial effects, which will not be described here.
[0035] The fourth aspect of the present application provides a data processing apparatus, which is arranged in an intermediate device, the intermediate device is connected to a computing node and a storage node, the computing node runs a service, and the storage node stores data of the service, the processing apparatus comprises a plurality of modules, each module is configured to perform each step of the data processing method provided in the third aspect of the present application, and the division of the modules is not limited herein. The specific functions performed by each module of the data processing apparatus and the beneficial effects achieved are described with reference to the functions of each step of the data processing method provided in the third aspect of the present application, and will not be repeated here.
[0036] The fifth aspect of the present application provides another computer system, which comprises a computing node, a storage node and an intermediate device, the computing node accesses the storage node through the intermediate device; the computing node runs an application, and the storage node stores data of the application; the computing node is configured to specify a storage space for the data of the application, and send a first allocation request, the first allocation request is used to request a physical storage space of the storage node corresponding to the storage space; the intermediate device is configured to receive the first allocation request sent by the computing node, send a second allocation request to the storage node according to the first allocation request, obtain the physical storage space allocated by the storage node, and establish and save metadata of the application according to information of the logical storage space and information of the physical storage space.
[0037] By saving the metadata on the intermediate device and allocating the storage space in the storage node for the storage space of the application, the load of the storage node and the load of the computing node can be reduced, and the transmission efficiency of data can be improved.
[0038] In an implementation form of the fifth aspect of the present application, the first allocation request carries an identifier and a size of the logical storage space, and the metadata comprises: the identifier of the logical storage space, the size of the logical storage space, an available address of the logical storage space and address information of the physical storage space corresponding to the logical storage space.
[0039] In an implementation form, the logical storage space is a persistent log space, and the computing node specifies an identifier and a size of the persistent log space.
[0040] In an implementation form of the fifth aspect of the application, the computing node is further configured to send a first write request, the first write request carrying the first data of the application and an identifier of the logical storage space corresponding to the first data; the intermediate device is further configured to receive the first write request, determine a first physical address of the first data in the storage node according to the metadata of the application, and send a second write request to the storage node according to the first physical address; and the storage node is further configured to receive the second write request and store the first data at the first physical address.
[0041] In an implementation form of the fifth aspect of the application, after receiving the first write request, the intermediate device allocates a first logical space address to the first data according to the identifier of the logical storage space and the size of the first data, and determines the first physical address corresponding to the first logical space address according to the correspondence between the logical storage space and the physical storage space recorded in the metadata.
[0042] In an implementation form of the fifth aspect of the application, the intermediate device is further configured to receive a storage completion notification sent by the storage node, and confirm the execution completion of the first write request according to the notification.
[0043] In an implementation form of the fifth aspect of the application, the intermediate device updates the information of the metadata of the application according to the first write request.
[0044] In an implementation form of the fifth aspect of the application, the computer system includes a plurality of intermediate devices, and the computing node is further configured to select one intermediate device from the plurality of intermediate devices, and send the first allocation request or the first write request to the selected intermediate device.
[0045] The sixth aspect of the application provides a computer system, which includes a computing node, a storage node and an intermediate device, the computing node accesses the storage node through the intermediate device, the computing node is configured to send a first write request to the intermediate device, the first write request accesses a logical storage space, and the logical storage space corresponds to a storage space in the storage node; and the intermediate device is configured to receive the first write request and notify the computing node that the first write request has been completed when it is determined that all write requests received before the first write request and accessing the logical storage space have been completed.
[0046] By implementing that the write request returns the write request completion message in the order of receiving in the intermediate device, the parallel processing of the write requests of different computing nodes can be implemented, and the holes in the storage space in the storage node can be prevented.
[0047] For other functions performed by the computing system, reference can be made to the functions provided by the computer system of the first aspect, which will not be repeated here.
[0048] The seventh aspect of the present application provides an intermediate device, comprising a processing unit and a storage unit, wherein the storage unit stores executable code, and the processing unit executes the executable code to implement the method provided in the second aspect and the third aspect of the present application.
[0049] The eighth aspect of the present application provides an intermediate device, comprising: a communication interface for data transmission with a storage node and a computing node; and a processing unit for processing data received by the communication interface to execute the method provided in the second aspect and the third aspect of the present application.
[0050] The ninth aspect of the present application provides a storage medium, wherein the storage medium stores executable instructions, and a processor of an intermediate device executes the executable instructions in the storage medium to implement the method provided in the second aspect and the third aspect of the present application.
[0051] The tenth aspect of the present application provides a program product, wherein a processor of an intermediate device controls the processor to execute the method provided in the second aspect and the third aspect of the present application by running the program product. BRIEF DESCRIPTION OF DRAWINGS
[0052] The embodiments of the present application can be more clearly understood by describing the embodiments of the present application in conjunction with the accompanying drawings:
[0053] Figure 1 The architecture diagram of the computer system to which the embodiments of the present application are applied;
[0054] Figure 2 The flowchart of the method for writing data in the computer system provided by the embodiments of the present application;
[0055] Figure 3 The flowchart of the flow A performed when the remaining space of the PLOG i is insufficient;
[0056] Figure 4 The process diagram for the computing nodes C0 and C1 to write in the PLOG j in parallel;
[0057] Figure 5 The content diagram of the write request queue corresponding to the PLOG j;
[0058] Figure 6 The flowchart of the flow B performed when the remaining space of the PLOG i is sufficient;
[0059] Figure 7 The flowchart of the method for writing data in the computer system provided by another embodiment of the present application;
[0060] Figure 8 This is a schematic diagram illustrating the process of writing data in a computer system using multi-segment storage.
[0061] Figure 9 This is a schematic diagram illustrating the process of reading data in a computer system using multi-segment storage.
[0062] Figure 10 A flowchart illustrating a method for reading data in a computer system, provided in an embodiment of this application;
[0063] Figure 11 A flowchart illustrating a method for deleting data in a computer system, provided in an embodiment of this application;
[0064] Figure 12 A flowchart illustrating a method for setting data to read-only in a computer system, as provided in an embodiment of this application;
[0065] Figure 13 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0066] Figure 14 A schematic diagram of the structure of an intermediate device provided in an embodiment of this application;
[0067] Figure 15 A schematic diagram of the structure of an intermediate device provided in an embodiment of this application;
[0068] Figure 16 This is a schematic diagram of a cloud service system according to an embodiment of this application. Detailed Implementation
[0069] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0070] Figure 1 This is an architectural diagram of the computer system 100 used in the embodiments of this application. Figure 1 As shown, the computer system 100 includes a computing layer 12, a network layer 13, and a storage layer 14. The computing layer 12 includes multiple computing nodes. Figure 1 The diagram illustrates computing nodes C0, C1, and C2; network layer 13 includes multiple intermediate devices. Figure 1 The diagram illustrates intermediate devices St0 and St1; storage layer 14 includes multiple storage nodes. Figure 1The storage nodes S0, S1 and S2 are shown in the figure. The computing nodes and the storage nodes can be physical servers, or virtual machines, containers or other virtual entities based on general hardware resource abstraction. The intermediate devices can be programmable network connection devices such as switches. The computing nodes can be application servers of multiple applications (APPs) and provide service processing services for users of user terminals. The storage nodes can be used to store service data of the APPs. The service data can be stored in the storage nodes by using storage media such as memories or hard disks. The storage media in the embodiments of the present application are non-volatile memory media, which include storage class memories (SCM) and have the characteristics of large capacity, high access speed and non-volatility. The non-volatile memory media are only examples, and the embodiments of the present application are not limited to the non-volatile memory media.
[0071] In Figure 1 In the multi-node distributed computer system shown in the figure, each computing node is connected to at least one switch, and each switch is connected to multiple storage nodes, so that the computing nodes can access the multiple storage nodes through the switches. In addition, the switches are directly or indirectly connected to each other, so that the computing nodes can access the storage nodes through any switch. The connections between the computing nodes and the switches and the connections between the switches and the storage nodes can be various connection modes such as remote direct memory access (RDMA) connection mode or transmission control protocol (TCP) connection mode. The multiple computing nodes can perform write, read and other operations on the service data of the storage nodes through the switches.
[0072] In the related art, a computing node is directly connected with a storage node, and the computing node accesses a storage space in the storage node by accessing a piece of logical storage space corresponding to the storage space in the storage node. The logical storage space is, for example, a persistence log (PLOG). The PLOG is identified by a unique identifier PLOG ID of the PLOG, and stored data on the PLOG is stored in the form of append write, that is, for already stored data, a modification is not made by overwriting, but is appended to a new address. Generally, the PLOG corresponds to a piece of continuous physical storage space in an SCM, a solid state disk (SSD), or the like, in the storage node. The physical storage space is a storage space provided by the storage node to an external device, and the external device can access data by using the storage space. For the SCM or the like, the physical storage space is a physical address where data is actually stored, but for the SSD or the like, the physical storage space is not a physical address where data is actually stored.
[0073] In the related art, metadata of the PLOG is stored in the storage node, and the metadata includes an ID of the PLOG, an address of a storage space in the storage node corresponding to the PLOG, an address of unallocated space of the PLOG, and the like, and the storage node manages the PLOG by using the metadata of the PLOG. For example, when the computing node wants to write data to the storage node by using the PLOG, the computing node first requests the storage node to allocate an address for the data in the PLOG, and after the storage node allocates the address for the data in unallocated storage space in the PLOG according to the metadata of the PLOG, the allocated address is returned to the computing node. The computing node sends a write request to the storage node again after obtaining the allocated address, to write the data to the storage node. In the related art, the computing node needs to communicate with the storage node multiple times in the process of writing data to the storage node, which increases the load of the computing node and increases the latency of data writing.
[0074] In an embodiment of the present application, as Figure 1As shown, compute nodes are connected to storage nodes via a switch. The switch, acting as an intermediary device, stores and manages the metadata of the PLOG, thereby managing the PLOG. The metadata stored in the switch includes the PLOG ID, the address information of the storage space in the corresponding storage node (e.g., the starting address and length of the storage space), and the address information of the unallocated space of the PLOG (e.g., the starting address of the unallocated space). When a compute node needs to write data to the PLOG in response to a user's application operation, the compute node sends a write request to the switch. Upon receiving the write request, the switch, based on the PLOG metadata, allocates a write address in the PLOG for the write request, determines the address of the storage node to which the data to be written in the write request should be written, and sends a request to the storage node to write the data to be written to the determined address in the storage node, so that the storage node writes the data to be written to its storage space. In the technical implementation of this application embodiment, by storing the metadata of PLOG in the switch, the switch manages PLOG. In this way, when the compute node writes data to the storage node, it only needs to send a data write request to the switch, without having to send an address allocation request. This not only reduces the load on the compute node, but also reduces the latency of the write request.
[0075] In addition, after managing the PLOG, the switch processes each write request according to the order in which they are received, thereby allocating addresses in the PLOG to each write request in that order. After allocating the addresses, the switch writes the data to be written in the write request to the storage node. After the storage node finishes writing the data, the switch returns the write request according to the order in which they are received, thus preventing gaps in the storage space of the storage node corresponding to the PLOG.
[0076] The following will describe in detail the process. Figure 1 The data processing procedure performed by the computer system shown.
[0077] Figure 2 A flowchart illustrating a method for writing data in a computer system, as provided in an embodiment of this application.
[0078] like Figure 2 As shown, in step S201, the compute node first sends a write request 1 to PLOG i.
[0079] In this instruction manual Figure 2 , Figure 3 , Figure 6 , Figure 7 , Figure 10 , Figure 11 andFigure 12 In the flowchart, the computing node can be Figure 1 In the plurality of computing nodes in the computing node, the switch is the switch corresponding to the PLOG being operated, and the storage node is the storage node corresponding to the PLOG. In the embodiment of the present application, one PLOG is managed by one switch. After the computing node generates a new PLOG, the PLOG is determined to belong to a certain switch, and the determined switch is the switch corresponding to the PLOG, the metadata of the PLOG is recorded in the corresponding switch, and the PLOG is managed based on the metadata. The storage node corresponding to the PLOG is the storage node specified by the computing node for the PLOG after generating a new PLOG. The specific method of determining the switch to which the PLOG belongs can be, for example, that the computing node can perform hash calculation on the ID of the PLOG after generating a new PLOG, thereby attributing the PLOG to a certain switch, and sending the information of the PLOG to the switch to manage the PLOG by the switch. Another method of determining the switch to which the PLOG belongs can be that the computing node can send the information of the PLOG to any switch connected thereto after generating a new PLOG, thereby determining and recording the mapping relationship between the PLOG and the switch by negotiation of the plurality of switches, and then the switch receiving the PLOG information can forward the information of the PLOG to the corresponding switch based on the mapping relationship, and manage the PLOG by the corresponding switch.
[0080] Hereinafter, the computing node C0, the switch St0, the storage nodes S0, S1 and S2 will be described as an example.
[0081] Suppose Figure 2 The computing node in the computing node C0 is Figure 1 The computing node C0 is provided with a PLOG function layer, which provides a calling interface for applications, including a PLOG application interface, a PLOG write interface, and the like. When the application in the computing node C0 needs to write data into the computer system, first, the application obtains the ID of the currently writable PLOG recorded in advance from the PLOG function layer, determines that the currently writable PLOG is PLOG i, and then the application calls the write interface in the PLOG function layer, so that the computing node C0 sends a write request 1 for PLOG i to the switch.
[0082] Specifically, the application in the computing node C0 calls the write interface, passes in the identifier of the PLOG i, the storage address of the to-be-written data, and the length of the to-be-written data, the PLOG function layer calls the data sending interface of the network card according to the passed-in parameters, obtains the to-be-written data according to the storage address of the to-be-written data and the length of the to-be-written data, and sends the data packet of the write request 1 to the switch based on the to-be-written data, wherein the write request 1 includes the identifier of the PLOG i and the to-be-written data. In one implementation manner, the computing node C0 can determine the switch corresponding to the PLOG i by performing a hash operation on the "PLOG i", and send the data packet to the corresponding switch. In another implementation manner, the computing node C0 can send the data packet to any switch connected thereto, and the switch forwards the data packet to the switch corresponding to the PLOG i based on the mapping relationship between the locally stored PLOG and the switch. It is assumed that the PLOG i corresponds to the switch St0, and thus the write request 1 for the PLOG i is sent to the switch St0.
[0083] In step S202, the switch determines whether the remaining space of the PLOG i is sufficient.
[0084] As described above, the switch St0 corresponds to the PLOG i, and thus the metadata of the PLOG i is recorded in the switch St0 to manage the PLOG i through the metadata. The metadata of the PLOG i includes, for example, the identifier of the PLOG i, the address information of the PLOG i (for example, the start address of the unallocated storage space of the PLOG i and the size of the PLOG i, etc.), the address information of the storage space in the storage node corresponding to the PLOG i, and the like. Since the PLOG i is a logical storage space, the address therein is an offset address starting from 0, and thus the switch can obtain the size of the remaining space of the PLOG i by subtracting the start address of the unallocated storage space of the PLOG i from the size of the PLOG i.
[0085] After receiving the write request 1, the switch compares the length of the to-be-written data with the size of the remaining space of the PLOG i to determine whether the remaining space is sufficient for writing the to-be-written data. If the remaining space is insufficient, the switch performs Figure 3 Step S301 in the flow A shown in the figure, if the remaining space is sufficient, the switch performs Figure 6 Step S601 in the flow B in the figure. The flow A in Figure 3 and the flow B in Figure 6 will be described below.
[0086] Figure 3A flowchart of a flow A performed when the remaining space of the PLOG i is insufficient, the flow A including a process of generating a new PLOG j and writing data to be written in the PLOG j.
[0087] In step S301, the switch sends information that the PLOG i is insufficient in space to the computing node after determining that the PLOG i is insufficient in space in step S202.
[0088] In step S302, the computing node generates the PLOG j.
[0089] For example, in the computing node C0, after receiving the information that the PLOG i is insufficient in space, the application can call a PLOG application interface in the PLOG function layer to send a request of applying for a new PLOG to the PLOG function layer. In the application request, information such as the storage node corresponding to the newly applied PLOG, the size of the PLOG, and the initial state of the PLOG is specified. The initial state information is, for example, a read-write state. In a computer system, in order to ensure the reliability of data storage, the same data can be stored in multiple storage nodes, that is, each storage node stores a copy of the data, so that in the case of an abnormality of a certain storage node, the data can be obtained from other storage nodes. In this case, multiple storage nodes corresponding to the newly applied PLOG are specified in the application request. For example, the application request can specify that the newly applied PLOG corresponds to the storage nodes S0, S1 and S2, that is, the data written in the PLOG is stored in the storage nodes S0, S1 and S2 respectively.
[0090] After receiving the application for a new PLOG from the application, the PLOG function layer in the computing node C0 generates a new PLOG ID and returns the ID to the application. The newly generated PLOG ID can be represented as “PLOG j”, which is generated according to the numbering order of the PLOGs, for example, PLOG i is PLOG 1, and it is determined that “PLOG j” is PLOG 2. It can be understood that the embodiments of the present application are not limited to determining the PLOG ID according to the numbering order of the PLOGs, as long as the PLOG ID can uniquely identify the newly generated PLOG, for example, the ID of the previously deleted PLOG can be reused as the ID of the new PLOG.
[0091] In step S303, the computing node sends the metadata of the PLOG j to the switch.
[0092] After the PLOG function layer of the computing node CO generates the PLOG j as described above, in one implementation, the computing node CO can determine the switch corresponding to the PLOG j based on a predetermined rule and send the metadata of the PLOG j to the switch corresponding to the PLOG j; in another implementation, the computing node CO can send the metadata information of the PLOG j to any switch connected thereto, which makes the multiple switches negotiate to determine the switch corresponding to the PLOG j and send the metadata of the PLOG j to the switch corresponding to the PLOG j. Assuming that the switch corresponding to the PLOG j is the switch StO, i.e., the metadata of the PLOG j is sent to the switch StO. The sent metadata includes the identification of the PLOG j, the storage nodes corresponding to the PLOG j (i.e., SO, SI and S2), the size of the PLOG j, the initial state of the PLOG j and the like.
[0093] In step S304, the switch sends a storage space allocation request to the storage node.
[0094] After receiving the metadata of the PLOG j, the switch StO locally stores the metadata of the PLOG j and adds the address information of the unallocated storage space of the PLOG j, such as the start address of the unallocated storage space, in the metadata. Since the PLOG j is not used, the start address of the unallocated storage space of the PLOG j at this time is the default offset address 0.
[0095] The switch StO can record the metadata of each PLOG in the form of a table, as shown in Table 1, which is the metadata of the PLOG managed in the switch StO.
[0096] PLOG 0 Status = Delete, Offset = 200,... PLOG 1 Status = R, Offset = 100,... … PLOG j Status = RW, Offset = 0, Volume = 2M, S0: Addr = / S1: Addr = / S2: Addr =,... …
[0097] Table 1
[0098] As shown in Table 1, where "Status" represents the status of the PLOG, the status of the PLOG can include a read-write status (RW), a read-only status (R), and a deleting status (Delete), where the RW status indicates that the storage space in the storage node corresponding to the PLOG is readable and writable, the R status indicates that the storage space in the storage node corresponding to the PLOG is only readable but not writable, and the Delete status indicates that a deleting operation on the storage space corresponding to the PLOG is being performed in the storage node corresponding to the PLOG. "Offset" in Table 1 represents the start address of the unallocated storage space of the PLOG, and "Volume" represents the size of the PLOG. In addition, in the metadata of the PLOG j, "S0:Addr= / S1:Addr= / S2:Addr=" indicates that the PLOG j corresponds to the storage nodes S0, S1, and S2, and the address (Addr) corresponding to the PLOG j in the storage nodes S0, S1, and S2 has not been determined and is therefore empty.
[0099] Subsequently, the switch St0 sends a storage space allocation request to the corresponding storage node based on the storage node corresponding to the PLOG j in the metadata of the PLOG j, where the storage space allocation request includes the size of the PLOG j. The size of the PLOG j is, for example, 2 megabytes (M), and therefore the storage space allocation request is used to request allocation of 2M of storage space in the storage node. In the case of multi-copy writing of data, for example, the information of the PLOG j sent by the computing node C0 to the switch St0 specifies the storage nodes S0, S1, and S2, and therefore the switch St0 sends a storage space allocation request to the storage nodes S0, S1, and S2, respectively. Figure 3 Only one storage node is shown in FIG. 4 for illustration, and it can be understood that in the case of multi-copy writing, the corresponding multiple storage nodes will all perform the same operation as shown in the storage node. Figure 3
[0100] In step S305, the storage node allocates storage space according to the storage space allocation request and returns storage space information.
[0101] As described above, in the case of multi-copy storage, the storage nodes S0, S1, and S2 will respectively allocate local storage space for the PLOG j after respectively receiving the storage space allocation request, and return the storage space information to the switch St0. Only the operation in the storage node S0 is described as an example here. After receiving the storage space allocation request, the storage node S0 acquires a 2M size of continuous storage space that is not used in the local storage medium (for example, SCM), marks the storage space as allocated, and returns the address information (for example, the start address or the address range) of the storage space to the switch St0.
[0102] In step S306, the switch records the relationship between the PLOG j and the storage space information.
[0103] Specifically, after receiving the information of the storage space, such as the start address of the storage space, from each storage node corresponding to the PLOG j, the switch St0 records the information into the metadata of the PLOG j. Specifically, the switch St0 can record the start address of the storage space allocated for the PLOG j in the storage nodes S0, S1 and S2 into each corresponding "Addr" field in Table 1, respectively.
[0104] After completing each of the above steps, the creation process of the PLOG j is completed. After the creation process is completed, the switch can notify each computing node of the newly generated PLOG j, so that each computing node can write data to the PLOG j in parallel. Figure 4 A process diagram for the computing nodes C0 and C1 to write to the PLOG j in parallel. In order to distinguish the writing of the computing nodes C0 and C1, in Figure 4 , the operations related to the computing node C0 are shown in solid lines, and the operations related to the computing node C1 are shown in dashed lines. In addition, in Figure 4 , as described above, the metadata of the PLOG j is stored in the switch St0, Figure 4 , the PLOG j is schematically shown as a data block, and a storage space is allocated for the PLOG j in the SCM0, SCM1 and SCM2 of the storage nodes S0, S1 and S2 corresponding to the PLOG j, respectively, which is also schematically shown as a data block. In the following, the steps in Figure 4 will be described. Figure 3
[0105] In addition, when an application in the computing node is first used, the computing node will allocate an initial PLOG for the application, and allocate a storage space for the initial PLOG. The process of allocating a storage space for the initial PLOG is the same as the process of allocating a storage space for the PLOG j, and the details are described in steps S303-S306, which will not be repeated here.
[0106] In step S307, the computing node sends a write request 1' for the PLOG j to the switch.
[0107] As described above, after obtaining the newly generated PLOG j, the application in the computing node C0 can re-initiate a write request 1' for the PLOG j to write the above-mentioned unsuccessfully written to-be-written data. The write request 1' is used to distinguish from the above-mentioned write request 1 for the PLOG i. Similarly, the write request 1' includes the identification of the PLOG j and the to-be-written data.
[0108] In step S308, the switch allocates address space 1' for the write request 1' in the PLOG j.
[0109] When the switch allocates the address space 1' for the write request, the write requests from multiple computing nodes can be concurrently controlled, please refer to Figure 4 , assuming that the computing node C0 sends the write request 1' to the computing node St0 for the PLOG j in operation ①, and the computing node C1 sends the write request 1" to the switch St0 for the PLOG j in operation ②, the switch St0 processes the write requests according to the order of the received write requests based on the flow line mechanism. Assuming that the switch St0 first receives the write request 1', therefore, the switch St0 can first allocate the address space 1' for the write request 1' in the PLOG j, wherein the address space 1' can also be represented as address 1'. Generally, the address space is represented by a start address and the length of the address space, therefore, when the switch St0 allocates the address space 1' for the write request 1', first, the start address offset1 of the unallocated address space in the PLOG j is obtained from the metadata of the PLOG j, and the offset1 is taken as the start address of the write request 1', thus, the address space 1' allocated for the write request 1' is the address space with the offset1 as the start address and the length of the to-be-written data. After the address space 1' is allocated for the write request 1', the switch St0 updates the offset of the PLOG j in the metadata as offset1 plus the length of the to-be-written data. For example, assuming that the value of the offset is 10 before the address space is allocated for the write request 1', that is, 10 bytes of address space have been allocated for other write requests in the PLOG j, therefore, the start address of the unallocated address space in the PLOG j is 10. Assuming that the length of the to-be-written data of the write request 1' is 10 bytes, the write address space allocated for the write request 1' by the switch St0 is 10-19. Then, the switch St0 updates the value of the variable offset in the metadata of the PLOG j as 10+10=20, that is, the start address of the unallocated address space in the PLOG j is 20. When the switch St0 allocates the write address space for the write request 1" after the write request 1' is processed, the address space 20 is taken as the start address to allocate the address space for the write request 1".
[0110] In the embodiment of the present application, the switch allocates the write address space for each write request according to the receiving order of the write requests, thereby realizing the mutual exclusion of the write address space allocation of each write request, so that for the concurrent write requests of different computing nodes, the mutual exclusion lock does not need to be set, and the concurrent control of the access to the same PLOG by different computing nodes can be realized, thereby achieving higher processing efficiency.
[0111] At step S309, the switch determines the address space 2' in the storage node corresponding to the address space 1'.
[0112] In an implementation, the switch can calculate the start address of the address space 2' in the storage node corresponding to the address space 1' based on the start address offset1 of the address space 1' and the start address of the storage space in the storage node corresponding to the PLOG j, and can determine the length of the address space 2' as the length of the data to be written in the write request 1'. For the case of multi-copy writing, the switch St0 can determine the address space 2' in the storage nodes S0, S1 and S2 respectively corresponding to the address space 1'. For example, assuming that the start address of the storage space in the storage node S0 corresponding to the PLOG j is 100, and the start address of the address space 1' is 10 as described above, the start address of the address space 2' is 100 + 10 = 110. The switch St0 can similarly calculate the start address of the address space 2' in the storage nodes S1 and S2 corresponding to the address space 1'.
[0113] It can be understood that in the above embodiment, the address space 2' is determined by determining the start address and the length of the address space 2', and the embodiments of the present application are not limited thereto, and other ways of determining the address space 2' are also within the protection scope provided by the embodiments of the present application.
[0114] At step S310, the switch sends a write request 2' for the address space 2' to the storage node.
[0115] After determining the start address of the address space 2' in the corresponding storage node corresponding to the address space 1', the switch generates a write request 2' for writing to the corresponding storage node, which includes the information (e.g. the start address) of the address space 2' and the data to be written in the write request 1'. Specifically, referring to Figure 4 , the switch St0 generates a write request 2' with respect to the storage nodes S0, S1 and S2 respectively, and sends the write request 2' to the storage nodes S0, S1 and S2 at operations ③, ④ and ⑤ respectively in the figure, so that the data to be written in the address space 2' is written in the respective storage spaces of the SCM0, SCM1 and SCM2. Figure 4write request 1' in the address space 2' of the data strip in the PLOG j. In the RDMA connection mode, the switch St0 maintains the connection information by establishing a QP queue corresponding to the computing node and three QP queues respectively corresponding to the storage nodes S0, S1 and S2, and implements one-to-three-group multicast reliable communication. The switch St0 copies the to-be-written data of the write request 1' into three pieces of data, and generates three write requests 2' based on the three pieces of data, so that the computing node C0 only needs to send one write request to the switch St0, and the effect of writing to the three storage nodes is achieved. Compared with the manner in which the computing node generates one write request for each storage node in the related art, the number of write requests sent from the computing node C0 is greatly reduced, thereby reducing the data transmission amount of the computing node C0.
[0116] As can be seen from steps S308-S310, since the metadata of the PLOG j is stored in the switch, the computing node only needs to send the write request 1' to the switch St0, and the switch St0 allocates the address space 1' for the write request 1' according to the metadata of the PLOG j. After the address space 1' is allocated for the PLOG j, the switch St0 does not need to return the allocated address to the computing node C0, thereby effectively reducing the load of the computing node C0 and reducing the data write delay, and thereby improving the processing efficiency of the computer system.
[0117] After sending the write request 2' corresponding to the write request 1', the switch St0 can record the write request 1' in the local write request queue corresponding to the PLOG j, so as to return the write request according to the receiving order of the write request after the data is written to the storage node. The specific returning manner will be described in detail below.
[0118] After step S310 is executed, the switch St0 can start processing the write request 1'' described above, that is, allocating the address space 1'' in the PLOG j for the write request 1'', determining the start address of the address space 2'' corresponding to the address space 1'' in the storage node, and sending the write request 2'' for the address space 2'' to the storage node, as shown in operations ⑥, ⑦ and ⑧ in FIG. 6. Figure 4 As shown in operations ⑥, ⑦ and ⑧ in FIG. 6, the switch St0 can send the write request 2'' to the storage nodes S0, S1 and S2 respectively, so as to write the to-be-written data in the write request 1'' to each storage node. For example, in the storage node S0, after operation ⑥ is executed, the writing to the address space 2' and the writing to the address space 2'' can be executed in parallel, without waiting for the writing to the address space 2' to be executed before executing the writing to the address space 2''. Similarly, after sending the write request 2'' corresponding to the write request 1'', the write request 1'' can be recorded in the write request queue.
[0119] Figure 5A diagram of the content of the write request queue corresponding to PLOG j. As shown in Figure 5 The write request queue records the IDs (Request IDs) of the write requests that access PLOG j but have not been completed. Switch St0 records each write request in the write request queue according to the time sequence of receiving the write requests. When a new write request is received, switch St0 records the ID of the write request at the tail of the write request queue. When a write request is completed, for example, after receiving a write completion confirmation message of the write request from a storage node, if it is determined that the ID of the write request is at the head of the write request queue, switch St0 returns a write request completion message to the computing node that sent the write request and removes the ID of the write request from the write request queue. For example, in the queue shown in Figure 5 The head of the queue corresponds to the write request that accesses PLOG j and is received earliest among the write requests that have not been completed, and the tail of the queue corresponds to the write request that accesses PLOG j and is received latest among the write requests that have not been completed. For example, Request ID 5 is the ID of write request 1', and Request ID 6 is the ID of write request 1".
[0120] It can be understood that the form of the write request queue is not limited to that shown in Figure 5 For example, the queue can include the number of copies of the write request in addition to the ID of the write request. When the number of copies of the write request is included in the write request queue, switch St0 can determine whether all the storage nodes corresponding to the write request have returned the write request based on the number of copies, without needing to additionally query the number of copies. For example, the number of copies of write request 1' is recorded in the write request queue as 3, when write request 1' is at the head of the write request queue, and when all three storage nodes corresponding to write request 1' have returned the write request, switch St0 returns a write request 1' completion message to computing node C0. In another implementation, the write request queue can include the offset address of each write request. The offset address is the start address of the address space allocated to each write request in PLOG j. As described above, the size of the offset address allocated to a write request is related to the time at which the write request arrives at the switch, and the earlier the write request arrives at the switch, the smaller the offset address allocated to the write request. Therefore, the offset addresses allocated to each write request can be arranged in the write request queue in ascending order, and each offset address corresponds to a write request. For example, when a new write request is received, switch St0 records the offset address of the write request at the tail of the write request queue. When a write request completion confirmation message is received from a storage node corresponding to the write request, if it is determined that the offset address of the write request is at the head of the write request queue, switch St0 returns a write request completion message to the computing node that sent the write request and removes the offset address of the write request from the write request queue.
[0121] In step S311, the storage node writes the to-be-written data into the address space 2' in the storage node.
[0122] After receiving the write request 2', the storage node writes the to-be-written data into the address space 2' in the storage space corresponding to the PLOG j in response to the write request 2'. Referring to Figure 4 In the storage nodes S0, S1 and S2, the to-be-written data is written into the address space 2' in the corresponding storage space in the SCM0, SCM1 and SCM2 respectively.
[0123] In step S312, the storage node returns the write request 2' completion information to the switch.
[0124] After the storage nodes S0, S1 and S2 write the to-be-written data in the write request 1' into the address space 2' in the storage space respectively, the storage nodes S0, S1 and S2 return the write request 2' completion information to the switch St0 respectively.
[0125] In step S313, the switch determines that the write requests accessing the PLOG j received before the write request 1' have all been completed.
[0126] After the switch St0 receives the write request 2' completion information from the storage nodes S0, S1 and S2 respectively, it indicates that the to-be-written data in the write request 1' has been written into the three storage nodes corresponding to the PLOG j. By controlling the in-order writing of the write requests accessing the PLOG j into the address space of the PLOG j, the storage space of the storage nodes corresponding to the PLOG j can be prevented from having holes. In the embodiment of the present application, the in-order writing of the write requests into the address space of the PLOG j is realized by returning the write requests to the computing nodes according to the order in which the write requests accessing the PLOG j are received by the switch. Since the switch St0 allocates the address space in the PLOG j to each write request accessing the PLOG j according to the order in which the write requests are received, the write request received earlier is allocated an address smaller in the address space, and by returning the write requests to the computing nodes according to the order in which the write requests are received, i.e. according to the order of the write addresses of the write requests from small to large, the write requests can be written in order in the address space of the PLOG j, and the storage space of the storage nodes corresponding to the PLOG j can be prevented from having holes.
[0127] In the embodiment of the present application, the write request can be returned to the computing node based on Figure 5The write request queue is shown. The write request 1' is determined to have been completed before the write request received by the PLOG j. For example, the ID of the write request 1' is Request ID 5. When the Request ID 5 becomes the head of the write request queue, it indicates that the write request 1' is the earliest write request received in the write request queue, and thus it is determined that the write requests received before the write request 1' have all been completed. If the switch St0 determines that the Request ID 5 is not the head of the write request queue after receiving the write request 2' completion information received by the storage nodes S0, S1 and S2, it waits until the Request ID 5 becomes the head of the write request queue, and then it is determined that the write requests received before the write request 1' have all been completed. It should be understood that the embodiments of the present application are not limited to the manner of determining that the write requests received before the write request 1' have all been completed by means of the write request queue, and other manners of determining that the write requests received before the write request 1' have all been completed are also within the protection scope of the embodiments of the present application.
[0128] In step S14, the switch returns the relevant information of the write request 1' to the computing node.
[0129] After determining that the write requests received before the write request 1' have all been completed, the switch St0 returns the relevant information of the write request 1' to the computing node C0, which includes the write request 1' completion information and the write address in the PLOG j assigned to the write request 1'. After returning the relevant information of the write request 1' to the computing node, the switch St0 deletes the ID of the write request 1' from the write request queue.
[0130] Specifically, in one implementation, after determining that the write requests received before the write request 1' have all been completed, the switch St0 returns the confirmation information to the computing node C0, which indicates that the write request 1' has been completed. After receiving the confirmation information, the computing node C0 sends a read request to the switch St0 to read the relevant information of the write request 1'. After receiving the read request, the switch St0 returns the write request 1' completion information and the write address to the computing node C0. In another implementation, after determining that the write requests received before the write request 1' have all been completed, the switch St0 can directly return the write request 1' completion information and the write address to the computing node C0.
[0131] After receiving the successful completion information of write request 1′, the application in compute node C0 records the write address (i.e., PLOG j, address space 1′) of write request 1′ in the service that generated write request 1′, so as to facilitate subsequent services to read the data written to the write address. When the application in compute node C0 needs to read the data written through the above-mentioned write request 1′, it can send a read request to switch St0 for address space 1′ of PLOG j. Switch St0 can read the data from address space 2′ corresponding to address space 1′ in any one of the storage nodes S0, S1 and S2 based on the metadata of PLOG j, and return the data to compute node C0.
[0132] Figure 6 This is a flowchart of process B, which is executed when there is sufficient remaining space in PLOG i. Process B includes the writing process in PLOG i.
[0133] In step S601, when the switch is Figure 2 After determining in step S202 that there is sufficient remaining space in PLOG i, the switch can determine that the data to be written in write request 1 can be written to PLOG i. Therefore, the switch allocates address space 1 in PLOG i for write request 1. In step S602, the switch determines address space 2 in the storage node corresponding to address space 1 based on the metadata of PLOG i. Similar to the above, this storage node is at least one storage node corresponding to PLOG i. In step S603, the switch sends write request 2 to storage space 2 to the storage node. In step S604, the storage node writes to storage space 2. In step S605, the storage node returns completion information for write request 2. In step S606, the switch determines that all write requests to PLOG i received before write request 1 have been completed. In step S607, the switch returns relevant information for write request 1 to the compute node. The method of writing data in write request 1 in PLOG i in steps S601 to S607 is similar to... Figure 3 The method of writing the data of write request 1' in PLOG j is the same. For details, please refer to the description of steps S308 to S314 above, which will not be elaborated here.
[0134] Similar to the above, after obtaining the successful completion information of write request 1, the application in the compute node records the write address (i.e., PLOG i, address space 1) of write request 1 in the service that generated write request 1, so as to facilitate subsequent services to read the data written to the write address.
[0135] The data write method provided by the embodiments of the present application is described above mainly by taking the multi-copy storage mode to ensure data reliability as an example. The embodiments of the present application can also be applied to a scenario of ensuring data reliability by storing data in fragments, for example, a scenario of ensuring the reliability of written data by using a Redundant Arrays of Independent Disks (RAID) algorithm and Erasure Coding (EC). Figure 7 as shown in the flowchart and Figure 8 as shown in the schematic diagram.
[0136] As shown in Figure 7 , first, in step S701, the compute node sends a write request 1 for PLOG i to the switch, where the write request 1 is used to write data 1.
[0137] The write request 1 includes, for example, the identifier of PLOG i and the data 1 to be written.
[0138] In step S702, after receiving the write request 1, the switch obtains multiple fragments of the data to be written in the write request 1.
[0139] After receiving the write request 1, the switch can divide the data 1 to be written in the write request 1 into multiple data fragments according to a preset EC algorithm or RAID algorithm, and calculate the check fragments of the multiple data fragments. Alternatively, the compute node can divide the data 1 into multiple data fragments and calculate the check fragments of the multiple data fragments before sending the write request 1, and include the data fragments and check fragments of the data 1 in the sent write request 1, so that the switch can directly obtain the multiple data fragments and check fragments of the data 1 from the write request 1. Referring to Figure 8 , the switch can divide the data 1 into two data fragments D1 and D2 (shown as white small rectangles in Figure 8 ) of the same size, and calculate one check fragment C1 (shown as a gray small rectangle in Figure 8 ) of the two data fragments based on the EC algorithm or RAID algorithm, thereby obtaining three fragments D1, D2 and C1 of the data 1, and the data lengths of the three fragments are consistent. The three fragments of the data 1 are in the form of 2 data fragments + 1 check fragment, so that when the three fragments are respectively stored in three storage nodes, one node in the three storage nodes can be abnormal. Specifically, data 1 can be directly spliced by D1+D2, and if the storage node storing D1 is abnormal, data 1 can be recovered by D2+C1 based on the EC algorithm or RAID algorithm.
[0140] In step S703, the switch determines whether the remaining space of PLOG i is sufficient.
[0141] In this embodiment, each shard of data 1 is stored in each storage node respectively, instead of storing data 1. Therefore, in this step, it is determined whether the remaining space of PLOG i is enough to store one shard of data 1. If the space is not enough, the process A shown in FIG. 1 is performed. Figure 3 If the space is enough, the process B shown in FIG. 2 can be performed. Figure 6
[0142] When the process A is performed in this method, it is different from the method shown in FIG. 1 in that, when allocating the address in PLOG j for the write request 1' in switch St0, the address (address space 1') is allocated based on the size of each shard. Figure 2 In addition, when storing data in each storage node, each shard is stored in the address space 2' corresponding to the address space 1' in each storage node, instead of storing data 1 in the address space 2'. By storing data 1 in the storage system in this way, compared with the multi-copy storage mode, the amount of data storage is reduced, and the storage medium resources are saved. Figure 8
[0143] Similarly to the above, after each shard of data 1 is written into the storage node, the switch St0 returns the success completion information and the write address of the write request 1' to the computing node C0. Therefore, the application in the computing node C0 records the write address (i.e. PLOG j, address space 1') of the write request 1' in the service generating the write request 1' after obtaining the success completion information of the write request 1', so as to facilitate the subsequent service to read the data written in the write address.
[0144] Figure 9 The process diagram for reading data in the computer system by the multi-shard storage mode. Referring to FIG. 3, Figure 9 When the application in the computing node C0 wants to read the above stored data 1, the computing node can send a read request to the address space 1' of PLOG j to the switch St0. The switch St0 can read the data shards D1 and D2 of data 1 from the respective address space 2' corresponding to the address space 1' of each storage node S0 and S1, obtain data 1 by splicing data shards D1 and D2, and return data 1 to the computing node C0.
[0145] By storing the metadata of the storage space of the service on the intermediate device, the intermediate device manages the storage space of the service through the metadata, so that when writing data, the computing node only needs to send a write request to the intermediate device, and the intermediate device allocates an address in the storage space for the write request according to the metadata, and writes data into the storage device according to the allocated address. Since the computing node only needs to send a request to the intermediate device, the load of the computing node is reduced, and the time delay of data writing is also reduced.
[0146] In addition to running the control logic of concurrent writing through the switch in the embodiments of the present application, other control processes of PLOG can also be run through the switch. Hereinafter, the control process of avoiding concurrent conflict of read request and delete request will be described with reference to Figure 10 and Figure 11 The control process of avoiding concurrent conflict of write request and read-only setting request will be described with reference to Figure 12 The control process of avoiding concurrent conflict of write request and read-only setting request will be described with reference to
[0147] Figure 10 A flowchart of a method for reading data in a computer system is provided in the embodiments of the present application, which can avoid concurrent conflict of read request and delete request.
[0148] As shown in Figure 10 , in step S1001, the computing node generates a read request 1, which includes PLOG i corresponding to the data to be read and address space 1.
[0149] For example, with reference to Figure 1 , the computing node C0 can receive a request for writing data (i.e. data 1) of the write request 1 from the user terminal, and then the computing node C0 can generate the read request 1 in response to the request of the user terminal. Specifically, the computing node C0 can generate the read request 1 based on the pre-recorded write address of the write request 1, which includes PLOG i and address space 1, and the address space 1 includes, for example, the start address of the address space 1 and the length of the address space 1.
[0150] In step S1002, the computing node sends the read request 1 to the switch.
[0151] As described above, for example, PLOG i corresponds to the switch St0, so the computing node C0 sends the read request 1 to the switch St0.
[0152] In step S1003, the switch determines that PLOG i is readable.
[0153] Referring to the description of Table 1 above, the metadata corresponding to each PLOG is recorded in the switch St0, which includes the state of the PLOG, such as the read-write state, the read-only state, and the deleting state. That is, the switch St0 can determine whether the PLOG i is readable by querying the state of the PLOG i in the metadata of the PLOG i recorded locally. If the state of the PLOG i is the read-write state or the read-only state, the PLOG i is readable, and the following steps S1004-S1010 can be continued. Figure 10 If the state of the PLOG i is the deleting state, the PLOG i is not readable, so the switch St0 will block the read request 1 or return the information that the PLOG i is in the deleting state to the computing node C0.
[0154] In step S1004, the switch updates the information of the read request for accessing the PLOG i being executed according to the read request 1.
[0155] In the switch, the information of the read request for accessing the PLOG i being executed is recorded, and the switch updates the information of the read request for accessing the PLOG i being executed when receiving the read request and when completing the read request. By recording the information of the read request for accessing the PLOG i being executed, when the switch receives a delete request for the PLOG i sent by another computing node while the switch has not completed the processing of the read request for accessing the PLOG i, the switch can block the delete request based on the information of the read request for accessing the PLOG i being executed.
[0156] Specifically, the information of the read request for accessing the PLOG i being executed is the number of the read requests for accessing the PLOG i being executed by the switch, denoted by variable a. After the switch receives the read request 1, the value of the variable a is increased by 1, and the value of the variable a is decreased by 1 after completing each read request.
[0157] In step S1005, the switch determines the address space 2 corresponding to the address space 1 in the storage space. This step can refer to the description of step S309 above, which will not be repeated here.
[0158] In step S1006, the switch sends a read request 2 for the address space 2 to the storage node. The read request 2 includes the information of the address space 2, such as the start address of the address space 2 and the length of the address space 2.
[0159] In step S1007, after receiving the read request 2, the storage node reads the address space 2 according to the read request 2.
[0160] In step S1008, the storage node returns the read data (i.e., the data 1) to the switch.
[0161] In step S1009, the switch updates the information of the read request for accessing PLOG i that is being executed.
[0162] After receiving read request 2 from the storage node, switch St0 indicates that the read operation on address space 2 in the storage node has been completed. It then updates the information of the currently executing read request to access PLOG i, that is, switch St0 can decrement the value of variable a by 1.
[0163] In step S1010, the switch returns the read data to the computing node.
[0164] Switch St0 can return the read data 1 to compute node C0, and compute node C0 can then return data 1 to the user terminal.
[0165] Figure 11 This is a flowchart of a method for deleting data in a computer system according to an embodiment of this application. This method can avoid concurrent conflicts between read requests and delete requests.
[0166] like Figure 11 As shown, in step S1101, the compute node sends a deletion request for PLOG i to the switch.
[0167] In one implementation, multiple upper-layer applications run on compute node C0. Each application requests its own PLOG to store the data it generates; that is, in this case, a PLOG corresponds to only one application. Each application's PLOG has a different lifespan depending on the application's settings and the type of data recorded. For example, PLOG i records a user's browsing history, and the application is configured to retain this history for one week. Therefore, PLOG i has a lifespan of one week and will be deleted after one week. Thus, in compute node C0, when the lifespan of PLOG i ends, a deletion request for PLOG i can be sent to switch St0.
[0168] In addition, compute nodes can also generate deletion requests for PLOG i based on user deletion operations.
[0169] In step S1102, after receiving the delete request for PLOG i, the switch determines that there is no ongoing read request for PLOG i.
[0170] After receiving the delete request for PLOG i, switch St0 needs to determine whether there is a read request for PLOG i in progress at present. If there is a read request for PLOG i in progress at present, the delete request is suspended. After the delete request is suspended, for example, polling can be continued to determine whether there is a read request in progress, i.e. polling the value of the above-mentioned variable a to determine whether the value of variable a becomes 0, until it is determined that the value of variable a is 0 (i.e. it is determined that there is no read request in progress), and then the subsequent steps in Figure 11 are continued, so as not to conflict with the read request in progress.
[0171] In step S1103, the switch records PLOG i as being in the delete state.
[0172] After determining that there is no read request for PLOG i in progress, switch St0 can record the state of PLOG i as being in the delete state in the metadata of PLOG i shown in Table 1, so as to block subsequent read requests for PLOG i as described above.
[0173] In step S1104, the switch determines the storage space corresponding to PLOG i.
[0174] Switch St0 can determine the storage nodes corresponding to PLOG i and the storage space corresponding to PLOG i in each storage node based on the metadata of PLOG i. Specifically, the storage space corresponding to PLOG i in each storage node can be determined by determining the start address of the storage space corresponding to PLOG i in each storage node and the size of the storage space.
[0175] In step S1105, the switch sends a delete request for the storage space to the storage nodes.
[0176] Switch St0 sends a delete request for the storage space corresponding to PLOG i to storage nodes S0, S1 and S2 corresponding to PLOG i, respectively. The delete request includes, for example, the start address of each corresponding storage space in storage nodes S0, S1 and S2 and the size of the storage space.
[0177] In step S1106, the storage nodes delete the storage space.
[0178] After receiving the delete request, respectively, storage nodes S0, S1 and S2 each delete the storage space. For example, in storage node S0, the storage space is determined based on the start address and size of the storage space in the delete request, the data already stored in the storage space is deleted, and the record allocated to the storage space is cancelled, so that the storage space can be used for re-allocation to other PLOGs.
[0179] In step S1107, the storage node returns a message indicating successful deletion.
[0180] After deleting the storage space, storage nodes S0, S1 and S2 respectively return deletion success information to switch St0.
[0181] In step S1108, the switch deletes the information of PLOG i.
[0182] Based on the information of the storage node corresponding to PLOG i recorded in the metadata of PLOG i, after confirming that storage nodes S0, S1 and S2 have all returned deletion success information, switch St0 can delete the record of the metadata of PLOG i in Table 1, thereby completing the deletion of PLOG i.
[0183] In step S1109, the switch returns a deletion success message to the computing node.
[0184] After deleting the metadata of PLOG i, switch St0 returns a deletion success message to compute node C0, thus compute node C0 can delete the stored information related to PLOG i.
[0185] Thus, after receiving the deletion request for PLOGi sent by the computing node, if there is no conflict with PLOGi, for example, if there is no read request to access PLOGi, the intermediate device sets the status of PLOGi to deletion and instructs the storage node to delete the physical storage space corresponding to the logical storage space.
[0186] Figure 12 The flowchart illustrates a method for setting data to read-only in a computer system, as provided in this application embodiment. This method can avoid concurrent conflicts between read-only setting requests and write requests.
[0187] like Figure 12 As shown, firstly, in step S1201, the compute node sends a read-only configuration request for PLOG i to the switch.
[0188] For example, in such Figure 6 When performing a write operation on PLOG i, assuming that after switch St0 sends write request 2 to address space 2 in step S603, due to an anomaly in the storage node, switch St0 does not receive completion information for write request 2 from the storage node, and therefore does not return write request 1 completion information to compute node C0. In this case, after compute node C0 does not receive write request 1 completion information within a preset time, it can determine that write request 1 has failed and send a read-only setting request for PLOG i to switch St0.
[0189] At step S1202, the switch determines that there is no ongoing write request to PLOG i.
[0190] After receiving the read-only setting request to PLOG i, the switch St0 needs to determine first whether there is an ongoing write request to PLOG i. If there is a write request, the read-only setting request conflicts with the write request, and the switch St0 suspends the execution of the read-only setting request. After determining that there is an ongoing write request to PLOG i, the switch St0 can continue polling to determine whether there is an ongoing write request until determining that there is no ongoing write request, and then proceed with the read-only setting request.
[0191] Specifically, similar to the above, the switch St0 can update the information of the ongoing write request to PLOG i after each time starting to execute a write request to PLOG i sent by a compute node (e.g., write request 1 in Figure 6 The information of the ongoing write request to PLOG i can be the number of write requests to PLOG i that the switch is executing, denoted by variable b. After the switch receives write request 1, the value of variable b is incremented by 1, and after each write request is completed, the value of variable b is decremented by 1. Thus, the switch St0 can determine whether there is an ongoing write request to PLOG i based on the value of variable b. If the value of variable b is 0, it can be determined that there is no ongoing write request to PLOG i.
[0192] At step S1203, the switch modifies the state of PLOG i to a read-only state.
[0193] After determining that there is no ongoing write request to PLOG i, the switch St0 modifies the state of PLOG i to a read-only state in the metadata of PLOG i. Thus, when the switch St0 subsequently receives a write request to PLOG i, the write request can be blocked based on the read-only state of PLOG i.
[0194] At step S1204, the switch returns read-only setting success information to the compute node.
[0195] In this way, when the intermediate device receives a read-only setting request to PLOG i sent by a compute node, the state of PLOG i is set to a read-only state if there is no conflict, e.g., no write request to PLOG i.
[0196] Referring to the above description of Figure 10 - Figure 12As can be seen from the description of the method, the switch can provide consistent PLOG information to each computing node by maintaining state information and IO information of the PLOG, and can perform concurrent logical control based on the consistent information.
[0197] In the embodiments of the present application, the control logic originally run by the computing node or the storage node is offloaded to the programmable intermediate device as a network convergence point, and the computing node only needs to communicate with the switch once in the process of writing data, so that the computing node can write data to the storage node, the communication frequency between the computing node and the switch is effectively reduced, the load of the computing node is reduced, the data writing latency is reduced, and the access efficiency is improved.
[0198] Figure 13 A structural schematic diagram of a data processing apparatus 1300 is provided in the embodiments of the present application, the apparatus 1300 is deployed in an intermediate device, the intermediate device is connected to a computing node and a storage node, the computing node runs a service, and the storage node stores data of the service; the apparatus is used for executing the above-mentioned Figure 2 ~ Figure 12 The data processing method, the apparatus 1300 includes:
[0199] A receiving unit 131 is configured to receive a first write request for data of the service sent by the computing node;
[0200] A determining unit 132 is configured to determine a first address at which the to-be-written data in the first write request is to be written to the storage node; and
[0201] A writing unit 133 is configured to request the storage node to write the to-be-written data to the first address.
[0202] In an implementation manner, the first write request accesses a logical storage space corresponding to the data of the service, the intermediate device saves metadata of the logical storage space, the metadata of the logical storage space includes an identifier of the logical storage space, address information of the logical storage space, and address information of a physical storage space corresponding to the logical storage space, the physical storage space belongs to a space in the storage node, and the first address is an address in the physical storage space.
[0203] In an implementation manner, the determining unit 132 is further configured to: allocate a second address in the logical storage space for the first write request; and determine the first address in the physical storage space corresponding to the logical storage space according to the metadata of the logical storage space.
[0204] In an implementation manner, the receiving unit 131 is further configured to receive a notification message sent by the storage node, the notification message being used to notify that the to-be-written data has been written completely; and the apparatus 1300 further includes a notifying unit 134 configured to notify the computing node that the first write request has been completed when it is determined that other write requests for the logical storage space received before the first write request have been completed.
[0205] In an implementation manner, the apparatus 1300 further includes an allocating unit 135 configured to request the storage node to allocate a physical storage space for the logical storage space according to the information of the logical storage space received from the computing node.
[0206] In an implementation manner, the determining unit 132 is configured to allocate the second address for the first write request in ascending order of address from the unallocated space of the logical storage space.
[0207] In an implementation manner, the storage node includes a first storage node and a second storage node, the second address corresponds to a first address in the first storage node where the to-be-written data is written and a first address in the second storage node where the to-be-written data is written, and the writing unit 133 includes a first writing sub-unit 1331 configured to request the first storage node to write the to-be-written data into the first address in the first storage node where the to-be-written data is written, and a second writing sub-unit 1332 configured to request the second storage node to write the to-be-written data into the first address in the second storage node where the to-be-written data is written.
[0208] In an implementation manner, the apparatus 1300 further includes a conflict processing unit 136 configured to, when receiving a read-only setting request for the storage space from the computing node, set the state of the storage space to a read-only state if it is determined that there is no conflict in the logical storage space.
[0209] In an implementation manner, the apparatus 1300 further includes a conflict processing unit 136 configured to, when receiving a deletion request for the storage space from the computing node, set the state of the logical storage space to a deletion-in-process state and request the storage node to delete the physical storage space corresponding to the logical storage space if it is determined that there is no conflict in the logical storage space.
[0210] In an implementation manner, the apparatus 1300 further includes an obtaining unit 137 configured to obtain N shards of to-be-written data in the first write request after receiving the first write request sent by the computing node, and the writing unit 133 is configured to request N storage nodes to write the N shards into first addresses of the N storage nodes respectively.
[0211] Figure 14 A structural schematic diagram of an intermediate device 1400 is provided for an embodiment of the present application. As shown in the figure, the intermediate device 1400 comprises a storage unit 141 and a processing unit 142, the storage unit 141 stores executable codes, and the processing unit 142 executes the executable codes to implement the data processing method described above with reference to Figure 14 . Figure 2 ~ Figure 12
[0212] Figure 15 A structural schematic diagram of an intermediate device 1500 is provided for an embodiment of the present application. As shown in the figure, the intermediate device 1500 comprises a communication interface 151 for data transmission with storage nodes and computing nodes, and a processing unit 152 for processing data received by the communication interface to execute the data processing method described above with reference to Figure 15 . Figure 2 ~ Figure 12
[0213] It can be understood that the computing nodes and storage nodes described above can be physical servers or cloud servers (e.g. virtual servers).
[0214] Figure 16 A structural schematic diagram of a cloud service system 1600 is provided for an embodiment of the present application. As shown in the figure, the system 1600 comprises a computing device 1601, a storage device 1602 and an intermediate device 1603. The computing device 1601 comprises a hardware layer 16016, a virtual machine monitor (VMM) 16011 running on the hardware layer 16016, and a plurality of virtual machines (VM i ) 16012. Any of the virtual machines 16012 can serve as a virtual computing node of the cloud service system 1600. The storage device 1602 comprises a hardware layer and a virtual machine monitor (VMM) running on the hardware layer, and a plurality of virtual machines (VM j ), any of the virtual machines can serve as a virtual storage node of the cloud service system 1600. The composition of the computing device 1601 will be described in detail below as an example. Figure 16 Specifically, the virtual machine 16012 is a virtual computer (server) simulated on a public hardware resource by a virtual machine software, and the virtual machine can install an operating system and an application program, and access network resources. For an application program running in the virtual machine, the virtual machine is like working in a real computer.
[0215]
[0216] The hardware layer 16016 is a hardware platform on which the virtualization environment runs, which can be abstracted from hardware resources of one or more physical hosts. The hardware layer can include a variety of hardware, for example, the hardware layer 16016 includes a processor 16014 (such as a CPU) and a memory 16015, and can also include a network card (i.e., a NIC) 16013, high-speed / low-speed input / output (I / O) devices, and other devices with specific processing functions. The memory 16015 can be a volatile memory, such as a random-access memory (RAM), a dynamic random-access memory (DRAM); the memory 16015 can also be a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), a solid-state drive (SSD), a storage class memory (SCM), etc.; the memory 16015 can also include a combination of the above types of memories. The virtual machine 16012 runs executable programs based on the VMM 16011 and the hardware resources provided by the hardware layer 16016 to implement the method steps performed by the computing node in the above embodiments. For brevity, details are not repeated here.
[0217] It should be understood that the descriptions "first", "second", etc. in the present text are only for the sake of simple description of similar concepts, and do not have other limiting effects. Those of ordinary skill in the art should further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application. The above description is only a preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed by the present application can be easily thought of by those skilled in the art, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A computer system, characterized in that, It includes compute nodes, storage nodes, and network devices, wherein the compute nodes access the storage nodes through the network devices; The computing nodes are used to run the business, and the storage nodes are used to store the data of the business. The network device is used to manage the logical storage space and metadata corresponding to the data of the service. The network device is also used to receive access requests sent by the computing node to access the business data corresponding to the storage node; The network device is further configured to determine the storage address of the service data in the storage node corresponding to the logical storage space based on the access request and the metadata, so as to store the service data in the storage address of the storage node or retrieve the service data from the storage address of the storage node.
2. The system according to claim 1, characterized in that, The network device is also used to set up multiple storage nodes for the logical storage space, and the multiple storage nodes include storage nodes of different types.
3. The system according to claim 1, characterized in that, The network device is also used to perform network packet processing on the data packets corresponding to the access request.
4. The system according to claim 1, characterized in that, The metadata includes the identifier of the logical storage space, the address information of the logical storage space, and the address information of the physical storage space corresponding to the logical storage space, wherein the physical storage space belongs to the storage space in the storage node.
5. The system according to claim 1, characterized in that, The computing node and the storage node include multiple network devices. The computing node is also used to designate a first network device for the logical storage space among the multiple network devices. The first network device is used to store the metadata.
6. The system according to claim 5, characterized in that, The computing node selects the first network device from the plurality of network devices based on the identifier of the logical storage space.
7. The system according to claim 1, characterized in that, The logical storage space is a persistent log space.
8. The system according to claim 4, characterized in that, The access request is a write request, and the write request carries the data to be written and the identifier of the logical storage space; The network device is specifically used to allocate a first address in the logical storage space to the data to be written according to the identifier of the logical storage space, determine a second address in the physical storage space corresponding to the first address, and request the storage node to write the data to be written to the second address in the physical storage space. The storage node is also used to write the data to be written to the second address of the physical storage space according to the request of the network device.
9. The system according to claim 1, characterized in that, The computing node is also used to send an allocation request, which requests space configuration for the logical storage space and carries the identifier of the logical storage space. The network device is further configured to request physical storage space corresponding to the logical storage space from the storage node based on the received allocation request.
10. The system according to claim 8 or 9, characterized in that, The network device receives at least two write requests from the computing node, and the network device is also configured to return a message indicating that the at least two write requests have been completed based on the order in which the at least two write requests are received.
11. The system according to claim 8 or 9, characterized in that, The network device is further configured to, upon receiving a read-only setting request for the logical storage space sent by the computing node, set the state of the logical storage space to read-only if there is no conflict in the logical storage space.
12. The system according to claim 7 or 8, characterized in that, The network device is further configured to, upon receiving a deletion request for logical storage space sent by the computing node, set the status of the logical storage space to a deletion-in-progress state if there is no conflict in the logical storage space, and instruct the storage node to delete the physical storage space corresponding to the logical storage space.
13. The system according to any one of claims 1 to 9, characterized in that, The network device connects to the storage node and / or the computing node via Remote Direct Memory Access (RDMA).
14. The system according to any one of claims 1-9, characterized in that, After receiving the access request sent by the computing node, the network device is further configured to: Determine N data fragments for the service and calculate M verification fragments; The process of storing the data for the service to the storage node includes: The N shards and the M verification shards are stored in the storage node.
15. A data processing method, characterized in that, The method is executed by a network device that connects a computing node and a storage node. The computing node runs a service, and the storage node stores the data of the service. The method includes: The logical storage space and metadata corresponding to the data managing the aforementioned business; Receive the data access request for the service sent by the computing node; Based on the access request and the metadata, determine the storage address of the business data in the storage node corresponding to the logical storage space; store the business data to the storage address in the storage node or retrieve the business data from the storage address in the storage node.
16. The method according to claim 15, characterized in that, The method further includes: The network device configures the logical storage space to correspond to multiple storage nodes, and the multiple storage nodes include storage nodes of different types.
17. The method according to claim 15, characterized in that, The method further includes: performing network packet processing on the data packet corresponding to the access request.
18. The method according to claim 17, characterized in that, The metadata includes the identifier of the logical storage space, the address information of the logical storage space, and the address information of the physical storage space corresponding to the logical storage space, wherein the physical storage space belongs to the space in the storage node.
19. The method according to claim 18, characterized in that, The access request is a write request, and the write request carries data to be written. The method further includes: Allocate a second address in the logical storage space for the write request; Based on the metadata, determine the first address in the physical storage space corresponding to the logical storage space to store the data to be written.
20. The method according to claim 19, characterized in that, The method further includes: Receive a notification message sent by the storage node to notify that the data to be written has been completed; Determine whether other write requests for the logical storage space received before the write request have been completed. If so, notify the compute node that the write request has been completed.
21. The method according to claim 19 or 20, characterized in that, Before receiving the write request, the method further includes: Receive information about the logical storage space from the computing node; Send a storage space allocation request to the storage node, the storage space allocation request being used to request the allocation of physical storage space for the logical storage space; Receive information from the storage node about the physical storage space allocated by the storage node for the logical storage space.
22. The method according to claim 19, characterized in that, The storage node includes a first storage node and a second storage node, and the second address corresponds to the first address in the first storage node where the data to be written is written, and the first address in the second storage node where the data to be written is written. The method further includes: The first storage node is requested to write the data to be written to the first address in the first storage node where the data to be written is located. The second storage node is requested to write the data to be written to the first address in the second storage node where the data to be written is located.
23. The method according to any one of claims 15-20, characterized in that, Also includes: Receive a read-only setting request for the logical storage space from the computing node; If it is determined that there is no conflict in the logical storage space, the state of the logical storage space is set to read-only.
24. The method according to any one of claims 15-20, characterized in that, Also includes: Receive a deletion request for the logical storage space from the computing node; If it is determined that there is no conflict in the logical storage space, the state of the logical storage space is set to the deletion state; The storage node is requested to delete the physical storage space corresponding to the logical storage space.
25. The method according to any one of claims 15 to 20, characterized in that, After receiving the access request sent by the computing node, the method further includes: Determine N data fragments for the service and calculate M verification fragments; The process of storing the data for the service to the storage node includes: The N shards and the M verification shards are stored in the storage node.
26. A network device connecting computing nodes and storage nodes, characterized in that, The computing nodes are used to run the business, and the storage nodes are used to store the data of the business. The network device is used for: The data managing the aforementioned business corresponds to logical storage space and metadata; Receive the access request sent by the computing node to access the business data corresponding to the storage node; Based on the access request and the metadata, determine the storage address of the business data in the storage node corresponding to the logical storage space, so as to store the business data in the storage address of the storage node or retrieve the business data from the storage address of the storage node.
27. The network device according to claim 26, characterized in that, It is also used to set up multiple storage nodes for the logical storage space, and the multiple storage nodes include storage nodes of different types.
28. The network device according to claim 26, characterized in that, The network device is also used to perform network packet processing on the data packets corresponding to the access request.
29. The network device according to claim 26, characterized in that, The metadata includes the identifier of the logical storage space, the address information of the logical storage space, and the address information of the physical storage space corresponding to the logical storage space, wherein the physical storage space belongs to the space in the storage node.
30. The network device according to claim 26, characterized in that, The logical storage space is a persistent log space.
31. The network device according to claim 26, characterized in that, The network device is also configured to receive an allocation request sent by the computing node, the allocation request being used to request space configuration for the logical storage space, and the allocation request carrying an identifier of the logical storage space; And based on the received allocation request, request the physical storage space corresponding to the logical storage space from the storage node.
32. The network device according to claim 26, characterized in that, The network device is further configured to, upon receiving a read-only setting request for the logical storage space sent by the computing node, set the state of the logical storage space to read-only if there is no conflict in the logical storage space.
33. The network device according to claim 26, characterized in that, The network device is further configured to, upon receiving a deletion request for logical storage space sent by the computing node, set the status of the logical storage space to a deletion-in-progress state if there is no conflict in the logical storage space, and instruct the storage node to delete the physical storage space corresponding to the logical storage space.
34. The network device according to any one of claims 26 to 33, characterized in that, The network device connects to the storage node and / or the computing node via Remote Direct Memory Access (RDMA).
35. The network device according to any one of claims 26-33, characterized in that, After receiving the access request sent by the computing node, the network device is further configured to: Determine N data fragments for the service and calculate M verification fragments; The process of storing the data for the service to the storage node includes: The N shards and M parity shards are stored in the storage node.
Citation Information
Patent Citations
Method for processing writing request or reading request, switch, and control node
CN107948233A
Storage server and storage server system
CN108965452A