[go: up one dir, main page]

CN112988680B - Data acceleration method, cache unit, electronic device and storage medium - Google Patents

Data acceleration method, cache unit, electronic device and storage medium Download PDF

Info

Publication number
CN112988680B
CN112988680B CN202110338562.7A CN202110338562A CN112988680B CN 112988680 B CN112988680 B CN 112988680B CN 202110338562 A CN202110338562 A CN 202110338562A CN 112988680 B CN112988680 B CN 112988680B
Authority
CN
China
Prior art keywords
cache
data
cache node
node
storage medium
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110338562.7A
Other languages
Chinese (zh)
Other versions
CN112988680A (en
Inventor
丁宇光
杨利锋
张传庆
何晓囡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Netapp Technology Ltd
Original Assignee
Lenovo Netapp Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Netapp Technology Ltd filed Critical Lenovo Netapp Technology Ltd
Priority to CN202110338562.7A priority Critical patent/CN112988680B/en
Publication of CN112988680A publication Critical patent/CN112988680A/en
Application granted granted Critical
Publication of CN112988680B publication Critical patent/CN112988680B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data acceleration method, a cache unit, an electronic device and a storage medium are provided, wherein the data acceleration method is used for providing data cache service for a first cache request sent to a first cache node. The data acceleration method comprises the following steps: in response to the first cache node receiving the first cache request, storing the first target data to the first cache node; transmitting the first target data to a second cache node different from the first cache node by using a remote direct data access method and storing the first target data in the second cache node; a response to the first cache request is returned by the first cache node. The data acceleration method can ensure the consistency of data, realizes high availability of cache service, ensures that the data cache service is not limited by node failure, can still provide the data cache service when the node failure occurs, has high response speed and no data loss, and can improve the reliability and the availability of a system.

Description

Data acceleration method, cache unit, electronic device and storage medium
Technical Field
Embodiments of the present disclosure relate to a data acceleration method, a cache unit, an electronic device, and a storage medium.
Background
With the rapid development of network transmission technology, the content provided through the internet is becoming richer and richer. For example, a user may read news, listen to music, watch movies, download application software, etc. over the internet. In order to provide services to users more efficiently, a combination of a main server and a storage system may be used. For example, the main server is used to provide services for users, and content data (such as audio-video data, text data, and other required data) related to the services are stored in the storage system. The storage system comprises a storage server, and the storage server can own a file system to provide file access service for the outside. The main server interacts with the storage system to store and access data so as to realize the required functions.
Disclosure of Invention
At least one embodiment of the present disclosure provides a data acceleration method for providing a data caching service for a first cache request sent to a first cache node, including: in response to the first cache node receiving the first cache request, storing first target data to the first cache node; transmitting the first target data to a second cache node different from the first cache node and storing the first target data to the second cache node by using a remote direct data access method; returning, by the first cache node, a response to the first cache request.
For example, in a data acceleration method provided in an embodiment of the present disclosure, the first cache node includes a first storage medium, the second cache node includes a second storage medium, and the first storage medium and/or the second storage medium include a persistent memory.
For example, in a data acceleration method provided in an embodiment of the present disclosure, storing the first target data to the first cache node includes: processing the first target data to generate at least one fragment data file; storing the at least one fragmented data file into the first storage medium, and generating a management data structure based on a storage address of the at least one fragmented data file, where the management data structure is used to manage the at least one fragmented data file; and storing the management data structure as metadata corresponding to the first target data in the first storage medium.
For example, in the data acceleration method provided in an embodiment of the present disclosure, the management data structure includes a first linked list and a second linked list, where the first linked list includes file nodes, the second linked list includes at least one fragmented data management node, the file nodes include a first pointer, the first pointer points to a corresponding fragmented data management node in the second linked list, the fragmented data management node includes at least one second pointer, and the second pointer points to a starting storage address of a corresponding fragmented data file.
For example, in the data acceleration method provided in an embodiment of the present disclosure, the size of each sliced data file is the same.
For example, in a data acceleration method provided in an embodiment of the present disclosure, the transmitting and storing the first target data to the second cache node different from the first cache node by using the remote direct data access method includes: calling the library file of the first storage medium, transmitting the first target data to the second cache node in the form of the fragmented data file through a network by using the remote direct data access method, and storing the first target data in the second storage medium; and calling the library file of the first storage medium, transmitting the metadata corresponding to the first target data to the second cache node through the network by using the remote direct data access method, and storing the metadata in the second storage medium.
For example, in the data acceleration method provided in an embodiment of the present disclosure, the storage space of the first storage medium includes a target local space, the first target data and the metadata corresponding to the first target data are stored in the target local space of the first storage medium, the storage space of the second storage medium includes a mirror image backup space, and the first target data and the metadata corresponding to the first target data are mirror image stored in the mirror image backup space of the second storage medium.
For example, in a data acceleration method provided in an embodiment of the present disclosure, the storage space of the first storage medium further includes a target backup space, and the storage space of the second storage medium further includes a mirror local space, and the data acceleration method further includes: in response to the second cache node receiving a second cache request, storing second target data in a mirror local space of the second storage medium; transmitting the second target data to the first cache node by using the remote direct data access method and storing the second target data in a target backup space of the first storage medium in a mirroring manner; returning, by the second cache node, a response to the second cache request.
For example, in the data acceleration method provided in an embodiment of the present disclosure, the first cache node and the second cache node are physically independent cache nodes from each other, and the first storage medium and the second storage medium are physically independent storage media from each other; or the first cache node and the second cache node are logically independent cache nodes but physically the same cache device, and the first storage medium and the second storage medium are different storage areas of the same persistent memory.
For example, in a data acceleration method provided in an embodiment of the present disclosure, the first cache request includes a write data request.
At least one embodiment of the present disclosure further provides a data acceleration method, configured to provide a data caching service for a first cache request sent to a first cache node, including: in response to the first cache request sent to the first cache node being non-responsive, sending the first cache request to a second cache node different from the first cache node; the second cache node blocks the rest cache requests corresponding to the first cache node in the request queue; reading metadata corresponding to the first target data stored in the second cache node into a memory of the second cache node; based on the first target data stored in the second cache node, the second cache node responds to the first cache request, and sequentially receives and responds to the remaining cache requests corresponding to the first cache node in the request queue, so that the second cache node is used for replacing the first cache node to provide data cache service; the first target data and the metadata corresponding to the first target data are transmitted from the first cache node to the second cache node by using a remote direct data access method and are stored in the second cache node.
For example, in a data acceleration method provided in an embodiment of the present disclosure, the first cache node includes a first storage medium, the second cache node includes a second storage medium, and the first storage medium and/or the second storage medium include a persistent memory.
For example, in the data acceleration method provided in an embodiment of the present disclosure, the storage space of the second storage medium includes a mirror image backup space, and the first target data and the metadata corresponding to the first target data are stored in the mirror image backup space of the second storage medium in a mirror image manner.
For example, the data acceleration method provided by an embodiment of the present disclosure further includes: based on the metadata read into the memory, storing the fragmented data file which is stored in the mirror image backup space of the second storage medium and needs to be subjected to the down-brushing operation to a persistence layer of the second cache node; and deleting the fragmented data files stored in the persistence layer in the mirror image backup space of the second storage medium.
For example, in the data acceleration method provided by an embodiment of the present disclosure, the first cache node cannot respond to the first cache request due to a failure.
At least one embodiment of the present disclosure further provides a data acceleration method, configured to provide a data caching service for a first cache request, corresponding to a first cache node, sent to a second cache node different from the first cache node, including: in response to the first cache request sent to the second cache node not being responded to, sending the first cache request to the first cache node; the first cache node blocks the rest cache requests corresponding to the first cache node in the request queue; emptying the storage space of the first storage medium of the first cache node; storing all the fragmented data files stored in a second storage medium of the second cache node to a persistence layer of the second cache node; the second cache node sends a brushing completion identifier to the first cache node; and the first cache node responds to the first cache request, and sequentially receives and responds to the remaining cache requests corresponding to the first cache node in the request queue, so that the first cache node is utilized to provide data cache service.
For example, in the data acceleration method provided in an embodiment of the present disclosure, the second cache node cannot respond to the first cache request due to a change in a network connection protocol, which is changed due to the failure relief of the first cache node.
At least one embodiment of the present disclosure further provides a cache unit, including a first cache node and a second cache node that are communicatively connected, where the cache unit is configured to provide a data caching service to a first cache request sent to the first cache node, and the first cache node is configured to store first target data to the first cache node in response to receiving the first cache request, and transmit the first target data to the second cache node by using a remote direct data access method; the second cache node is configured to receive the first target data sent by the first cache node and store the first target data into the second cache node; the first cache node is further configured to return a response to the first cache request after the second cache node stores the first target data.
For example, in the cache unit provided in an embodiment of the present disclosure, the first cache node includes a first storage medium, the second cache node includes a second storage medium, and the first storage medium and/or the second storage medium include a persistent memory.
At least one embodiment of the present disclosure further provides an electronic device, including the cache unit according to any embodiment of the present disclosure.
At least one embodiment of the present disclosure also provides an electronic device including: a processor; a memory including one or more computer program modules; wherein the one or more computer program modules are stored in the memory and configured to be executed by the processor, the one or more computer program modules comprising instructions for implementing a data acceleration method as in any embodiment of the present disclosure.
At least one embodiment of the present disclosure also provides a storage medium for storing non-transitory computer-readable instructions that, when executed by a computer, may implement a data acceleration method as described in any one of the embodiments of the present disclosure.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below, and it is apparent that the drawings in the following description relate only to some embodiments of the present disclosure and are not limiting to the present disclosure.
Fig. 1 is a schematic flow chart of a data acceleration method according to some embodiments of the present disclosure;
fig. 2 is one of interaction diagrams of a cache node according to some embodiments of the present disclosure;
fig. 3 is a schematic flowchart of an example of step S110 in fig. 1;
fig. 4 is a schematic diagram of a management data structure adopted in a data acceleration method according to some embodiments of the present disclosure;
fig. 5 is a schematic flowchart of an example of step S120 in fig. 1;
fig. 6 is a second schematic diagram illustrating interaction between cache nodes according to some embodiments of the disclosure;
fig. 7 is a schematic diagram of a storage space of a cache node according to some embodiments of the present disclosure;
FIG. 8 is a schematic flow chart diagram of another data acceleration method provided by some embodiments of the present disclosure;
FIG. 9 is a schematic flow chart diagram of another data acceleration method provided by some embodiments of the present disclosure;
FIG. 10 is a schematic flow chart diagram of another data acceleration method provided by some embodiments of the present disclosure;
fig. 11 is a flowchart illustrating an application of a data acceleration method according to some embodiments of the present disclosure;
fig. 12 is a flowchart illustrating a data acceleration method according to some embodiments of the present disclosure;
fig. 13 is a flowchart illustrating an application of a data acceleration method according to some embodiments of the present disclosure;
fig. 14 is a schematic block diagram of a cache unit according to some embodiments of the present disclosure;
fig. 15 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure;
fig. 16 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure; and
fig. 17 is a schematic diagram of a storage medium according to some embodiments of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings of the embodiments of the present disclosure. It is to be understood that the described embodiments are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the disclosure without any inventive step, are within the scope of protection of the disclosure.
Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this disclosure belongs. The use of "first," "second," and similar terms in this disclosure is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. Also, the use of the terms "a," "an," or "the" and similar referents do not denote a limitation of quantity, but rather denote the presence of at least one. The word "comprising" or "comprises", and the like, means that the element or item preceding the word comprises the element or item listed after the word and its equivalent, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
When the storage System exports data for the client to use through a File System protocol, such as Common Internet File System (CIFS) protocol, the data size of a single read-write request and the performance of the back-end storage System are limited, and the read-write performance of the client is poor. Therefore, a Cache (Cache) may be employed to speed up data access. In a computer system, a cache is a component of software or hardware that is used to store data that will be accessed in the future or that has been accessed in the past, to speed up the performance of data access. In a storage system, in order to speed up the data processing capacity of the system, a cache is also typically used, which may be implemented by software, hardware, or a combination of software and hardware as well. For example, data stored in a persistent layer (e.g., a hard disk) may be first stored in a component that is closer to a data requester and has a faster access speed in a data chain, that is, data caching may be performed, and then the data requester may perform fast access, thereby improving the output efficiency of the data.
A Persistent Memory (PMem) is used as a nonvolatile Memory and can be used as a read-write cache, the PMem can support byte addressing for example, can be directly operated through a CPU instruction, and data is not lost after power failure; for example, PMem may be
Figure BDA0002998500840000061
Aotang toy TM And (5) persisting the memory. For example, the protocol on the file system server uses a write-back mode to write data into the PMem and then immediately returns a result to the client, and then the file system server performs background rendering on the data in the PMem to a persistence layer of the storage system, so that the read-write performance is improved.
However, when only a single cache node uses PMem, after a single node failure, single node failure recovery can be accomplished since data of PMem is not lost. However, in the failure process and the recovery process, the failed node cannot provide a file read-write service, that is, cannot provide a high availability characteristic, which affects the reliability and availability of the whole system.
At least one embodiment of the present disclosure provides a data acceleration method, a cache unit, an electronic device, and a storage medium. The data acceleration method can ensure the consistency of data, realizes high availability of cache service, ensures that the data cache service is not limited by node failure, can still provide the data cache service when the node failure occurs, has high response speed and no data loss, and can improve the reliability and the availability of a system.
Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. It should be noted that the same reference numerals in different figures will be used to refer to the same elements that have been described.
At least one embodiment of the present disclosure provides a data acceleration method. The data acceleration method is used for providing data caching service for a first caching request sent to a first caching node. The data acceleration method comprises the following steps: in response to the first cache node receiving the first cache request, storing the first target data to the first cache node; transmitting the first target data to a second cache node different from the first cache node by using a remote direct data access method and storing the first target data in the second cache node; a response to the first cache request is returned by the first cache node.
Fig. 1 is a schematic flow chart of a data acceleration method according to some embodiments of the present disclosure. The data acceleration method is used, for example, to provide data caching services for a first cache request sent to a first cache node. As shown in fig. 1, the data acceleration method includes the following operations.
Step S110: in response to the first cache node receiving the first cache request, storing the first target data to the first cache node;
step S120: transmitting the first target data to a second cache node different from the first cache node by using a remote direct data access method and storing the first target data in the second cache node;
step S130: a response to the first cache request is returned by the first cache node.
For example, in step S110, after receiving the first cache request, the first cache node stores the first target data in the first cache node. For example, the first cache request may be a write data request and is used to request that the first target data be cached, i.e., that the first target data be written to the storage medium of the first cache node. The first target data may be any type of data, and the embodiment of the present disclosure is not limited thereto as long as the first target data is data that needs to be stored to the first cache node. The first cache request may be a request sent by a client, or may also be a request sent by a module that manages cache services, which is not limited in this embodiment of the present disclosure. For example, the service provider corresponding to the first cache request is the first cache node, and the first cache request may be a cache request allocated to the first cache node, or may be a request specified by the request sender to be sent to the first cache node when the request sender sends the first cache request.
For example, in step S120, the first target data is transmitted to the second cache node and stored in the second cache node by using a remote direct data access method. For example, the second cache node is different from the first cache node. For example, the first cache node and the second cache node may be physically independent cache nodes from each other. For another example, the first cache node and the second cache node may be logically independent cache nodes but physically the same cache device. When the first target data is stored in the first cache node, the first cache node automatically transmits the first target data to the second cache node, and the second cache node stores the first target data after receiving the first target data. It should be noted that the process of transferring the first target data from the first cache node to the second cache node is not required to be triggered by any request sent by any requester, and is one step in the caching process for the first target data.
For example, a Remote Direct Memory Access (RDMA) method can directly Access a Memory of another device of a Remote node from one device in a network node, thereby enabling Direct transmission between the Memory of the Remote node and the Memory of a local node.
For example, in some examples, RDMA may be implemented in a processing manner of software, where the software opens up a buffer area in a Memory of the local node, and the data storage device (e.g., a storage medium, etc.) copies data into the buffer area of the Memory of the local node by means of Direct Memory Access (DMA), for example; correspondingly, a cache area is opened up in the memory of the remote node, and the data in the memory of the local node is copied to the memory of the remote node by using the network adapter. For example, the remote node may also copy data from the memory to the data storage device by means of DMA, thereby implementing data transfer between the two nodes. It should be noted that, in the embodiment of the present disclosure, a specific implementation manner of RDMA is not limited to the above-described manner, and may also be any other applicable manner, which may refer to an implementation manner of RDMA in a conventional technology, and the embodiment of the present disclosure does not limit this.
For example, as shown in fig. 2, in some examples, a first cache node transfers first target data to and stores in an RDMA manner to a second cache node, thereby causing the first target data to be stored not only in the first cache node but also mirrored in the second cache node. Here, "mirror storage" means that the first target data is stored in different cache nodes, and the first target data stored in different cache nodes are identical to each other.
For example, as shown in fig. 1, in step S130, a response to the first cache request is returned by the first cache node. That is, the first cache node returns a response to the first cache request after the first target data is stored to the first cache node and stored to the second cache node. For example, the response may indicate that the caching was successful, and the response may be returned by the first caching node to the sender of the first caching request. Thereby, the cache operation for the first target data is completed. The first target data is cached to the first cache node and is also stored to the second cache node in a mirror image mode, and mirror image storage and multipoint backup are achieved.
For example, the first cache node includes a first storage medium as a storage medium for the first cache node, which may include, at least in part, persistent memory (PMem). The second cache node comprises a second storage medium as a storage medium for the second cache node, which may at least partially comprise persistent memory. For example, the first storage medium and the second storage medium may be the same type of storage medium, and may also be different types of storage media, which is not limited in this respect by the embodiments of the present disclosure.
Fig. 3 is a flowchart illustrating an example of step S110 in fig. 1. As shown in fig. 3, in some examples, step S110 may include the following operations.
Step S111: processing the first target data to generate at least one fragment data file;
step S112: storing at least one fragmented data file into a first storage medium, and generating a management data structure based on a storage address of the at least one fragmented data file, wherein the management data structure is used for managing the at least one fragmented data file;
step S113: the management data structure is stored in the first storage medium as metadata corresponding to the first target data.
For example, in step S111, the first target data is processed, so that at least one sliced data file is generated based on the first target data. Because the first storage medium of the first cache node is a persistent memory, and Data in the persistent memory needs to be stored in a form of fragmented Data (Data Block), the first target Data needs to be processed, and the first target Data is converted into a form of fragmented Data. The generated fragmented data file is obtained by, for example, dividing the first target data, and each fragmented data file is a data block.
For example, in some examples, the data block size is 4MB, which may result in better performance when subsequent data transfers are made using RDMA. For example, when a plurality of fragmented data files are obtained, the sizes of the fragmented data files are the same, for example, 4MB, so that the identity of the data files can be improved, and the subsequent operation is facilitated. For example, the number of processed fragmented data files may be 1 or more, which may be determined according to the size of the first target data and the size of each fragmented data file, and embodiments of the present disclosure are not limited in this respect.
It should be noted that, in the embodiment of the present disclosure, the size of each sliced data file is not limited to 4MB, and may be any size, and the number of the sliced data files and the processing manner of the first target data are not limited, which may be determined according to actual requirements.
For example, in step S112, the fragmented data file resulting from processing the first target data is stored in the first storage medium, and the management data structure is generated according to the storage address of the fragmented data file. For example, the management data structure manages the divided data files in units of files. Here, "in file units" means that the file of the logical level in the first target data is in units, and the file of the logical level is, for example, a document, video, audio, or the like.
Fig. 4 is a schematic diagram of a management data structure used in a data acceleration method according to some embodiments of the present disclosure. As shown in fig. 4, in some examples, the management data structure includes a first linked list 01 and a second linked list 02.
The first linked list 01 includes at least one file node. Each file node corresponds to a read-write file, and the file node stores file-related metadata information, such as file name, file number (inode number), and the like. The second linked list 02 includes at least one fragmented data management node, and each fragmented data management node records a management node index and a fragmented data file list. Each fragment data file list records information such as the size of each fragment data file.
For example, the file node further includes a first pointer, where the first pointer points to a corresponding sharded data management node in the second linked list 02. And the fragment data management node stores metadata information related to the fragment data file. The fragmented data management node comprises at least one second pointer pointing to a starting storage address (i.e. block data starting address) of the corresponding fragmented data file in the first storage medium. For example, when there are a plurality of fragmented data files, there are a plurality of second pointers, and the corresponding fragmented data file can be obtained through the address pointed by the second pointer.
For example, the first linked list 01 is a single linked list and the second linked list 02 is a double linked list. The first linked list 01 and the second linked list 02 are all components of a management data structure, and the first linked list 01 and the second linked list 02 are both stored in a first storage medium as metadata.
It should be noted that, in the embodiment of the present disclosure, the management data structure is not limited to the form of the first linked list 01 and the second linked list 02, and any other applicable data structure may also be used as long as the fragmented data file can be managed, which is not limited in this embodiment of the present disclosure.
For example, as shown in fig. 3, in step S113, the management data structure is stored as metadata corresponding to the first target data in the first storage medium. That is, the management data structure is metadata corresponding to the first target data, and both the management data structure and the first target data are stored in the first storage medium. When the management data structure includes the first linked list 01 and the second linked list 02 described above, both the first linked list 01 and the second linked list 02 are stored in the first storage medium.
Fig. 5 is a flowchart illustrating an example of step S120 in fig. 1. As shown in fig. 5, in some examples, step S120 may include the following operations.
Step S121: calling a library file of a first storage medium, transmitting first target data to a second cache node in a form of a fragment data file through a network by using a remote direct data access method, and storing the first target data in a second storage medium;
step S122: and calling the library file of the first storage medium, transmitting the metadata corresponding to the first target data to a second cache node through a network by using a remote direct data access method, and storing the metadata in a second storage medium.
For example, step S121 and step S122 may implement data transmission in a similar manner, so as to transmit the first target data and the corresponding metadata to the second cache node, respectively.
For example, since the first storage medium and the second storage medium are persistent memories, corresponding library files are configured. For example, as shown in fig. 6, libpmem, libfabric, librbverbs are library files provided by the persistent memory, and are used to implement various functions based on the persistent memory. For example, library file libpmomb is used to implement internal data writing functionality, library file librpmem is used to implement external data writing functionality, library files libfabric and librbverbs are used to implement hardware-related or RDMA-related functionality. For a detailed description of each library file, reference may be made to conventional designs, which are not described in detail herein.
For example, when the first target data needs to be stored, the library file librpmem may be called, and the first target data is written into the first storage medium by using the library file librpmem. When the first target data needs to be transmitted from the first cache node to the second cache node, the library file libfabric may be called, and RDMA is implemented by using the library file libfabric. For example, by calling library file librpmem, the fragmented data file obtained based on the first target data is written into the first storage medium, and then by calling library file libfabric, the fragmented data file can be transferred to the network adapter of the second cache node through the network adapter of the first cache node in an RDMA manner, and then stored in the second storage medium of the second cache node, so that the fragmented data file corresponding to the first target data is mirror-stored in the second storage medium. In this way, a backup of data can be achieved, the first target data stored in the first storage medium being the same as the first target data stored in the second storage medium.
It should be noted that the first target data stored in the first storage medium and the second storage medium are both in the form of fragmented data files, and when the first target data is transmitted by using the library file libfabric, the first target data is also transmitted in the form of fragmented data files. These fragmented data files correspond to the first target data, and are obtained by, for example, dividing the first target data. Similarly, when the metadata corresponding to the first target data needs to be transmitted from the first cache node to the second cache node, the library file librpmem may also be called to implement writing and the library file libfabric may also be called to implement RDMA. For a detailed description of using library file library to implement writing and using library file library to implement RDMA, reference may be made to conventional design, and details are not described herein again.
For example, in some examples, the first cache node and the second cache node are physically independent cache nodes from each other, and accordingly, the first storage medium and the second storage medium are physically independent storage media from each other. For example, in other examples, the first cache node and the second cache node are logically independent cache nodes from each other but physically the same cache device, that is, two different cache nodes are configured on the cache device, and the two cache nodes each independently provide a data caching service. Accordingly, in this case, the first storage medium and the second storage medium may be different storage areas of the same persistent memory, that is, the same persistent memory is subjected to area division to obtain a plurality of partition spaces, and each partition space is allocated to each cache node to serve as a storage medium of the corresponding cache node. Of course, the embodiments of the present disclosure are not limited thereto, and in a case that the first cache node and the second cache node are logically independent cache nodes from each other but are physically the same cache device, the first storage medium and the second storage medium may also be different persistent memories, which may be determined according to actual requirements.
For example, the network adapters of the first cache node and the second cache node may be Host Bus Adapters (HBAs), or may be any other applicable network adapters, as long as the first cache node and the second cache node can implement communication connection through a Bus or a network, and the like, which is not limited in this embodiment of the disclosure. For example, the network may be an Ethernet (Ethernet) or any other suitable network.
It should be noted that, in the embodiment of the present disclosure, the library file called is not limited to librpmem and libfabric described above, and when the first storage medium and the second storage medium are not persistent memories, the library file is also changed correspondingly, and may be any library file suitable for implementing data writing and RDMA, and it is only necessary that the library file called can transmit the first target data in the first storage medium to the second storage medium and store the first target data in the second storage medium, which is not limited in this embodiment of the present disclosure.
It should be noted that, in the embodiment of the present disclosure, a specific implementation manner of RDMA is not limited, and RDMA may be implemented in any applicable manner, which may be determined according to actual needs, for example, according to the types of the first storage medium and the second storage medium, the library file called, and the like, which is not limited in this respect.
For example, in some examples, the flow of the first cache node providing data caching services is as follows. First, a first cache node receives a first cache request (for example, a write data request), and the first cache node processes received first target data to obtain a fragmented data file. And then, writing the first target data into a first storage medium of the first cache node in the form of a fragment data file by calling a library file library provided by the persistent memory. The library file librpmem uses the library file libpmobj to guarantee atomicity of the data. Then, the library file librpmem automatically uses the library file libfabric to send the first target data to the second cache node in the form of a fragment data file in an RDMA mode and store the fragment data in a second storage medium of the second cache node.
Then, metadata (e.g., management data structures, i.e., the first linked list 01 and the second linked list 02) corresponding to the first target data is also written to the first storage medium in a similar manner. Then, the library file librpmem automatically uses the library file libfabric to send the metadata to the second cache node in the form of a fragment data file in an RDMA manner and store the metadata in a second storage medium of the second cache node. The first cache node then returns a response to the first cache request, e.g., a response indicating that the caching was successful. It should be noted that, after the first target data and the corresponding metadata are stored in the second cache node, the first cache node returns a response to the first cache request, so as to ensure the validity and integrity of the backup.
Thus, the first cache node completes the data caching service for the first cache request, and the first target data and the corresponding metadata are stored in the first storage medium of the first cache node and are also stored in the second storage medium of the second cache node in a mirroring manner. In the subsequent working phase, if the first cache node cannot provide the data cache service, the second cache node can take over the cache request aiming at the first cache node and provide the data cache service which is not different from the first cache node. Therefore, the data caching service is not limited by the node failure any more, and even if the first caching node fails, the data caching service can be continuously provided for the caching request aiming at the first caching node, so that the availability and the reliability of the system are improved.
Fig. 7 is a schematic diagram of a storage space of a cache node according to some embodiments of the present disclosure. As shown in fig. 7, the first cache node includes a first storage medium 11, and the storage space of the first storage medium 11 includes a target local space 111 and a target backup space 112, that is, the storage space of the first storage medium 11 is divided into two parts, namely, the target local space 111 and the target backup space 112. The second cache node comprises a second storage medium 12, and the storage space of the second storage medium 12 comprises a mirror local space 121 and a mirror backup space 122, that is, the storage space of the second storage medium 12 is divided into two parts, namely, the mirror local space 121 and the mirror backup space 122.
For example, the first target data and the metadata corresponding to the first target data are stored in the target local space 111 of the first storage medium 11, and are also mirror-stored in the mirror backup space 122 of the second storage medium 12. When the first cache node receives a first cache request (for example, a write data request), the first cache node provides a data cache service, stores the first target data and the metadata corresponding to the first target data in the target local space 111 of the first storage medium 11, and transmits the first target data and the metadata corresponding to the first target data to the second cache node by RDMA and stores the first target data and the metadata in the mirror backup space 122 of the second storage medium 12. After the first target data and the metadata corresponding to the first target data are stored in the first storage medium 11 and the second storage medium 12, the first cache node returns a response to the first cache request, which indicates that the data caching is successful, for example.
For example, the mirror backup space 122 is used to backup data in the target local space 111, and the data in the mirror backup space 122 and the target local space 111 have consistency, so that when the first cache node cannot provide the data caching service, the second cache node can take over the caching request for the first cache node and provide the data caching service that is not different from the first cache node. Therefore, the data caching service is not limited by node failure, and even if the first caching node fails, the data caching service can be continuously provided for the caching request aiming at the first caching node, so that the availability and the reliability of the system are improved.
For example, the target local space 111 and the mirror backup space 122 are the same size, so as to both meet the requirement of mirror storage and avoid the waste of storage resources. Of course, the embodiments of the present disclosure are not limited thereto, and the sizes of the target local space 111 and the mirror backup space 122 may also be different according to actual design requirements, and the embodiments of the present disclosure are not limited thereto.
For example, in some examples, the second cache node is not only used to backup the data of the first cache node, but also used to provide data caching service for the second cache request sent to the second cache node, so the target backup space 112 of the first storage medium 11 can be utilized to backup the data in the mirror local space 121 of the second storage medium 12. That is, the first cache node and the second cache node are synchronized with each other and backup each other. This mode of operation is described below with reference to fig. 8.
Fig. 8 is a flowchart illustrating another data acceleration method according to some embodiments of the present disclosure. As shown in fig. 8, the data acceleration method may further include the following operations.
Step S140: in response to the second cache node receiving the second cache request, storing the second target data in a mirror image local space of the second storage medium;
step S150: transmitting the second target data to the first cache node by using a remote direct data access method and storing the second target data in a target backup space of the first storage medium in a mirroring manner;
step S160: a response to the second cache request is returned by the second cache node.
For example, in step S140, after the second caching node receives the second caching request, the second target data is stored in the mirror local space 121 of the second storage medium 12. For example, the second cache request may be a write data request and is used to request that the second target data be cached, i.e., that the second target data be written to the second storage medium 12 of the second cache node. The second target data may be any type of data, which is not limited in this embodiment of the disclosure as long as the second target data is data that needs to be cached to the second cache node. The second cache request may be a request sent by the client, or may be a request sent by a module that manages cache services, which is not limited in this embodiment of the present disclosure. For example, the service provider corresponding to the second cache request is the second cache node, and the second cache request may be a cache request allocated to the second cache node, or may be a request specified by the request sender to be sent to the second cache node when the request sender sends the second cache request.
For example, in step S150, the second target data is transmitted to the first cache node by using a remote direct data access method and is mirrored in the target backup space 112 of the first storage medium 11. When the second target data is stored in the second cache node, the second cache node automatically transmits the second target data to the first cache node, and the first cache node stores the second target data after receiving the second target data. It should be noted that the process of transferring the second target data from the second cache node to the first cache node is not triggered by any request sent by any requester, and is a step in the caching process for the second target data. For the manner of transmitting the second target data by using the remote direct data access method, reference may be made to the above description of transmitting the first target data by using the remote direct data access method in step S120, which are substantially the same, except that the data transmission directions are opposite to each other, and detailed description thereof is omitted here.
For example, in step S160, a response to the second cache request is returned by the second cache node. That is, the second cache node returns a response to the second cache request after the second target data is stored to the second cache node and stored to the first cache node. For example, the response may indicate that the caching was successful, and the response may be returned by the second cache node to the sender of the second cache request. Thereby, the cache operation for the second target data is completed. The second target data is cached to the second cache node and is also stored to the first cache node in a mirror image mode, and mirror image storage and multipoint backup are achieved.
Therefore, the first cache node and the second cache node are mutually synchronous and backup. The storage space of each cache node comprises a local space and a backup space, the local space is used for providing data cache service for the cache request of the local space, and the backup space is used for providing backup and mirror image storage service for the opposite node. By the method, high availability of the cache service can be realized, data of any cache node is stored in the opposite node in a mirror image mode, so that the data cache service is not limited by node failure, the data cache service can be provided when the node failure occurs, the response speed is high, no data is lost, and the reliability and the availability of the system can be improved. Here, the "correspondent node" refers to a node that provides backup and mirror storage services for a certain cache node. For example, in the above example, the first cache node is a peer node of the second cache node, and the second cache node is a peer node of the first cache node.
For example, in some examples, after returning a response to the cache request, i.e., after completing the data caching service, the first cache node and the second cache node may flush the data in their respective local spaces to the persistence layer using a background thread.
At least one embodiment of the present disclosure further provides a data acceleration method, where the data acceleration method is configured to provide a data caching service for a first cache request sent to a first cache node. For example, the data acceleration method is suitable for a scenario where a first cache node fails, and at this time, a second cache node takes over a cache request for the first cache node and provides a data cache service that is not different from the first cache node. Therefore, the data caching service is not limited by the node failure any more, and even if the first caching node fails, the data caching service can be continuously provided for the caching request aiming at the first caching node, so that the availability and the reliability of the system are improved.
Fig. 9 is a flowchart illustrating another data acceleration method according to some embodiments of the present disclosure. As shown in fig. 9, the data acceleration method includes the following operations.
Step S210: in response to a first cache request sent to a first cache node being non-responsive, sending the first cache request to a second cache node different from the first cache node;
step S220: the second cache node blocks the rest cache requests corresponding to the first cache node in the request queue;
step S230: reading metadata corresponding to the first target data stored in the second cache node into a memory of the second cache node;
step S240: based on the first target data stored in the second cache node, the second cache node responds to the first cache request, and sequentially receives and responds to the remaining cache requests corresponding to the first cache node in the request queue, so that the second cache node is used for replacing the first cache node to provide data cache service.
For example, the first target data and the metadata corresponding to the first target data are transmitted from the first cache node to the second cache node and stored in the second cache node by using a remote direct data access method. That is, the first target data and the metadata corresponding to the first target data are transmitted and stored to the second cache node by the data acceleration method shown in fig. 1.
It should be noted that, in this embodiment, the first cache request may be a write data request or a read data request. The first cache request in this embodiment is different from the first cache request in the embodiment shown in fig. 1, and both are cache requests sent to the first cache node at different times.
For example, in step S210, if the first cache request sent to the first cache node is not responded, the first cache request is sent to the second cache node. The second cache node is different from the first cache node. For the description of the first cache node and the second cache node, reference may be made to the foregoing contents, and details are not described here. For example, in some examples, the first cache node is unable to respond to the first cache request due to a failure. For example, in other examples, the first cache node may also be unable to respond to the first cache request due to a change in system settings. Of course, the first cache node may not be able to respond to the first cache request for various possible reasons in the application, which is not limited by the embodiments of the present disclosure. For example, the software setting or the protocol setting may be such that when the first cache request is unresponsive, the request sender sends the first cache request again and sends the first cache request to the second cache node.
For example, in step S220, after the second cache node receives the first cache request, the remaining cache requests in the request queue corresponding to the first cache node are blocked. For example, the request queue includes a plurality of requests, and the plurality of requests may include 1 or more cache requests to be sent to the first cache node, and these cache requests to be sent to the first cache node are referred to as remaining cache requests corresponding to the first cache node. The second cache node may send a blocking command to the request queue, so as to block the remaining cache requests corresponding to the first cache node in the request queue, that is, to suspend the request queue from sending the remaining cache requests corresponding to the first cache node.
For example, in step S230, the metadata corresponding to the first target data stored in the second cache node is read into the memory of the second cache node. Since the first target data in the first cache node and the metadata corresponding to the first target data are already mirrored and stored in the second cache node, the metadata corresponding to the first target data can be directly read from the second cache node.
For example, in step S240, the second cache node responds to the first cache request based on the first target data stored in the second cache node. At this time, no matter the first cache request is a write data request or a read data request, since the second cache node stores the first target data, the second cache node can respond to the first cache request. And then, the second cache node receives and responds to the remaining cache requests corresponding to the first cache node in the request queue in sequence. Therefore, the second cache node takes over the rest cache requests corresponding to the first cache node in the request queue, and the second cache node is used for replacing the first cache node to provide data cache service. Even if the first cache node fails, the data caching service is not affected, and the second cache node can provide the data caching service which is not different from the first cache node.
For example, a first cache node includes a first storage medium, which may be persistent memory. For example, the second cache node includes a second storage medium, which may be persistent memory. For example, the storage space of the second storage medium includes a mirror backup space, and the first target data and the metadata corresponding to the first target data are mirror-stored in the mirror backup space of the second storage medium. For the data storage location, the storage space dividing manner of the first cache node and the second cache node, and the like, reference may be made to the contents of the foregoing embodiments, and details are not described here again.
Fig. 10 is a flowchart illustrating another data acceleration method according to some embodiments of the present disclosure. As shown in fig. 10, in some examples, the data acceleration method may further include steps S250-S260 in addition to the above-described steps S210-S240. For the detailed description of steps S210-S240, reference is made to the above contents, which are not repeated herein.
Step S250: based on the metadata read into the memory, storing the fragmented data file which is stored in the mirror image backup space of the second storage medium and needs to be subjected to the down-brushing operation into a persistence layer of a second cache node;
step S260: and deleting the fragmented data files stored in the persistence layer in the mirror image backup space of the second storage medium.
For example, in step S250, based on the metadata read into the memory, the fragment data file stored in the mirror image backup space of the second storage medium and needing to be subjected to the flushing operation is subjected to the flushing operation, and is stored in the persistent layer of the second cache node. For example, the second storage medium may be refreshed periodically according to a preset time, may be refreshed according to a usage condition of the storage space of the second storage medium, or may be refreshed according to other preset conditions, which is not limited by the embodiment of the present disclosure.
For example, in step S260, the fragmented data file stored in the persistent layer in the mirrored backup space of the second storage medium is deleted. Thereby, the storage space of the second storage medium may be released in order to provide data caching services for subsequent caching requests.
Fig. 11 is a flowchart illustrating an application of a data acceleration method according to some embodiments of the present disclosure. As shown in fig. 11, in this example, the failed node may be the aforementioned first cache node that failed to provide data caching services. The recovery node may be the aforementioned second cache node, which takes over the cache request for the first cache node and provides data caching service. The scenario is a scenario in which service recovery is performed by using an opposite end node when a node fails.
In the recovery phase, the client sends an IO request to the failed node, where the IO request is a first cache request sent to the failed node and may be a write data request or a read data request. Since the failed node fails, it cannot respond to the IO request. The client does not receive the response, so resending the IO request and sending the IO request to the recovery node. And after receiving the IO request, the recovery node blocks the IO request to be sent to the fault node in the request queue of the client. And then, the recovery node reads the metadata in the mirror image backup space of the storage medium of the recovery node into the memory. The metadata is stored in the recovery node through an RDMA mirror before the failure node fails, and corresponding target data is also stored in a mirror backup space of a storage medium of the recovery node.
And in the stage of providing the IO service, the recovery node executes the IO request sent to the fault node by the client and returns the result to the client. And the client receives the result of the IO request, thereby completing the data caching service. Here, the "IO request sent by the client to the failed node" refers to an IO request that the client expects to send to the failed node, and not a request actually sent to the failed node. Since the recovery node takes over the corresponding data caching service, the client expects that the IO request sent to the failed node will actually be sent to the recovery node. In addition, the recovery node background flushes the fragmented data files in the mirror image backup space, namely, the fragmented data files are flushed to the persistence layer, and then the background cleans up the metadata in the mirror image backup space to release the storage space.
By the method, after the fault node fails, the recovery node can take over the cache request aiming at the fault node and provide data cache service, and the cache service has high availability and is not limited by the node failure.
At least one embodiment of the present disclosure further provides a data acceleration method, where the data acceleration method is configured to provide a data caching service for a first caching request, which corresponds to a first caching node and is sent to a second caching node. For example, the data acceleration method is suitable for a scenario in which the first cache node recovers service after the failure of the first cache node is eliminated. At this point, the second cache node no longer takes over the cache request for the first cache node. Therefore, the data caching service of the first caching node can be recovered, and the system can provide the data caching service according to a normal mechanism.
Fig. 12 is a schematic flow chart of another data acceleration method according to some embodiments of the present disclosure. As shown in fig. 12, the data acceleration method includes the following operations.
Step S310: responding to a first cache request sent to the second cache node without response, and sending the first cache request to the first cache node;
step S320: the first cache node blocks the rest cache requests corresponding to the first cache node in the request queue;
step S330: emptying the storage space of the first storage medium of the first cache node;
step S340: storing all the fragment data files stored in a second storage medium of a second cache node into a persistence layer of the second cache node;
step S350: the second cache node sends a brushing completion identifier to the first cache node;
step S360: the first cache node responds to the first cache request, and sequentially receives and responds to the remaining cache requests corresponding to the first cache node in the request queue, so that the first cache node is utilized to provide data cache service.
It should be noted that, in this embodiment, the first cache request may be a write data request or a read data request. The first cache request in this embodiment is different from the first cache request in the embodiment shown in fig. 1, and the two cache requests are cache requests sent at different times.
For example, in step S310, if the first cache request sent to the second cache node is not responded, the first cache request is sent to the first cache node. The second cache node is different from the first cache node. For the description of the first cache node and the second cache node, reference may be made to the foregoing contents, and details are not described here. For example, in some examples, the second cache node is unable to respond to the first cache request due to a change in a network connectivity protocol that changed due to a failure resolution of the first cache node. For example, in some examples, after the failure of the first cache node is cleared, software may be utilized to change the settings of the network connection protocol such that the second cache node cannot receive the first cache request. Of course, the embodiments of the present disclosure are not limited thereto, and when the failure of the first cache node is eliminated, the second cache node may no longer respond to the first cache request in any applicable manner. For example, the software setting or the protocol setting may be such that when the first cache request is unresponsive, the request sender sends the first cache request again and sends the first cache request to the first cache node.
For example, in step S320, after the first cache node receives the first cache request, the remaining cache requests in the request queue corresponding to the first cache node are blocked. For example, the request queue includes a plurality of requests, and the plurality of requests may include 1 or more cache requests to be sent to the first cache node, and these cache requests to be sent to the first cache node are referred to as remaining cache requests corresponding to the first cache node. The first cache node may send a blocking command to the request queue, so as to block the remaining cache requests corresponding to the first cache node in the request queue, that is, to suspend the request queue from sending the remaining cache requests corresponding to the first cache node. It should be noted that before the failure of the first cache node is recovered, since the second cache node takes over the data caching service of the first cache node, the remaining cache requests corresponding to the first cache node in the request queue may be sent to the second cache node.
For example, in step S330, the storage space of the first storage medium of the first cache node is emptied. Since the second cache node takes over the data caching service of the first cache node during the failure of the first cache node, the data stored in the mirror backup space of the second storage medium of the second cache node may be changed due to the data caching service, while the data stored in the first storage medium of the first cache node is the data before the failure, and the data are already invalid data and therefore need to be cleared.
For example, in step S340, all the fragmented data files stored in the second storage medium of the second cache node are stored in the persistence layer of the second cache node, that is, the fragmented data files are flushed.
For example, in step S350, after the flushing is completed, the second cache node sends a flushing completion identifier to the first cache node to notify the first cache node that the flushing is completed. The brushing completion identifier can be an identifier in any format or protocol, and can be determined according to actual requirements only by enabling the first cache node to be capable of identifying.
For example, in step S360, the first cache node responds to the first cache request. And then, the first cache node receives and responds to the remaining cache requests corresponding to the first cache node in the request queue in sequence. Thus, a data caching service is provided with the first cache node.
For example, a first cache node includes a first storage medium, which may be persistent memory. For example, the second cache node includes a second storage medium, which may be persistent memory.
Fig. 13 is a flowchart illustrating an application of a data acceleration method according to some embodiments of the present disclosure. As shown in fig. 13, in this example, the failed node may be the aforementioned first cache node whose failure is eliminated and thus may continue to provide data caching services. The recovery node may be the aforementioned second cache node, and before the failure of the first cache node is eliminated, the second cache node takes over the cache request for the first cache node and provides the data cache service, and after the failure of the first cache node is eliminated, the second cache node no longer takes over the corresponding cache request. The scenario is a scenario in which a failed node performs service recovery after the node failure is eliminated.
In the recovery phase, the client sends an IO request to the recovery node, where the IO request is a first cache request and may be a write data request or a read data request. The recovery node cannot respond to the IO request because the network connection protocol is changed, and the network connection protocol is changed because the failure of the failed node is resolved. The client does not receive the response, so resending the IO request and sending the IO request to the failed node. And after the failed node receives the IO request, blocking the IO request to be sent to the failed node in the request queue of the client. The failed node then clears the data in the local space and the backup space of the storage medium. Then, the recovery node prints the IO data corresponding to the failed node in the local space and the data in the backup space to the persistence layer. After the flushing is completed, the recovery node sends a flushing completion identifier to the failed node, that is, the failed node waits for the return of the opposite end (i.e., the recovery node) until the flushing completion identifier is received.
And in the stage of providing the IO service, the failed node executes the IO request sent to the failed node by the client and returns a result to the client. And the client receives the result of the IO request, thereby completing the data caching service.
Through the above manner, after the fault of the fault node is eliminated, the fault node can recover the service, that is, the fault node can continue to receive the cache request and provide the data cache service, so as to recover the normal working state.
In the data acceleration method provided by the embodiment of the present disclosure, when a data caching service is provided, not only the target data is stored in the first cache node, but also the target data is stored in the second cache node in a mirror image manner, and then a response to the cache request is returned, so that backup of the cache data can be realized. When the first cache node fails, the second cache node can take over the cache request to be sent to the first cache node, and can provide data cache service which is not different from the first cache node, so that the consistency of data can be ensured, the high availability of the cache service is realized, the data cache service is not limited by the node failure, the reliability and the availability of a system can be improved, the response speed is high, and no data loss exists. When the failure of the first cache node is eliminated, the first cache node can continue to provide data cache service, so that the normal working state is quickly recovered.
At least one embodiment of the present disclosure also provides a cache unit. The cache unit can ensure the consistency of data, realizes high availability of cache service, ensures that the data cache service is not limited by node failure, can still provide the data cache service when the node failure occurs, has high response speed and no data loss, and can improve the reliability and the availability of a system.
Fig. 14 is a schematic block diagram of a cache unit according to some embodiments of the present disclosure. As shown in fig. 14, the cache unit 10 includes a first cache node 110 and a second cache node 120 that are communicatively connected. For example, the first cache node 110 and the second cache node 120 may be communicatively coupled via any suitable network. The caching unit 10 is configured to provide data caching services to a first cache request sent to a first cache node 110.
For example, the first cache node 110 is configured to store the first target data to the first cache node 110 and transmit the first target data to the second cache node 120 using a remote direct data access method in response to receiving the first cache request. The second cache node 120 is configured to receive the first target data sent by the first cache node 110 and store the first target data in the second cache node 120. The first cache node 110 is further configured to return a response to the first cache request after the second cache node 120 stores the first target data.
For example, the first cache node 110 includes a first storage medium, which may be persistent memory. For example, the second cache node 120 includes a second storage medium, which may be persistent memory.
It should be noted that, in the embodiment of the present disclosure, the cache unit 10 may be configured to implement the foregoing data acceleration method, and for the specific functions and technical effects of the cache unit 10, reference may be made to the description about the data acceleration method, which is not described herein again. The components and structure of the cache molecule 10 shown in fig. 14 are exemplary only, and not limiting, and the cache molecule 10 may include other components and structures as desired. For the detailed description of the first cache node 110 and the second cache node 120, reference may be made to the above description of the first cache node and the second cache node, and details are not repeated here.
At least one embodiment of the present disclosure further provides an electronic device, which includes the cache unit provided in any embodiment of the present disclosure. The electronic equipment can ensure the consistency of data, realizes high availability of cache service, ensures that the data cache service is not limited by node failure, can still provide the data cache service when the node failure occurs, has high response speed and no data loss, and can improve the reliability and the availability of a system.
Fig. 15 is a schematic block diagram of an electronic device provided in some embodiments of the present disclosure. As shown in fig. 15, the electronic device 20 includes a buffer unit 21. For example, the buffer unit 21 may be the buffer unit 10 shown in fig. 14. The cache unit 21 may implement the data acceleration method provided in the embodiment of the present disclosure. For example, the electronic device 20 may be any suitable device such as a storage system, a storage server, etc., as long as the device can provide a data caching service, and the embodiment of the disclosure is not limited thereto. For detailed description and technical effects of the electronic device 20, reference may be made to the above description about the cache unit 10 and the data acceleration method, which are not described herein again.
At least one embodiment of the present disclosure also provides an electronic device comprising a processor and a memory, one or more computer program modules being stored in the memory and configured to be executed by the processor, the one or more computer program modules comprising instructions for implementing the data acceleration method provided by any of the embodiments of the present disclosure. The electronic equipment can ensure the consistency of data, realizes high availability of cache service, ensures that the data cache service is not limited by node failure, can still provide the data cache service when the node failure occurs, has high response speed and no data loss, and can improve the reliability and the availability of a system.
Fig. 16 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure. As shown in fig. 16, the electronic device 30 includes a processor 31 and a memory 32. Memory 32 is used to store non-transitory computer readable instructions (e.g., one or more computer program modules). The processor 31 is configured to execute non-transitory computer readable instructions, which when executed by the processor 31 may perform one or more of the steps of the data acceleration method described above. The memory 32 and the processor 31 may be interconnected by a bus system and/or other form of connection mechanism (not shown). For example, the data acceleration method according to the embodiment of the present disclosure is implemented by an application program running in an operating system of the electronic device 30.
For example, the processor 31 may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP) or other form of processing unit having data processing capability and/or program execution capability, such as a Field Programmable Gate Array (FPGA), or the like; for example, the Central Processing Unit (CPU) may be an X86 or ARM architecture or the like. The processor 31 may be a general-purpose processor or a special-purpose processor and may control other components in the electronic device 30 to perform desired functions.
For example, memory 32 may comprise any combination of one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory can include, for example, Random Access Memory (RAM), cache memory, and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), a hard disk, an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), USB memory, flash memory, and the like. One or more computer program modules may be stored on the computer-readable storage medium and executed by the processor 31 to implement the various functions of the electronic device 30. Various applications and various data, as well as various data used and/or generated by the applications, and the like, may also be stored in the computer-readable storage medium.
It should be noted that, in the embodiment of the present disclosure, reference may be made to the above description on the data acceleration method for specific functions and technical effects of the electronic device 30, and details are not described herein again.
At least one embodiment of the present disclosure also provides a storage medium for storing non-transitory computer-readable instructions, which when executed by a computer, can implement the data acceleration method provided by any one of the embodiments of the present disclosure. The storage medium can ensure the consistency of data, realize the high availability of the cache service, ensure that the data cache service is not limited by node failure, still provide the data cache service when the node failure occurs, have high response speed and no data loss, and can improve the reliability and the availability of a system.
Fig. 17 is a schematic diagram of a storage medium according to some embodiments of the present disclosure. As shown in fig. 17, the storage medium 40 is used to store non-transitory computer readable instructions 41. For example, the non-transitory computer readable instructions 41, when executed by a computer, may perform one or more steps in accordance with the data acceleration methods described above.
For example, the storage medium 40 may be applied to the electronic device described above. The storage medium 40 may be, for example, the memory 32 in the electronic device 30 shown in fig. 16. For example, the related description about the storage medium 40 may refer to the corresponding description of the memory 32 in the electronic device 30 shown in fig. 16, and will not be repeated here.
The following points need to be explained:
(1) the drawings of the embodiments of the disclosure only relate to the structures related to the embodiments of the disclosure, and other structures can refer to common designs.
(2) Without conflict, embodiments of the present disclosure and features of the embodiments may be combined with each other to arrive at new embodiments.
The above description is only a specific embodiment of the present disclosure, but the scope of the present disclosure is not limited thereto, and the scope of the present disclosure should be subject to the scope of the claims.

