Data caching method and related system
By identifying and cacheing duplicate data in the storage system, differentiated processing of duplicate data and non-delete data is achieved, the data fragmentation problem caused by duplicate data is solved, and the read performance and overall efficiency of the storage system are improved.
Patent Information
- Application Number
- CN202310707456.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
Deduplication (deletion) leads to data fragmentation, reducing the read performance of storage systems, especially the sequential read performance has significantly decreased.
By determining whether the data read by the IO request is deletion data, if it is deletion data, the data is cached to realize the sense of deletion semantics, and differentiated processing of deletion and non-deletion data to ensure deletion The read IO of the data is hit in the cache to improve read performance.
It effectively avoids sequential read degradation into small block random reads, significantly improves read performance, maximizes cache space efficiency, and improves overall performance.
Smart Images

Figure CN119148920A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a data caching method, device, storage system, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of the computing industry, a huge amount of data is generated. The above data can be stored in a storage system so that the storage system can be accessed to obtain the data later. For example, a client can send an input output (IO) request to the storage system to request access to the storage system.
[0003] In order to improve IO efficiency, storage systems usually use high-speed storage media such as dynamic random access memory (DRAM) or storage class memory (SCM) to cache data for slow storage media such as hard disk drive (HDD) or solid state disk (SSD). Specifically, the storage system includes a cache, and the cache relies on an elimination algorithm to swap in and out data. For example, the cache can cache hot data to ensure the read latency of hot data. For another example, for sequential reads, the cache can use a pre-fetch algorithm to load data into the cache in advance to ensure the latency of sequential reads.
[0004] Considering the storage cost, storage systems usually also support data deduplication (i.e. deduplication). Deduplication is to divide the data into fine-grained blocks, calculate fingerprint features based on the data content, and identify and delete duplicate content in the data by comparing the fingerprint features. Duplicate content is only stored once, thereby achieving the goal of data reduction.
[0005] However, the introduction of deduplication causes data to be addressed based on content instead of logical addressing. The reading of deduplicated data is converted to the reading of deduplicated blocks. Since deduplication will randomize the physical layout of deduplicated blocks, the sequential reading of large blocks actually degenerates into random reading of multiple small blocks (that is, data fragmentation), and the reading performance is severely degraded. Summary of the invention
[0006] The present application provides a data caching method, which determines whether the data read by an IO request is deduplicated data, and caches the target data if it is deduplicated data, thereby realizing the perception of deduplication semantics, and performing differentiated processing on deduplicated data and non-deduplicated data, thereby ensuring that subsequent read IOs for the deduplicated data can hit the cache, thereby improving read performance.
[0007] In a first aspect, the present application provides a data caching method. The method may be performed by a storage system. Specifically, the storage system may receive an IO request, determine whether the target data accessed by the IO request is deduplicated data, and execute the IO request to read the target data, and when the target data accessed by the IO request is deduplicated data, cache the target data.
[0008] The method determines whether the target data read by the IO request is deduplicated data. For the target data determined to be deduplicated data, the target data is cached, thereby realizing the perception of deduplication semantics and performing differentiated processing on deduplicated data and non-deduplicated data, ensuring that the subsequent read IO of the deduplicated data can hit the cache, thereby improving the read performance.
[0009] In some possible implementations, the storage system can determine whether the target data accessed by the IO request is deduplicated data by querying the index information of the stored data. This method realizes the perception of deduplication semantics by using the index information of the stored data, thereby providing support for differential processing of deduplicated data and non-deduplicated data.
[0010] In some possible implementations, the index information is a key-value pair, wherein the key in the key-value pair is the logical address of the stored data, and the value in the key-value pair is the physical address or fingerprint of the stored data. The stored data may include deduplicated data (data that triggers deduplication) or non-deduplicated data (data that does not trigger deduplication). Deduplicated data and non-deduplicated data may be stored in the same file, for example, in the same table. For non-deduplicated data, the value in the key-value pair is the physical address, and for deduplicated data, the value in the key-value pair is the fingerprint (for example, the physical address is modified to the fingerprint). Accordingly, the storage system can query the key-value pair in the index information that matches the logical address in the IO request based on the logical address in the IO request, and when the value in the key-value pair that matches the logical address in the IO request is the fingerprint, it is determined that the target data read by the IO request is deduplicated data.
[0011] In the case where the index information of deduplicated data and non-deduplicated data is stored in the same file, this method quickly determines whether the target data accessed by the IO request is deduplicated data or non-deduplicated data by determining that the value in the successfully matched key-value pair is the physical address or fingerprint, thereby improving the efficiency of perceiving deduplication semantics and reducing the difficulty of perceiving deduplication semantics.
[0012] In some possible implementations, the index information of the stored data includes the index information of the deduplicated data, and the index information of the deduplicated data can be stored separately from the index information of the non-deduplicated data in different files, for example, respectively in different tables. The index information of the deduplicated data includes the logical address of the deduplicated data. Accordingly, the storage system can query the index item in the index information that matches the logical address in the IO request based on the logical address in the IO request. When the index item that matches the logical address in the IO request is queried, the storage system can determine that the target data read by the IO request is deduplicated data.
[0013] In the case where the index information of deduplicated data and non-deduplicated data is stored in different files, this method quickly determines whether the target data accessed by the IO request is deduplicated data or non-deduplicated data by determining whether the index information of the deduplicated data matches the logical address in the IO request, thereby improving the efficiency of perceiving deduplication semantics and reducing the difficulty of perceiving deduplication semantics.
[0014] In some possible implementations, when the target data accessed by an IO request is non-deduplicated data, the storage system can also eliminate the target data. This can achieve differentiated processing of deduplicated data flows and non-deduplicated data flows in the cache, retain high-value deduplicated data flows in the cache, accelerate the elimination of low-value non-deduplicated data flows, maximize cache space efficiency, and maximize overall performance benefits.
[0015] In some possible implementations, the IO request is a sequential IO. This method determines the target data read by the sequential IO to perceive the deduplication semantics, and performs differential processing on the deduplication data and the non-deduplication data, thereby avoiding the sequential read from degenerating into a small random read, and significantly improving the performance.
[0016] In some possible implementations, when the heat of an IO request meets a set condition, the storage system can determine whether the target data accessed by the IO request is deduplicated data. The heat can be characterized by a corresponding heat index, for example, by an average value, a maximum value, a minimum value of a reuse distance, or an integral result of a reuse distance. The set condition can be a condition related to a threshold. For example, the set condition can be that the average value of the reuse distance is less than a corresponding threshold, and for another example, the set condition can be that the integral result of the reuse distance is less than a corresponding threshold.
[0017] This method identifies the heat of IO requests. When the heat meets the corresponding set conditions, it determines that the target data accessed by the IO request is hot data with cache value. For the hot data, it perceives its deduplication semantics and performs differentiated processing on the deduplicated data and non-deduplicated data in the hot data, which can make full use of the cache space and improve the overall performance.
[0018] In a second aspect, the present application provides a data cache device. The device comprises:
[0019] A deduplication information sensing module, used for receiving an input / output (IO) request and determining whether target data accessed by the IO request is deduplication data;
[0020] The cache data layout module is used to execute the IO request to read the target data, and when the target data accessed by the IO request is deduplicated data, cache the target data.
[0021] In some possible implementations, the deduplication information perception module is specifically used to:
[0022] By querying the index information of the stored data, it is determined whether the target data accessed by the IO request is deduplicated data.
[0023] In some possible implementations, the index information is a key-value pair, the key in the key-value pair is the logical address of the stored data, and the value in the key-value pair is the physical address or fingerprint of the stored data;
[0024] The deduplication information perception module is specifically used for:
[0025] According to the logical address in the IO request, query the index information for a key-value pair that matches the logical address in the IO request;
[0026] When the value in the key-value pair matching the logical address in the IO request is a fingerprint, it is determined that the target data read by the IO request is deduplicated data.
[0027] In some possible implementations, the index information of the stored data includes index information of deduplicated data, and the index information of the deduplicated data includes a logical address of the deduplicated data;
[0028] The deduplication information perception module is specifically used for:
[0029] According to the logical address in the IO request, query the index information for an index item that matches the logical address in the IO request;
[0030] When an index item matching the logical address in the IO request is found, it is determined that the target data read by the IO request is deduplicated data.
[0031] In some possible implementations, the cache data layout module is further used to:
[0032] When the target data accessed by the IO request is non-deduplicated data, the target data is eliminated.
[0033] In some possible implementations, the IO request is a sequential IO request.
[0034] In some possible implementations, the deduplication information perception module is specifically used to:
[0035] When the heat of the IO request meets the set condition, it is determined whether the target data accessed by the IO request is deduplicated data.
[0036] In a third aspect, the present application provides a storage system. The storage system includes a controller and a hard disk. The controller and the hard disk communicate with each other. The controller is used to execute computer-readable instructions so that the storage system executes the data caching method described in the first aspect or any implementation of the first aspect.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions instruct a storage system to execute the data caching method described in the first aspect or any one of the implementations of the first aspect.
[0038] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a storage system, enables the storage system to execute the data caching method described in the first aspect or any one of the implementations of the first aspect.
[0039] Based on the implementations provided in the above aspects, the present application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.
[0041] Figures 1A to 1D They are respectively schematic diagrams of the architecture of the storage system provided in the embodiments of the present application;
[0042] Figure 2A A schematic diagram of a process flow of reading data in a storage system with a deduplication function provided in an embodiment of the present application;
[0043] Figure 2B A schematic diagram of a sequential read degenerating into a random read provided in an embodiment of the present application;
[0044] Figure 3 A flowchart of a data caching method provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the structure of a data cache device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0047] First, some technical terms involved in the embodiments of the present application are introduced.
[0048] Data deduplication (DD), also known as deduplication, is a data reduction solution that removes duplicate data so that only one copy of the same data is stored in the storage medium, thereby saving data storage space. Deduplication can be achieved by dividing the data into blocks, calculating the fingerprint (FP) of the data block based on the content of the data block, and then comparing the fingerprints of different data blocks to identify and delete the data blocks with duplicate content, thereby achieving the goal of eliminating data redundancy.
[0049] Fingerprint refers to the identity information used to identify the data block, which is determined based on the content of the data block. The fingerprint of the data block can be a message digest calculated by a message digest algorithm on the content of the data block. Among them, the message digest algorithm is usually based on a hash function, that is, a hash function implementation. Therefore, the fingerprint of the data block can also be a hash value or a hash value determined by a hash function or a hash function.
[0050] The data caching method provided in the present application can be applied to a storage system with a deduplication function. The above storage system can be divided into the following categories according to logical functions: primary storage and backup storage. The primary storage serves as a storage pool or hard disk for upper-level applications and can be accessed by upper-level applications such as applications deployed in the form of virtual machines (VMs). The backup storage serves as a warehouse for storing images, backup disks or snapshots, which are usually not directly accessible to VMs. The primary storage and backup storage can be physically separated storage systems, or the same storage system can serve as both primary storage and backup storage.
[0051] The above storage system (including primary storage and backup storage) can adopt local storage mode or cloud storage mode. Among them, local storage refers to the mode of storing data in one's own physical storage device, and cloud storage refers to the mode of storing data in a cloud environment to support access to data through the network. The cloud environment refers to the cluster built by the cloud service provider (also known as cloud vendor) to provide computing resources, storage resources, and network resources.
[0052] The storage system may adopt a centralized storage architecture or a distributed storage architecture. In other words, the storage system may be a centralized storage system or a distributed storage system. Examples are given below to illustrate each.
[0053] A centralized storage system is a central node composed of one or more main devices. Data is stored in this central node, and all data processing services of the entire system are centrally deployed on this central node. In other words, in a centralized storage system, the terminal or client is only responsible for data entry and output, while the storage and control processing of data are completely completed by the central node. The biggest feature of a centralized system is its simple deployment structure. There is no need to consider how to deploy services on multiple nodes, nor is there any need to consider the distributed collaboration between multiple nodes.
[0054] For ease of understanding, Figure 1A A centralized storage system architecture is shown. Figure 1A In the application scenario shown, users access data through applications. Computers that run these applications are called "application servers". Application server 100 can be a physical machine or a virtual machine VM. Physical machines (physical application servers) include but are not limited to desktop computers, servers, laptops, and mobile devices. The application server accesses the storage system through the fiber optic switch 110 to access data. However, the switch 110 is only an optional device, and the application server 100 can also communicate directly with the storage system 120 through the network. Alternatively, the fiber optic switch 110 can also be replaced with an Ethernet switch, an InfiniBand (IB) switch, an RDMA (RDMA over Converged Ethernet, RoCE) switch based on converged Ethernet, etc.
[0055] Figure 1A The storage system 120 shown is a centralized storage system. The centralized storage system is characterized by having a unified entrance through which all data from external devices must pass, and this entrance is the engine 121 of the centralized storage system. The engine 121 is the core component of the centralized storage system, and many advanced functions of the storage system are implemented in it.
[0056] like Figure 1A As shown, the engine 121 has one or more controllers. Figure 1ATake the example of an engine containing two controllers. There is a mirror channel between controller 0 and controller 1. Then, when controller 0 writes a copy of data into its memory 124, it can send a copy of the data to controller 1 through the mirror channel, and controller 1 stores the copy in its local memory 124. In this way, controller 0 and controller 1 back up each other. When controller 0 fails, controller 1 can take over the business of controller 0, and when controller 1 fails, controller 0 can take over the business of controller 1, thereby avoiding the unavailability of the entire storage system 120 due to hardware failure. When 4 controllers are deployed in the engine 121, there is a mirror channel between any two controllers, so any two controllers back up each other.
[0057] The engine 121 also includes a front-end interface 125 and a back-end interface 126, wherein the front-end interface 125 is used to communicate with the application server 100, thereby providing storage services for the application server 100. The back-end interface 126 is used to communicate with the hard disk 134 to expand the capacity of the storage system. Through the back-end interface 126, the engine 121 can connect more hard disks 134, thereby forming a very large storage resource pool.
[0058] In hardware, such as Figure 1A As shown, the controller 0 includes at least a processor 123 and a memory 124. The processor 123 is a central processing unit (CPU) used to process data access requests from outside the storage system (server or other storage system), and also used to process requests generated inside the storage system. Exemplarily, when the processor 123 receives a write data request sent by the application server 100 through the front-end port 125, the data in these write data requests will be temporarily stored in the memory 124. When the total amount of data in the memory 124 reaches a certain threshold, the processor 123 sends the data stored in the memory 124 to the hard disk 134 through the back-end port for persistent storage.
[0059] The memory 124 refers to an internal memory that directly exchanges data with the processor. It can read and write data at any time and at a high speed, and serves as a temporary data storage for the operating system or other running programs. The memory includes at least two types of memories, for example, the memory can be either a random access memory or a read-only memory (ROM). For example, the random access memory is a dynamic random access memory (DRAM) or a storage class memory (SCM), and the read-only memory can be a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), etc.
[0060] The memory 124 stores software programs, and the processor 123 runs the software programs in the memory 124 to manage the hard disk. For example, the hard disk is abstracted into a storage resource pool, and then divided into LUNs for use by the server. The LUN here is actually the hard disk seen on the server. Of course, some centralized storage systems are also file servers themselves, which can provide shared file services for the server.
[0061] Controller 1 (and others Figure 1A The hardware components and software structure of the controller (not shown in the figure) are similar to those of the controller 0 and will not be repeated here.
[0062] Figure 1A The illustrated embodiment is a centralized storage system with a disk-controller separation. In the system, the engine 121 may not have a hard disk slot, and the hard disk 134 needs to be placed in the hard disk frame 130, and the back-end interface 126 communicates with the hard disk frame 130. The back-end interface 126 exists in the engine 121 in the form of an adapter card, and two or more back-end interfaces 126 can be used simultaneously on one engine 121 to connect multiple hard disk frames. Alternatively, the adapter card can also be integrated on the motherboard, and the adapter card can communicate with the processor 123 via the PCIE bus.
[0063] It should be noted that Figure 1A Only one engine 121 is shown in the figure. However, in actual applications, the storage system may include two or more engines 121, and redundancy or load balancing is performed between the multiple engines 121.
[0064] The hard disk frame 130 includes a control unit 131 and a plurality of hard disks 134. The control unit 131 may have various forms. Generally, the number of control units 131 may be one, two or more. When the hard disk frame 130 includes at least two control units 131, the hard disk 134 and the control unit 131 may have an ownership relationship. The function of the control unit 131 may be offloaded to the network card 104. In this embodiment, the hard disk frame 130 does not have a control unit 131 inside, but the network card 104 completes data reading and writing, address conversion and other computing functions. At this time, the network card 104 is an intelligent network card. It may include a CPU and memory. In some application scenarios, the network card 104 may also have a persistent memory medium, such as a persistent memory (PM), or a non-volatile random access memory (NVRAM), or a phase change memory (PCM). The CPU is used to perform operations such as address conversion and reading and writing data. The memory is used to temporarily store data to be written to the hard disk 134, or data read from the hard disk 134 to be sent to the controller.
[0065] The centralized storage system can also be a disk-control integrated architecture. In the disk-control integrated architecture, the engine 121 has a hard disk slot, and the hard disk 134 can be directly deployed in the engine 121. The back-end interface 126 is an optional configuration. When the system storage space is insufficient, more hard disks or hard disk frames can be connected through the back-end interface 126. Figure 1B As shown, the engine 121 can be connected to more hard disks 134 through the backend interface 126 .
[0066] A distributed storage system is a system that stores data in multiple independent storage nodes. The distributed storage system adopts an extensible system structure and uses multiple storage nodes to share the storage load. It not only improves the reliability, availability and access efficiency of the system, but also makes it easy to expand.
[0067] Distributed storage systems can adopt a storage-computing integrated architecture or a storage-computing separated architecture. The following describes each of them.
[0068] like Figure 1C As shown, the distributed storage system integrating storage and computing includes a storage cluster. The storage cluster includes one or more servers 110 ( Figure 1CThree servers 110 are shown in the figure, but not limited to three servers 110), and each server 110 can communicate with each other. Server 110 is a device that has both computing and storage capabilities, such as a server, a desktop computer, etc. For example, an ARM server or an X86 server can be used as the server 110 here. In terms of hardware, server 110 includes at least a processor 112, a memory 113, a network card 114, and a hard disk 105. The processor 112, the memory 113, the network card 114, and the hard disk 105 are connected through a bus. Processor 112 is a central processing unit (CPU), which is used to process data access requests from outside the server 110 (application server or other server 110), and is also used to process requests generated inside the server 110. In addition, processor 112 is also used for data calculation or processing, such as metadata management, deduplication, data compression, data verification, virtualized storage space, and address conversion.
[0069] like Figure 1D As shown in FIG. 1 , the distributed storage cluster with storage and computing separation includes a computing cluster (also called a computing node cluster) and a storage cluster (also called a storage node cluster). Each computing node 110 can communicate with each other. The computing node 110 is a computing device, such as a server, a desktop computer, or a controller of a storage array. In terms of hardware, Figure 1D As shown, the computing node 110 includes at least a processor 112, a memory 113 and a network card 114. Among them, the processor 112 is a central processing unit (CPU), which is used to process data access requests from outside the computing node 110, or requests generated inside the computing node 110. When the total amount of data in the memory 113 reaches a certain threshold, the processor 112 sends the data stored in the memory 113 to the storage node 100 for persistent storage. In addition, the processor 112 is also used for data calculation or processing, such as metadata management, deduplication, data compression, virtualized storage space, and address translation.
[0070] Any computing node 110 can access any storage node 100 in the storage node cluster through the network. The storage node cluster includes multiple storage nodes 100 ( Figure 1DThree storage nodes 100 are shown in the figure, but are not limited to three storage nodes 100). A storage node 100 includes one or more controllers 101, a network card 104 and multiple hard disks 105. The network card 104 is used to communicate with the computing node 110. The hard disk 105 is used to store data and can be a disk or other types of storage media, such as a solid-state hard disk or a shingled magnetic recording hard disk. The controller 101 is used to write data to the hard disk 105 or read data from the hard disk 105 according to the read / write data request sent by the computing node 110. In the process of reading and writing data, the controller 101 needs to convert the address carried in the read / write data request into an address that can be recognized by the hard disk. It can be seen that the controller 101 also has some simple computing functions.
[0071] It should be noted that the above is merely an example description of the storage system. In other possible implementations of the embodiments of the present application, the storage system may also be a distributed storage system or a centralized storage system of other architectures. For example, the storage system may also be a distributed storage system of a fully integrated architecture.
[0072] Whether it is a centralized storage system or a distributed storage system, it can be logically divided into a computing layer and a storage layer. In order to improve read and write performance, the above storage system logically also includes a cache layer. The cache layer can be deployed together with the storage layer. For example, the cache node (a node that implements the cache function, which can usually be a logical node) and the storage node can be deployed on the same physical node (such as the same server). The cache layer can also be deployed separately from the storage layer. For example, the cache node and the storage node are deployed on different physical nodes (such as different servers). Figure 1A , Figure 1B The computing layer may include an application server 100, the cache layer may include an engine 121, and the storage layer may include multiple hard disks 134. Figure 1C The computing layer may include a processor 112 in a server 110, the cache layer may include a cache set in a memory 113, and the storage layer may include multiple hard disks 105. Figure 1D The computing layer may include computing nodes 110 , the cache layer may include a cache in the control unit 101 , and the storage layer may include multiple hard disks 105 .
[0073] like Figure 2A As shown, the client in the computing layer can generate a read request or a write request. Among them, the read request is used to read the data in the storage layer, and the write request is used to write data to the storage layer. The cache layer is used to provide data caching functions to accelerate data reading and writing. For example, the cache layer can cache hot data. When the data to be read by the read request hits in the cache, the data can be directly obtained from the cache to improve the read performance. When the data to be read by the read request does not hit in the cache, the data can be read from the storage layer.
[0074] The computing layer also runs a data analysis engine. The data analysis engine can be a data analysis service (DAS) that implements data analysis functions. For example, in a database scenario, the data analysis engine can diagnose Structured Query Language (SQL) files, including diagnosing complex SQL such as multi-table Join and nested subqueries, thereby helping users quickly discover slow SQL and provide corresponding suggestions.
[0075] The cache in the cache layer can be divided into local cache and distributed cache. The local cache can be a cache component in the application, and the distributed cache can be a cache component or service separated from the application. A typical example of a distributed cache is a global cache. The global cache is a distributed storage cache acceleration suite that supports integrated, self-managed, and scalable deployment, provides power-off protection, and has no single point of failure. The global cache of multiple cache nodes can form a global cache pool and provide services to the outside world as a whole. The global cache includes a server adaptation layer. The server adaptation layer is usually used for unified semantic conversion, such as semantic conversion of requests sent by different clients to unify the semantics. When the global cache adopts a read-write separation design, that is, the global cache includes a read cache and a write cache, the server adaptation layer is also used for request distribution, such as sending read requests to the read cache and sending write requests to the write cache. The global cache also sets an index subsystem, also known as an index subsystem, which is used to block data, determine the fingerprint of the data block, and read and write data according to the fingerprint.
[0076] The above storage system supports deduplication (for example, it supports global deduplication, specifically determining whether to trigger deduplication based on the data stored in the storage system, not limited to local data). When writing duplicate data, the global cache can cut the data into blocks according to a fixed granularity, for example, according to 4 kilobytes (KB), and calculate a fingerprint for each data block, and route the data block to a designated storage node based on the fingerprint. When there are multiple data blocks with the same fingerprint on the storage node, deduplication can be performed.
[0077] However, deduplication can cause the routing mode to change from logical address routing based on bucket granularity (e.g., megabytes (MB) level) to routing based on data content at a smaller granularity (e.g., 4K) after segmentation. The change in routing granularity can greatly affect the read process, especially the sequential read process.
[0078] Specifically, in the case of non-deduplication, data with continuous logical block addresses (LBA) in the same bucket can be routed to the same storage node and are continuous on the physical medium. When reading these data sequentially, they can also be read continuously. However, in the case of deduplication, data with continuous LBA can be cut into blocks according to a fixed granularity (such as 4KB), and the data blocks are routed to different storage nodes according to the fingerprints of the data blocks, which makes the data discontinuous in the physical address. Accordingly, see Figure 2A In the case of deduplication, the read process may include the following steps:
[0079] ① The client running in the computing layer sends an input output (IO) request (for example, a sequential read IO), expecting to read data from three client-visible logical addresses (denoted as LBA-1, LBA-2, and LBA-3).
[0080] ② The global cache queries the read cache according to the logical address in the IO request. If the data of the above logical address is found, the data is returned. If the data of the above logical address is not found, step ③ is entered.
[0081] ③ The global cache is sliced according to the deduplication granularity (for example, 4KB).
[0082] ④ The global cache queries the fingerprints corresponding to the three logical addresses from the main database (DB) in the index subsystem according to the sliced granularity.
[0083] ⑤ After obtaining the fingerprint, the global cache queries the physical address PBA corresponding to the fingerprint from the fingerprint table of the storage node to which the fingerprint belongs.
[0084] ⑥The global cache reads data from the storage layer according to the physical address PBA.
[0085] Based on steps ① to ⑥, we can see that the introduction of deduplication causes data addressing to be changed from logical address addressing to content addressing, and the reading of deduplicated data can be converted into the reading of deduplicated blocks (i.e., the data blocks that trigger deduplication). Since deduplication will randomize the physical layout of deduplicated blocks, the sequential reading of large blocks of data actually degenerates into multiple small random reads. For example, see Figure 2B , the logical address in sequential read IO is 0~16KB, and data blocks A to D can be obtained according to the 4KB granularity block, where the fingerprints of data blocks A to D are F0 to F3 respectively, where the node corresponding to F0 and F2 is Node0, and the node corresponding to F1 and F3 is Node1, so data blocks A and C can be read from Node0, and data blocks B and D can be read from Node1. That is, deduplication leads to data fragmentation, and the read performance (especially sequential read performance) is seriously reduced. In the scenario where HDD is used as the main storage, the sequential read performance can even drop by 50%.
[0086] In view of this, the present application provides a data caching method. The method determines whether the target data read by the IO request is deduplicated data, and caches the target data determined to be deduplicated data, thereby realizing the perception of deduplication semantics, and performing differentiated processing on deduplicated data and non-deduplicated data, ensuring that subsequent read IOs for deduplicated data can hit in the cache, thereby improving read performance. In particular, sequential reads do not need to degenerate into small-block random reads, and the performance improvement is more significant.
[0087] In order to make the technical solution of the present application clearer and easier to understand, the data caching method provided by the present application will be introduced below by taking the storage system of the above embodiment as an example.
[0088] See also Figure 3 A flow chart of a data caching method is shown, the method comprising:
[0089] S302: The storage system receives an IO request.
[0090] An IO request is used to request an operation on a storage layer (e.g., a hard disk in a storage layer). Depending on the type of operation, an IO request can be divided into a read request or a write request. The embodiment of the present application mainly uses an IO request as a read request (read IO) for example.
[0091] IO requests can be generated and issued by the client. Specifically, the client can generate IO requests corresponding to the data access operations triggered by the user. For example, in a database scenario, the client can generate IO requests corresponding to the addition, deletion, query and modification (CRUD) operations on the database triggered by the user, specifically add (create), delete (delete), modify (update) or query (retrieve) operations. When the user triggers a query operation or modification operation on the database, the generated IO request may include a read request. For another example, in a file read and write scenario, the client can generate IO requests corresponding to the above operations in response to the read and write operations on the file triggered by the user. When the user triggers a read operation on the file, the generated IO request may include a read request.
[0092] S304: The storage system obtains metadata of the IO request.
[0093] Specifically, the storage system can parse the IO request, obtain the metadata of the IO request, and thus obtain the workload information. The metadata may include at least one of the IO time, IO address, and IO length. Among them, the IO time, also known as the IO access time, may specifically be the generation time or the reception time of the IO request, and can usually be represented by the generation timestamp or the reception timestamp of the IO request. The IO address may be a logical address. In some examples, the IO address may include one or more of the starting logical address or the ending logical address, and in other examples, the IO address may include multiple discrete logical addresses. The IO length refers to the length of the data accessed by the IO request.
[0094] When the logical addresses of the data accessed by the IO request are continuous, the IO request may include a starting logical address and an ending logical address, and the storage system may parse the IO request to obtain the starting logical address and the ending logical address. Alternatively, the IO request may include an IO length and at least one of the starting logical address or the ending logical address, and accordingly, the storage system may parse the IO request to obtain one of the logical address or the ending logical address and the IO length.
[0095] Furthermore, the storage system can also perform data cleaning on the metadata of the IO request. Specifically, the storage system can complete the missing metadata. For example, the storage system can determine the IO length based on the starting logical address and the ending logical address. For another example, the storage system can infer the ending logical address based on the starting logical address and the IO length, or infer the starting logical address based on the ending logical address and the IO length.
[0096] S306: The storage system determines whether the IO request belongs to a sequential flow according to the metadata of the IO request. If so, S308 is executed. If not, the target data may be eliminated after the IO request is executed to read the target data.
[0097] Specifically, the storage system can identify whether the IO request itself is a sequential flow, or whether it forms a sequential flow with historical IO requests based on the metadata of the IO request. For example, when the IO request is a large IO (the amount of data in a single operation is greater than a set value, such as 32KB or 64KB), the storage system can first identify whether the IO request itself is a sequential flow. For another example, when the IO request is a small IO (the amount of data in a single operation is less than a set value, such as 1KB or 4KB), the storage system can identify whether the IO request forms a sequential flow with historical IO requests.
[0098] In some possible implementations, the storage system can obtain the IO length and determine whether the IO is a large IO or a small IO based on the size relationship between the IO length and the set value. For large IO, the storage system can obtain the logical address carried in the IO request, such as at least one of the starting logical address or the ending logical address. When the IO request carries only one starting logical address, or only one starting and ending logical address, or carries a starting logical address and an ending logical address, and the ending logical address is equal to the starting logical address plus the IO length, then the IO request is a sequential flow. When the IO request is a read request, it indicates that the IO request is a sequential read request. For small IO, the storage system can obtain the ending logical address of the historical IO request, such as the ending logical address of the (one or more) read IO request closest to the current moment. If the ending logical address of the historical IO request is continuous with the starting logical address of the current IO request, for example, the starting logical address of the current IO request is equal to the ending logical address of the historical IO request plus 1, then it can be determined that the current IO request belongs to a sequential flow.
[0099] It should be noted that the above S304 and S306 are one implementation method for collecting workload information and identifying sequential flows. In other possible implementation methods of the embodiment of the present application, the above S304 and S306 may not be performed. For example, in some scenarios of reading large files, the storage system may default to sequential reading without additionally identifying whether the IO request belongs to a sequential flow.
[0100] S308: The storage system counts the reuse distance distribution of the data blocks accessed by the sequential flow.
[0101] The reuse distance can be the number of accesses between two consecutive accesses to the same data. When counting the reuse distance, the statistics can be performed at the granularity of data blocks. The storage system can determine the fingerprints of the data blocks accessed by the sequential flow, and for data blocks with different fingerprints, respectively count the reuse distances of the data blocks. The storage system can model the reuse distances of each data block to obtain the reuse distance distribution.
[0102] In some possible implementations, the storage system may use a histogram to count the distribution of reuse distances of each reuse in the sequence flow, wherein the abscissa of the histogram may be the reuse distance, and the ordinate may be the frequency or the number of times.
[0103] In some other possible implementations, the storage system can model the reuse distance distribution according to the reuse distance to obtain a distribution function. This distribution function is also called a cumulative distribution function (CDF). Considering that the reuse distance is a discrete variable, a probability mass function (PMF) can be used to model the reuse distance distribution, as shown below:
[0104]
[0105] Among them, p X (k) represents the probability mass function, and X can represent the reuse distance. X (x) may be a cumulative distribution function that characterizes the reuse distance distribution, and the function is defined as the probability of X≤x, ie, P(X≤x).
[0106] S310: The storage system obtains the heat of the sequence flow according to the reuse distance distribution. When the heat meets the set condition, S312 is executed.
[0107] Specifically, the storage system may set a heat index for measuring heat, and use the index value of the heat index as the heat. In some examples, the storage system may determine at least one of the average, median, maximum, or minimum values of the reuse distance based on the reuse distance distribution, and the storage system may determine at least one of the average, median, maximum, or minimum values of the reuse distance as the heat of the sequential flow. In other examples, the storage system may perform integration based on the reuse distance distribution, and determine the integration result as the heat of the sequential flow.
[0108] The storage system may also set a threshold corresponding to the heat index. For example, the storage system may set a threshold corresponding to the average value of the reuse distance. For another example, the storage system may set a threshold corresponding to the integral result of the reuse distance. The set condition may be a condition related to the threshold. For example, the set condition may be that the heat is less than the threshold. When the heat meets the set condition, such as the average value of the reuse distance is less than the threshold, the storage system may execute S312 to decide whether to cache the target data.
[0109] It should be noted that the above S308 and S310 are one implementation method for determining the heat of a sequential stream. In other possible implementation methods of the embodiments of the present application, the heat of a sequential stream may also be determined by other methods. For example, the storage system may count the reuse cycle of a data block and determine the heat of a sequential stream based on the reuse cycle. Furthermore, the storage system may not execute the above S308 and S310. For example, when the read cache is large, the storage system may not execute the above steps S308 and S310 and directly filter the sequential stream. In other words, the storage system may execute S312 for the sequential stream after determining that the IO request belongs to a sequential stream.
[0110] S312, the storage system queries the index information of the stored data according to the logical address of the data accessed by the sequence flow. When the query result indicates that the data accessed by the sequence flow is deduplicated data, S313 and S314 are executed; when the query result indicates that the data accessed by the sequence flow is non-deduplicated data, S313 and S316 are executed.
[0111] In some possible implementations, the stored data may include deduplicated data (data that triggers deduplication) and non-deduplicated data (data that does not trigger deduplication). Index information of the deduplicated data and index information of the non-deduplicated data (collectively referred to as index information of data) may be stored in the same file, for example, in the same index table. The index information may be a key-value pair, the key in the key-value pair being the logical address of the stored data, and the value in the key-value pair being the physical address or fingerprint.
[0112] The storage system can query the key-value pair in the index information that matches the logical address of the data accessed by the sequential stream (such as the logical address of the data accessed by the current IO request) based on the logical address of the data accessed by the sequential stream (such as the logical address of the data accessed by the current IO request). When the value in the key-value pair that matches the logical address of the data accessed by the sequential stream is a fingerprint, the storage system determines that the data accessed by the sequential stream is deduplicated data. When the value in the key-value pair that matches the logical address of the data accessed by the sequential stream is a physical address, the storage system determines that the data accessed by the sequential stream is non-deduplicated data.
[0113] In some other possible implementations, the index information of the deduplicated data and the index information of the non-deduplicated data may be stored in different files, such as in different index tables. The index information of the deduplicated data includes the logical address of the deduplicated data. In some examples, the index information of the deduplicated data may include the logical address and fingerprint of the deduplicated data, such as storing the logical address and the fingerprint in the form of a key-value pair.
[0114] The storage system may query the index item in the index information that matches the logical address of the data accessed by the sequential stream (e.g., the read data) according to the logical address of the data accessed by the sequential stream (e.g., the read data). When the index item that matches the logical address of the data accessed by the sequential stream is queried, the storage system determines that the data accessed by the sequential stream is deduplicated data. When the index item that matches the logical address of the data accessed by the sequential stream is not queried, the storage system determines that the data accessed by the sequential stream is non-deduplicated data.
[0115] Considering that the data accessed by the sequential stream may include multiple data blocks, the storage system may determine whether the data accessed by the sequential stream is deduplicated data or non-deduplicated data based on the query results of the multiple data blocks. In some possible implementations, the storage system may determine the data accessed by the sequential stream as deduplicated data when deduplicated data exists in the multiple data blocks. In other possible implementations, the storage system may also determine the data accessed by the sequential stream as deduplicated data when the number of data blocks that are deduplicated data in the multiple data blocks is greater than a preset number, or when the proportion of data blocks that are deduplicated data in the multiple data blocks is greater than a preset proportion.
[0116] It should be noted that Figure 3 In the illustrated embodiment, S312 is described by querying the index information of the stored data to determine whether the data accessed by the sequential flow is deduplicated data. The present application is not limited to the above implementation. The storage system may also determine whether the data accessed by the sequential flow (including the target data accessed by the IO request) is deduplicated data through other implementations.
[0117] S313: The storage system reads the data accessed by the sequential stream.
[0118] In some possible implementations, the storage system can read the data accessed by the sequential stream according to the query result of S312. Specifically, the query result indicates that the data accessed by the sequential stream is deduplicated data, and the storage system can query the physical address through the fingerprint table according to the queried fingerprint, and read the corresponding data block according to the physical address, thereby reading the data accessed by the sequential stream. The query result indicates that the data accessed by the sequential stream is non-deduplicated data, and the storage system can read the data accessed by the sequential stream according to the queried physical address. In this way, by reading the data accessed by the sequential stream with the help of the query result in the process of determining whether the data accessed by the sequential stream is deduplicated data, the number of queries can be reduced and the query overhead can be reduced.
[0119] In some other possible implementations, the storage system may first execute a read request to read the data accessed by the sequential stream, and then execute the step of determining whether the data accessed by the sequential stream is deduplicated data. Alternatively, the storage system may execute the steps of reading the data accessed by the sequential stream and determining whether the data accessed by the sequential stream is deduplicated data in parallel.
[0120] S314. The storage system caches the data accessed by the sequential flow.
[0121] In some possible implementations, the storage system may cache the deduplicated data immediately when receiving an IO request and determining that the IO request belongs to a sequential flow and the data accessed by the sequential flow (including the target data accessed by the IO request) is deduplicated data. In other possible implementations, the storage system may cache the target data first when receiving an IO request, and when elimination is triggered, if determining that the IO request belongs to a sequential flow and the data accessed by the sequential flow (including the target data) is deduplicated data, the data accessed by the sequential flow resides in the cache.
[0122] It should be noted that when the storage system does not execute steps such as determining whether an IO request belongs to a sequential flow and determining heat, the storage system may also cache the target data when receiving an IO request and determining that the target data accessed by the IO request is deduplicated data, or when receiving an IO request, first cache the target data accessed by the IO request, and when elimination is triggered, if it is determined that the target data accessed by the IO request is deduplicated data, the target data resides in the cache.
[0123] S316: The storage system eliminates the data accessed by the sequential flow.
[0124] Similarly, the storage system may eliminate the data (such as data that does not belong to the sequential stream, data whose heat does not reach the target, or data determined to be non-deduplicated data) upon receiving an IO request and determining that the IO request does not belong to a sequential stream, or that the heat of the IO request does not reach the target, or that the IO request belongs to a sequential stream but the heat of the sequential stream does not reach the target, or that the IO request belongs to a sequential stream and the heat of the sequential stream reaches the target but the data read by the sequential stream is non-deduplicated data. In other possible implementations, the storage system may also cache the target data upon receiving an IO request, and when elimination is triggered, it may eliminate the target data from the cache if it is determined that the target data accessed by the IO request is non-deduplicated data. Specifically, if the IO request belongs to a sequential stream and the heat of the sequential stream reaches the target, but the data accessed by the sequential stream is non-deduplicated data, the data accessed by the above-mentioned sequential stream may be eliminated from the cache.
[0125] It should be noted that the data cache method of the embodiment of the present application may not execute the above S316. For example, if the remaining capacity of the cache is greater than a preset value, the storage system may not execute S316.
[0126] The above S304 to S316 are a specific implementation of determining whether the target data accessed by the IO request is deduplicated data, and executing the IO request to read the target data. When the target data accessed by the IO request is deduplicated data, caching the target data is performed, that is, Figure 3The example of whether to cache data is explained by taking the sequential flow as the granularity. In actual application, the decision of whether to cache data can also be made directly based on the granularity of IO request. This application does not impose any restrictions on this.
[0127] Based on the above description, it can be seen that the present application provides a cache strategy for differentially caching deduplicated data and non-deduplicated data. For IO requests whose accessed data is deduplicated data (such as deduplicated sequential streams), the storage system can actively cache the target data accessed by the IO request (such as the data accessed by the deduplicated sequential stream), especially the hot deduplicated sequential streams. The storage system retains the target data (the data accessed by the sequential stream), so that when the target data is subsequently accessed, the target data can be obtained from the cache without having to read the target data through small block random reads, thereby improving overall performance.
[0128] based on Figure 3 The data caching method shown in the present application also provides a data caching device, which can be deployed in Figures 1A to 1D The storage system shown is, for example, distributedly deployed in the cache layer and computing layer of the storage system. The storage system runs the data cache device to execute Figure 3 The data caching method shown.
[0129] The data cache device provided by the present application is introduced below in conjunction with the embodiments.
[0130] See also Figure 4 The data cache device 400 shown in FIG. 1 includes:
[0131] A deduplication information sensing module 402 is used to receive an IO request and determine whether the target data accessed by the IO request is deduplication data;
[0132] The cache data layout module 404 is used to execute the IO request to read the target data, and when the target data accessed by the IO request is deduplicated data, cache the target data.
[0133] Furthermore, the cache data layout module 404 is also used to eliminate the target data when the target data accessed by the IO request is non-deduplicated data.
[0134] like Figure 4 As shown, the deduplication information perception module 402 and the cache data layout module 404 can be deployed in the cache layer, for example, in the read cache. Deploying these two modules in a location close to related subsystems (such as an index subsystem) can improve interaction efficiency and avoid cross-network communication overhead. In addition, the deduplication information perception module 402 and the cache data layout module 404 can be implemented through software, and the deduplication information perception module 402 and the cache data layout module 404 can share the process with the cache (such as a global cache), thereby eliminating the inter-process communication overhead.
[0135] In some possible implementations, the deduplication information sensing module 402 is used to determine whether the target data accessed by the IO request is deduplication data by querying the index information of the stored data. Depending on the storage method of the index information of the stored data, different methods can be used to determine whether the target data accessed by the IO request is deduplication data.
[0136] In some possible implementations, the index information of the deduplicated data and the index information of the non-deduplicated data are stored in the same file, such as a table. The index information is a key-value pair, the key in the key-value pair is the logical address of the stored data, and the value in the key-value pair is the physical address or fingerprint of the stored data. Accordingly, the deduplication information perception module 402 is used to query the key-value pair in the index information that matches the logical address in the IO request according to the logical address in the IO request; when the value in the key-value pair that matches the logical address in the IO request is a fingerprint, it is determined that the target data read by the IO request is deduplicated data.
[0137] In some other possible implementations, the index information of deduplicated data and the index information of non-deduplicated data are stored in different files, such as in different tables. The index information of the stored data includes the index information of the deduplicated data, and the index information of the deduplicated data includes the logical address of the deduplicated data. Accordingly, the deduplication information perception module 402 is used to query the index item in the index information that matches the logical address in the IO request based on the logical address in the IO request; when the index item that matches the logical address in the IO request is queried, it is determined that the target data read by the IO request is the deduplicated data.
[0138] The specific implementation of the deduplication information perception module 402 can be found in Figure 3 The description of S312 in the embodiment shown is not repeated here. The specific implementation of the cache data layout module 404 can be found in Figure 3 The descriptions of S313, S314, and S316 in the illustrated embodiment will not be repeated here.
[0139] In some possible implementations, the data cache device 400 may further include a heat modeling module 406. The heat modeling module 406 is used to determine the heat of the target data read by the IO request. When the heat meets the set condition, the deduplication information perception module 402 performs a step of determining whether the target data accessed by the IO request is deduplication data.
[0140] Furthermore, the heat modeling module 406 is used to count the reuse distance distribution of the data blocks read by the IO request, and obtain the heat of the target data read by the IO request according to the reuse distance distribution.
[0141] The specific implementation of the heat modeling module 406 can be found in Figure 3 The description of the relevant contents of S308 and S310 in the illustrated embodiment will not be repeated here.
[0142] In some possible implementations, the data cache device 400 may further include a workload information collection module 408 and a sequential flow identification module 410. The workload information collection module 408 is used to obtain metadata of the IO request, where the metadata includes at least one of IO time, IO address, and IO length, where the IO address is a logical address. The sequential flow identification module 410 is used to determine whether the IO request belongs to a sequential flow based on the metadata of the IO request.
[0143] The specific implementation of the workload information collection module 408 and the sequence flow identification module 410 can be found in Figure 3 The description of the relevant contents of S304 and S306 in the illustrated embodiment will not be repeated here.
[0144] It should be noted that the workload information collection module 408, the sequence flow identification module 410 and the heat modeling module 406 can be deployed on the computing node 100 (client side) where the client 102 is located, for example, deployed in the deployment data analysis engine 104. Among them, the workload information collection module 408, the sequence flow identification module 410 and the heat modeling module 406 are deployed on the client side to obtain a global complete data view, avoiding the problem of incomplete data view caused by scattered data routing.
[0145] The following is an example in which a data cache device 400 includes a workload information collection module 408, a sequence flow identification module 410, a heat modeling module 406, a deduplication information perception module 402, and a cache data layout module 404, and the workload information collection module 408, the sequence flow identification module 410, and the heat modeling module 406 are deployed on the client side, and the deduplication information perception module 402 and the cache data layout module 404 are deployed on the server side (for example, a global cache).
[0146] The workload information collection module 408 on the client side receives the IO stream (one or more IO requests) from the client and can obtain the IO time, IO address, and IO length of the IO request. The workload information collection module 408 can organize and pre-process the IO time, IO address, and IO length, for example, after data cleaning, and send them to the sequential flow identification module 410 and the thermal modeling module 406.
[0147] After receiving the workload information (e.g., metadata of IO requests) from the workload information collection module 408, the sequence flow identification module 410 identifies the sequence flow from the IO flow. For example, the sequence flow identification module 410 identifies the 1M IO request sequence of LBA [0, 1024K] as a sequence flow.
[0148] After receiving the workload information from the workload information collection module 408, the heat modeling module 406 can obtain the reuse distance of each data block, and model the reuse distance distribution based on the reuse distance. The heat of each data block can be determined through the reuse distance distribution. For example, the reuse distances in the reuse distance distribution can be sorted to obtain the heat of each data block (such as the maximum or average value of the reuse distance). Based on the heat of each data block, combined with the sequence flow identified by the sequence flow identification module 410, the heat of each sequence flow is queried. The heat of the sequence flow can be determined according to the heat of the data block corresponding to the sequence flow, for example, it can be equal to the sum of the heat of the data blocks. When the heat of the sequence flow is greater than the corresponding threshold, it means that the sequence flow is hot data with cache value. The heat modeling module 406 can send the sequence flow with a heat greater than the threshold (sequence flow with cache value) across the network to the deduplication information perception module 402 on the server side.
[0149] The deduplication awareness module 402 on the server side queries the index subsystem based on the key of the sequential stream (for example, the logical address in the sequential stream) to obtain whether the data corresponding to the key is deduplicated data. Specifically, there is a database in the index subsystem, which can store index information, including but not limited to the mapping relationship between the logical address and the physical address of the data. In the deduplication scenario, the mapping relationship is converted into a mapping relationship between the logical address and the fingerprint. When the deduplication awareness module 402 queries the index subsystem, it can access the information of the key in the database. After reading the value, it determines whether the value is a physical address or a fingerprint. If it is a fingerprint, the data corresponding to the key has been deduplicated, otherwise it has not been deduplicated.
[0150] When the data requested by the sequential flow with cache value happens to be deduplicated data, i.e., deduplicated data, the deduplication information perception module 402 can send the data to the cache data layout module 404. The cache data layout module 404 has a comprehensive information view, which includes the following indication information: whether each cache key belongs to the sequential flow, whether the data corresponding to each cache key is hot data, and whether the data corresponding to each cache key has been deduplicated. If the cache data layout module 404 finds that the data belongs to deduplicated hot data and belongs to the sequential flow when the elimination is triggered, the data will be retained to ensure that subsequent reads of the data can hit in the cache. By differentially processing the deduplicated data and non-deduplicated data in the cache, the high-value deduplicated data is retained in the cache, the elimination of low-value non-deduplicated data is accelerated, and the cache space efficiency is maximized, so as to maximize the overall performance benefits.
[0151] The present application also provides an example to illustrate the improvement of cache hit rate. In this example, the global cache is configured with a 3 terabyte (TB) non-volatile memory host controller interface specification (NVME) solid state drive (SSD) as cache, and the ratio of input output operations per second (IOPS) in the 48TB data range is hotspot: sequential: random model = 30:30:40, and the spatial range ratio is: hotspot: sequential: random model = 1T: 4T: 41T. In the deduplication scenario, the baseline is: 1T hotspot IO is fully cached, and the remaining 2T cache space caches random IO, with a hit rate of 30%. After adopting the solution of the present application, 1T hotspot IO is fully cached, and the remaining 2T cache space caches sequential IO, with a hit rate of 30% + (2T / 4T) * 30% = 45%, and the hit rate can be improved by 15%.
[0152] It should be noted that Figure 4In the illustrated embodiment, the deployment method of the data cache device 400 is merely an illustrative deployment method. In other possible implementation methods of the embodiments of the present application, the data cache device 400 may also adopt other deployment methods, for example, the various modules of the data cache device 400 may be centrally deployed on the server side, or deployed on the client side and the server side in other distributed ways. For example, the workload information collection module 408 of the data cache device 400 is deployed on the client side, such as deploying the data analysis engine 104, and the sequential flow identification module 410, the heat modeling module 406, the deduplication information perception module 402 and the cache data layout module 404 are deployed on the server side, such as being deployed in the global cache of the cache cluster. In this way, the computing pressure on the client side can be reduced.
[0153] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the storage system to execute the aforementioned data caching method.
[0154] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on a storage system, the storage system executes the above-mentioned data caching method.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data caching method, characterized in that: The method comprises: Receive input and output IO requests; Determining whether target data accessed by the IO request is deduplicated data, and executing the IO request to read the target data; When the target data accessed by the IO request is deduplicated data, the target data is cached.
2. The method according to claim 1, characterized in that The determining whether the target data accessed by the IO request is deduplicated data includes: By querying the index information of the stored data, it is determined whether the target data accessed by the IO request is deduplicated data.
3. The method according to claim 2, characterized in that The index information is a key-value pair, the key in the key-value pair is the logical address of the stored data, and the value in the key-value pair is the physical address or fingerprint of the stored data; The step of determining whether the target data accessed by the IO request is deduplicated data by querying the index information of the stored data includes: According to the logical address in the IO request, query the index information for a key-value pair that matches the logical address in the IO request; When the value in the key-value pair matching the logical address in the IO request is a fingerprint, it is determined that the target data read by the IO request is deduplicated data.
4. The method according to claim 2, characterized in that: The index information of the stored data includes index information of deduplicated data, and the index information of the deduplicated data includes a logical address of the deduplicated data; The step of determining whether the target data accessed by the IO request is deduplicated data by querying the index information of the stored data includes: According to the logical address in the IO request, query the index information for an index item that matches the logical address in the IO request; When an index item matching the logical address in the IO request is found, it is determined that the target data read by the IO request is deduplicated data.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the target data accessed by the IO request is non-deduplicated data, the target data is eliminated.
6. The method according to any one of claims 1 to 5, characterized in that: The IO request belongs to sequential IO.
7. The method according to any one of claims 1 to 6, characterized in that: The determining whether the target data accessed by the IO request is deduplicated data includes: When the heat of the IO request meets the set condition, it is determined whether the target data accessed by the IO request is deduplicated data.
8. A data cache device, characterized in that: The device comprises: A deduplication information sensing module, used for receiving an input / output (IO) request and determining whether target data accessed by the IO request is deduplication data; The cache data layout module is used to execute the IO request to read the target data, and when the target data accessed by the IO request is deduplicated data, cache the target data.
9. The device according to claim 8, characterized in that The deduplication information perception module is specifically used for: By querying the index information of the stored data, it is determined whether the target data accessed by the IO request is deduplicated data.
10. The device according to claim 8, characterized in that The index information is a key-value pair, the key in the key-value pair is the logical address of the stored data, and the value in the key-value pair is the physical address or fingerprint of the stored data; The deduplication information perception module is specifically used for: According to the logical address in the IO request, query the index information for a key-value pair that matches the logical address in the IO request; When the value in the key-value pair matching the logical address in the IO request is a fingerprint, it is determined that the target data read by the IO request is deduplicated data.
11. The device according to claim 9, characterized in that The index information of the stored data includes index information of deduplicated data, and the index information of the deduplicated data includes a logical address of the deduplicated data; The deduplication information perception module is specifically used for: According to the logical address in the IO request, query the index information for an index item that matches the logical address in the IO request; When an index item matching the logical address in the IO request is found, it is determined that the target data read by the IO request is deduplicated data.
12. The device according to any one of claims 8 to 11, characterized in that The cache data layout module is also used for: When the target data accessed by the IO request is non-deduplicated data, the target data is eliminated.
13. The device according to any one of claims 8 to 12, characterized in that The IO request belongs to sequential IO.
14. The device according to any one of claims 8 to 13, characterized in that The deduplication information perception module is specifically used for: When the heat of the IO request meets the set condition, it is determined whether the target data accessed by the IO request is deduplicated data.
15. A storage system, characterized in that: The storage system includes a controller and a hard disk, and the controller executes computer-readable instructions to enable the storage system to perform the data caching method according to any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that: Comprising computer-readable instructions; the computer-readable instructions are used to implement the data caching method according to any one of claims 1 to 7.
17. A computer program product, characterized in that Comprising computer-readable instructions; the computer-readable instructions are used to implement the data caching method according to any one of claims 1 to 7.
Citation Information
Cited By
Data writing method and device, communication equipment and storage medium
CN119806425A