Claims (20)

1. A data acceleration method for providing data caching service for a first cache request sent to a first cache node, comprising:
in response to the first cache request sent to the first cache node being non-responsive, sending the first cache request to a second cache node different from the first cache node;
the second cache node blocks the rest cache requests corresponding to the first cache node in the request queue;
reading metadata corresponding to the first target data stored in the second cache node into a memory of the second cache node to realize persistent storage;
based on the first target data stored in the second cache node, the second cache node responds to the first cache request, and sequentially receives and responds to the remaining cache requests corresponding to the first cache node in the request queue, so that the second cache node is used for replacing the first cache node to provide data cache service;
the first target data and the metadata corresponding to the first target data are transmitted from the first cache node to the second cache node by using a remote direct data access method and are stored in the second cache node.
2. The data acceleration method of claim 1, further comprising:
in response to the first cache node receiving the first cache request, storing the first target data to the first cache node;
transmitting the first target data to the second cache node and storing the first target data to the second cache node by using the remote direct data access method;
returning, by the first cache node, a response to the first cache request.
3. The data acceleration method of claim 2, wherein the first cache node comprises a first storage medium, the second cache node comprises a second storage medium,
the first storage medium and/or the second storage medium comprise persistent memory.
4. The data acceleration method of claim 3, wherein storing the first target data to the first cache node comprises:
processing the first target data to generate at least one fragment data file;
storing the at least one fragmented data file into the first storage medium, and generating a management data structure based on a storage address of the at least one fragmented data file, where the management data structure is used to manage the at least one fragmented data file;
and storing the management data structure as metadata corresponding to the first target data in the first storage medium.
5. The data acceleration method of claim 4, wherein the management data structure comprises a first linked list comprising file nodes and a second linked list comprising at least one sharded data management node,
the file nodes comprise first pointers, the first pointers point to corresponding fragment data management nodes in the second linked list, the fragment data management nodes comprise at least one second pointer, and the second pointers point to initial storage addresses of corresponding fragment data files.
6. The data acceleration method of claim 4, wherein the size of each sliced data file is the same.
7. The data acceleration method of claim 4, wherein transmitting and storing the first target data to the second cache node using the remote direct data access method comprises:
calling the library file of the first storage medium, transmitting the first target data to the second cache node in the form of the fragmented data file through a network by using the remote direct data access method, and storing the first target data in the second storage medium;
and calling the library file of the first storage medium, transmitting the metadata corresponding to the first target data to the second cache node through the network by using the remote direct data access method, and storing the metadata in the second storage medium.
8. The data acceleration method of claim 4, wherein the storage space of the first storage medium includes a target local space, the first target data and metadata corresponding to the first target data are stored in the target local space of the first storage medium,
the storage space of the second storage medium comprises a mirror image backup space, and the first target data and the metadata corresponding to the first target data are stored in the mirror image backup space of the second storage medium in a mirror image manner.
9. The data acceleration method of claim 8, wherein the storage space of the first storage medium further comprises a target backup space, the storage space of the second storage medium further comprises a mirror local space,
the data acceleration method further comprises the following steps:
in response to the second cache node receiving a second cache request, storing second target data in a mirror local space of the second storage medium;
transmitting the second target data to the first cache node and storing the second target data in a target backup space of the first storage medium in a mirror image manner by using the remote direct data access method;
returning, by the second cache node, a response to the second cache request.
10. A data acceleration method according to any one of claims 3-9,
the first cache node and the second cache node are physically independent cache nodes, and the first storage medium and the second storage medium are physically independent storage media; or
The first cache node and the second cache node are logically independent cache nodes but physically the same cache device, and the first storage medium and the second storage medium are different storage areas of the same persistent memory.
11. A method of data acceleration according to any of the claims 2-9, wherein the first cache request comprises a write data request.
12. The data acceleration method of claim 8, further comprising:
based on the metadata read into the memory, storing the fragmented data file which is stored in the mirror image backup space of the second storage medium and needs to be subjected to the down-brushing operation to a persistence layer of the second cache node;
and deleting the fragmented data files stored in the persistence layer in the mirror image backup space of the second storage medium.
13. The data acceleration method of claim 12, wherein the first cache request sent to the first cache node is unresponsive due to failure of the first cache node to respond to the first cache request.
14. A data acceleration method for providing data caching service for a first cache request corresponding to a first cache node and sent to a second cache node different from the first cache node, wherein the first cache request includes a write data request for writing first target data to a first storage medium of the first cache node, the data acceleration method comprising:
in response to the first cache request sent to the second cache node not being responded to, sending the first cache request to the first cache node;
the first cache node blocks the rest cache requests corresponding to the first cache node in the request queue;
emptying the storage space of the first storage medium of the first cache node;
storing all the fragmented data files stored in a second storage medium of the second cache node to a persistence layer of the second cache node;
the second cache node sends a brushing completion identifier to the first cache node;
and the first cache node responds to the first cache request, and sequentially receives and responds to the remaining cache requests corresponding to the first cache node in the request queue, so that the first cache node is utilized to provide data cache service.
15. The data acceleration method of claim 14, wherein the second cache node is unable to respond to the first cache request due to a change in a network connection protocol that is changed due to a failure resolution of the first cache node.
16. A cache unit comprising a first cache node and a second cache node communicatively coupled, wherein,
the cache unit is configured to provide a data caching service to a first cache request sent to the first cache node;
the cache unit is further configured to send the first cache request to the second cache node in response to the first cache request sent to the first cache node being non-responsive;
the second cache node is configured to block the remaining cache requests in the request queue corresponding to the first cache node;
the second cache node is further configured to read metadata corresponding to the first target data stored in the second cache node into a memory of the second cache node to implement persistent storage;
the second cache node is further configured to respond to the first cache request based on the first target data stored in the second cache node, and sequentially receive and respond to the remaining cache requests corresponding to the first cache node in the request queue, so that the second cache node is used for replacing the first cache node to provide a data cache service;
the metadata corresponding to the first target data is transmitted to the second cache node by the first cache node by using a remote direct data access method and is stored in the second cache node.
17. The cache unit of claim 16 wherein the first cache node comprises a first storage medium, the second cache node comprises a second storage medium,
the first storage medium and/or the second storage medium comprise persistent memory.
18. An electronic device comprising the cache unit of claim 16 or 17.
19. An electronic device, comprising:
a processor;
a memory including one or more computer program modules;
wherein the one or more computer program modules are stored in the memory and configured to be executed by the processor, the one or more computer program modules comprising instructions for implementing the data acceleration method of any of claims 1-15.
20. A storage medium storing non-transitory computer readable instructions which, when executed by a computer, implement the data acceleration method of any of claims 1-15.
CN202110338562.7A 2021-03-30 2021-03-30 Data acceleration method, cache unit, electronic device and storage medium Active CN112988680B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110338562.7A CN112988680B (en) 2021-03-30 2021-03-30 Data acceleration method, cache unit, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110338562.7A CN112988680B (en) 2021-03-30 2021-03-30 Data acceleration method, cache unit, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN112988680A CN112988680A (en) 2021-06-18
CN112988680B true CN112988680B (en) 2022-09-27

Family

ID=76338223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110338562.7A Active CN112988680B (en) 2021-03-30 2021-03-30 Data acceleration method, cache unit, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112988680B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721845B (en) * 2021-07-30 2023-08-25 苏州浪潮智能科技有限公司 Volume processing method, system, equipment and computer readable storage medium
CN113672524B (en) 2021-08-20 2024-07-02 上海哔哩哔哩科技有限公司 Data processing method and system based on multi-level cache
CN116610598A (en) * 2022-02-08 2023-08-18 华为技术有限公司 A data storage system, data storage method, device and related equipment
CN119322657A (en) * 2023-07-17 2025-01-17 华为技术有限公司 Data processing system, data processing method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107346307A (en) * 2016-05-04 2017-11-14 北京京东尚科信息技术有限公司 Distributed cache system and method
CN107967270A (en) * 2016-10-19 2018-04-27 北京京东尚科信息技术有限公司 Realize the method and system of multi-functional caching
CN111125175A (en) * 2019-12-20 2020-05-08 北京奇艺世纪科技有限公司 Service data query method and device, storage medium and electronic device
CN111541753A (en) * 2020-04-16 2020-08-14 深圳市网心科技有限公司 Distributed storage system, method, computer device and medium for block chain data

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120089700A1 (en) * 2010-10-10 2012-04-12 Contendo, Inc. Proxy server configured for hierarchical caching and dynamic site acceleration and custom object and associated method
CN102843403A (en) * 2011-06-23 2012-12-26 盛大计算机(上海)有限公司 File processing method based on distributed file system, system, and client
US10223326B2 (en) * 2013-07-31 2019-03-05 Oracle International Corporation Direct access persistent memory shared storage
CN103747073A (en) * 2013-12-30 2014-04-23 乐视网信息技术(北京)股份有限公司 Distributed caching method and system
US10884926B2 (en) * 2017-06-16 2021-01-05 Alibaba Group Holding Limited Method and system for distributed storage using client-side global persistent cache
CN107329708A (en) * 2017-07-04 2017-11-07 郑州云海信息技术有限公司 A kind of distributed memory system realizes data cached method and system
CN107862064B (en) * 2017-11-16 2021-09-10 北京航空航天大学 High-performance and extensible lightweight file system based on NVM (non-volatile memory)
CN111124993B (en) * 2018-10-31 2023-09-01 伊姆西Ip控股有限责任公司 Method, apparatus and program product for reducing cache data mirror latency in I/O processing
CN111708719B (en) * 2020-05-28 2023-06-23 西安纸贵互联网科技有限公司 Computer storage acceleration method, electronic equipment and storage medium
CN112468601B (en) * 2021-02-03 2021-05-18 柏科数据技术(深圳)股份有限公司 Data synchronization method, access method and system of distributed storage system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107346307A (en) * 2016-05-04 2017-11-14 北京京东尚科信息技术有限公司 Distributed cache system and method
CN107967270A (en) * 2016-10-19 2018-04-27 北京京东尚科信息技术有限公司 Realize the method and system of multi-functional caching
CN111125175A (en) * 2019-12-20 2020-05-08 北京奇艺世纪科技有限公司 Service data query method and device, storage medium and electronic device
CN111541753A (en) * 2020-04-16 2020-08-14 深圳市网心科技有限公司 Distributed storage system, method, computer device and medium for block chain data

Also Published As

Publication number Publication date
CN112988680A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN112988680B (en) Data acceleration method, cache unit, electronic device and storage medium
CN110113420B (en) NVM-based distributed message queue management system
CN107888657B (en) Low Latency Distributed Storage System
US9307024B2 (en) Efficient storage of small random changes to data on disk
CN115599747B (en) Metadata synchronization method, system and equipment of distributed storage system
US11182084B2 (en) Restorable memory allocator
JP2016513306A (en) Data storage method, data storage device, and storage device
US11240306B2 (en) Scalable storage system
CN117255101B (en) Data processing method, device, equipment and medium of distributed storage system
CN110121874B (en) A memory data replacement method, server node and data storage system
US20050278483A1 (en) Local bitmaps for an array of redundant storage devices
US10620851B1 (en) Dynamic memory buffering using containers
US9910808B2 (en) Reflective memory bridge for external computing nodes
WO2022033269A1 (en) Data processing method, device and system
CN111611223A (en) Methods, systems, electronic devices and media for accessing non-volatile data
WO2023093091A1 (en) Data storage system, smart network card, and computing node
WO2019089057A1 (en) Scalable storage system
JP6376626B2 (en) Data storage method, data storage device, and storage device
CN119728719A (en) Data synchronization method, storage medium, electronic device, and program product
CN111796772A (en) Cache management method, cache node and distributed storage system
CN118540336A (en) Distributed data transmission method and distributed data access system
WO2024114105A1 (en) Updating method and system for data in database, and computing device cluster
CN114490540B (en) Data storage method, medium, device and computing equipment
US20230185822A1 (en) Distributed storage system
US8595457B1 (en) Method and system for replicating stored information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant