[go: up one dir, main page]

CN115098481A - A metadata management method for deduplication - Google Patents

A metadata management method for deduplication Download PDF

Info

Publication number
CN115098481A
CN115098481A CN202210737553.XA CN202210737553A CN115098481A CN 115098481 A CN115098481 A CN 115098481A CN 202210737553 A CN202210737553 A CN 202210737553A CN 115098481 A CN115098481 A CN 115098481A
Authority
CN
China
Prior art keywords
data
metadata
fingerprint
transaction entry
request
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.)
Granted
Application number
CN202210737553.XA
Other languages
Chinese (zh)
Other versions
CN115098481B (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.)
Chongqing University
Original Assignee
Chongqing University
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 Chongqing University filed Critical Chongqing University
Priority to CN202210737553.XA priority Critical patent/CN115098481B/en
Publication of CN115098481A publication Critical patent/CN115098481A/en
Application granted granted Critical
Publication of CN115098481B publication Critical patent/CN115098481B/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application relates to a metadata management method for deleting repeated data, which comprises the steps of receiving an I/O (input/output) request, cutting data into data blocks, and establishing a unique fingerprint by utilizing a Hash algorithm; in the fingerprint index structure, inquiring the fingerprint of the data block; creating a transaction entry in a bitmap form, scanning a bitmap by a metadata manager to obtain a transaction entry in a free state, and distributing a globally unique Trans-i d; if a request for hitting the fingerprint index is received, mapping the logic block number accessed by the upper layer into a physical block number in the fingerprint mapping, and adding 1 to the reference count; if the request of the fingerprint index is not hit, a new free physical block number is allocated, a logical block number mapping is established, a mapping table and a reference count are written into a metadata area of the PM, and the written data block is stored. The transaction entry combined with the log mechanism is introduced, atomicity in the transaction entry is guaranteed, and consistent metadata of repeated data deletion during crash is guaranteed.

Description

一种重复数据删除的元数据管理方法A metadata management method for deduplication

技术领域technical field

本申请涉及计算机存储领域,尤其涉及一种重复数据删除的元数据管理方法。The present application relates to the field of computer storage, and in particular, to a metadata management method for deduplication of data.

背景技术Background technique

现代信息技术和互联网的发展,每天会产生大量的数据,社会正在进入一个大数据时代,需要管理的数据也越来越复杂。因此重复数据删除技术的发展解决了数据暴增带来的一些问题。With the development of modern information technology and the Internet, a large amount of data is generated every day. The society is entering an era of big data, and the data that needs to be managed is becoming more and more complex. Therefore, the development of data deduplication technology solves some of the problems caused by the explosion of data.

重复数据删除技术是一种当前热门的数据缩减技术,可以有效缩减存储系统的容量。它是基于数据自身的冗余度来检测数据流中的相同数据对象,只传输和存储一个唯一的数据对象,并使用指向唯一数据对象的指针替换其他重复数据副本,以达到减少网络传输和存储容量需求的过程。Data deduplication is a popular data reduction technology that can effectively reduce the capacity of storage systems. It detects the same data object in the data stream based on the redundancy of the data itself, only transmits and stores a unique data object, and replaces other duplicate data copies with a pointer to the unique data object to reduce network transmission and storage. process of capacity requirements.

根据重复数据删除的操作粒度,可以分为文件级和块级重复数据删除。文件级重复数据删除保证文件不重复,而块级重复数据删除则需将文件分成数据块进行比较。由于块级重复数据删除技术简单高效,可以实现更高的压缩率,因此成为主流的研究对象。随着存储数据的增加,管理数据的元数据维护难度随之增加。According to the granularity of data deduplication, it can be divided into file-level and block-level deduplication. File-level deduplication ensures that files are not duplicated, while block-level deduplication involves dividing files into data blocks for comparison. Since block-level deduplication technology is simple and efficient, it can achieve higher compression rate, so it has become the mainstream research object. As the amount of stored data increases, so does the difficulty of maintaining metadata to manage the data.

此外,对元数据的追加、更新和删除操作需要保证崩溃的一致性,否则在系统崩溃或停电的情况下可能会出现不可接受的错误。如图1所示,当处理文件A数据块(LBNx)与文件B数据块(LBNy)重复的写请求时,由于系统崩溃或掉电,可能导致其物理块(PBNa)的引用计数增加失败,系统中存在两个重复数据块,而引用计数却为1。后续操作中,如果删除文件B,再写入文件C数据,则数据块PBNa的引用计数将置零,即使文件A还需使用此物理块。系统会回收引用计数为零的物理块。若此物理块被分配给文件C的LBNz,这可能导致未删除的A文件的数据块(LBNx)被文件C数据块(LBNz)异常覆盖。最后,当用户访问文件A时,将返回文件C的数据。Additionally, appends, updates, and deletes to metadata need to be crash-consistent, otherwise unacceptable errors may occur in the event of a system crash or power outage. As shown in Figure 1, when processing the duplicate write request of file A data block (LBNx) and file B data block (LBNy), due to system crash or power failure, the reference count of its physical block (PBNa) may fail to increase, There are two duplicate data blocks in the system, and the reference count is 1. In subsequent operations, if file B is deleted and data is written to file C, the reference count of the data block PBNa will be set to zero, even if file A still needs to use this physical block. The system reclaims physical blocks with a reference count of zero. If this physical block is allocated to the LBNz of file C, this may cause the data block (LBNx) of the undeleted file A to be abnormally overwritten by the data block (LBNz) of file C. Finally, when the user accesses file A, the data of file C will be returned.

上述错误是由于在系统意外掉电或系统崩溃的情况下,对重复数据删除元数据进行了部分更新,而没有提供崩溃一致性保障。因此,针对重复数据删除元数据的崩溃一致性的研究将变得非常重要。The above error is due to a partial update of the deduplication metadata without providing crash consistency guarantees in the event of an unexpected system power loss or system crash. Therefore, research on crash consistency of deduplication metadata will become very important.

值得注意的是,非易失存储器具有内存级的读写延迟和耐久性,这种硬件特性适合于存储元数据信息,这能有效地解决重复数据删除和一致性的冲突问题。It is worth noting that non-volatile memory has memory-level read and write latency and endurance, and this hardware feature is suitable for storing metadata information, which can effectively solve the conflict problem of deduplication and consistency.

发明内容SUMMARY OF THE INVENTION

本申请提供一种重复数据删除的元数据管理方法,以更新需要在在线过程中保证崩溃时一致性的重复数据删除的元数据。The present application provides a metadata management method for deduplication to update metadata that needs to be deduplicated during an online process to ensure consistency in the event of a crash.

本申请的技术方案如下:The technical solution of this application is as follows:

根据本申请实施例的第一方面,提供一种重复数据删除的元数据管理方法,所述方法包括:According to a first aspect of the embodiments of the present application, there is provided a metadata management method for deduplication, the method comprising:

接收对数据的I/O的请求,将所述数据切割成固定大小的数据块,并利用哈希算法进行指纹计算,为所述数据块建立唯一指纹;Receive the I/O request to the data, cut the data into data blocks of a fixed size, and use a hash algorithm to perform fingerprint calculation to establish a unique fingerprint for the data block;

在预加载在内存中的指纹索引结构中,对所述数据块的指纹进行查询比对,以确定是否命中相同的数据块;In the fingerprint index structure preloaded in the memory, query and compare the fingerprints of the data blocks to determine whether to hit the same data block;

以位图形式创建事务条目,其中,一个所述I/O的请求对应一个事务条目,所述事务条目与所述指纹是否命中无关;Creating a transaction entry in the form of a bitmap, wherein one I/O request corresponds to one transaction entry, and the transaction entry has nothing to do with whether the fingerprint is hit;

通过元数据管理器扫描所述位图,获取处于自由状态的事务条目,并为该事务条目分配一个全局唯一的Trans-id变量;Scan the bitmap through the metadata manager, obtain the transaction entry in the free state, and assign a globally unique Trans-id variable to the transaction entry;

如果接收到命中指纹索引的请求,则将上层访问的逻辑块号映射为指纹映射中的物理块号,以及与所述指纹对应的物理块的引用计数加1;If a request to hit the fingerprint index is received, the logical block number accessed by the upper layer is mapped to the physical block number in the fingerprint map, and the reference count of the physical block corresponding to the fingerprint is increased by 1;

如果没有命中指纹索引的请求,则分配一个新的空闲物理块号,建立一个逻辑块号映射,将所述I/O请求向下转发,并将所述映射和引用计数写入到PM(持久化内存)的元数据区,以及对所述写入的数据块进行存储,其中,所述映射也需要写入到对应的事务条目中。If no request hits the fingerprint index, allocate a new free physical block number, build a logical block number map, forward the I/O request down, and write the map and reference count to the PM (persistent and storing the written data block, wherein the mapping also needs to be written into the corresponding transaction entry.

在一些实施例中,所述事务条目包括自由状态、开始状态以及结束状态。In some embodiments, the transaction entry includes a free state, a start state, and an end state.

在一些实施例中,所述事务条目包含一个Trans-id变量,一个状态变量,以及至少一个元数据更新备份;其中,所述状态变量用于表征所述事务条目处于上所述自由状态、开始状态以及结束状态中的其中一种;Trans-id变量用作事务条目的序列号和它们被检查点的顺序。In some embodiments, the transaction entry includes a Trans-id variable, a state variable, and at least one metadata update backup; wherein, the state variable is used to represent that the transaction entry is in the above-mentioned free state, starting One of state and end state; the Trans-id variable is used as the sequence number of transaction entries and the order in which they were checkpointed.

在一些实施例中,所述将所述数据切割成固定大小的数据块,具体包括:In some embodiments, the cutting the data into data blocks of a fixed size specifically includes:

基于内存页和文件系统块大小,设置重复数据删除数据块大小为4KB。Based on memory page and file system block size, set the deduplication data block size to 4KB.

在一些实施例中,所述持久化内存中与去重元数据相关的内存布局被划分为为元数据区和日志区,其中,元数据区存放数据块映射表的内容和物理块引用计数,日志区设计为一个固定大小的区域,由N个事务条目组成,并使用位图标记不同条目的使用情况。In some embodiments, the memory layout related to deduplication metadata in the persistent memory is divided into a metadata area and a log area, wherein the metadata area stores the content of the data block mapping table and the physical block reference count, The log area is designed as a fixed-size area consisting of N transaction entries, and a bitmap is used to mark the usage of different entries.

根据本申请实施例的第二方面,提供另一种重复数据删除的元数据管理方法,所述方法包括:According to a second aspect of the embodiments of the present application, there is provided another metadata management method for deduplication, the method comprising:

接收对数据的I/O的请求,将所述数据切割成固定大小的数据块,并利用哈希算法进行指纹计算,为所述数据块建立唯一指纹;Receive the I/O request to the data, cut the data into data blocks of a fixed size, and use a hash algorithm to perform fingerprint calculation to establish a unique fingerprint for the data block;

在预加载在内存中的指纹索引结构中,对所述数据块的指纹进行查询比对,以确定是否命中相同的数据块;In the fingerprint index structure preloaded in the memory, query and compare the fingerprints of the data blocks to determine whether to hit the same data block;

以位图形式创建事务条目,其中,所述一个I/O的请求对应一个事务条目,所述事务条目与所述指纹是否命中无关;Creating a transaction entry in the form of a bitmap, wherein the one I/O request corresponds to a transaction entry, and the transaction entry has nothing to do with whether the fingerprint is hit;

通过元数据管理器扫描所述位图,获取处于自由状态的事务条目,并为该事务条目分配一个全局唯一的Trans-id;Scan the bitmap through the metadata manager, obtain the transaction entry in the free state, and assign a globally unique Trans-id to the transaction entry;

如果接收到命中指纹索引的请求,则将上层访问的逻辑块号映射为指纹映射中的目标物理块号,对应的物理块的引用计数加1,并减少原映射物理块号的引用计数;If a request to hit the fingerprint index is received, the logical block number accessed by the upper layer is mapped to the target physical block number in the fingerprint map, the reference count of the corresponding physical block is increased by 1, and the reference count of the original mapped physical block number is decreased;

如果没有命中指纹索引的请求,将所述I/O请求向下转发,并将重复数据删除元数据写入到持久化内存的元数据区,以及对所述写入的数据块进行存储;If the request for the fingerprint index is not hit, the I/O request is forwarded downward, and the deduplication metadata is written into the metadata area of the persistent memory, and the written data block is stored;

如果所述原映射的物理块号的引用计数减为0,删除将所述引用计数为0的物理块号进行删除。If the reference count of the originally mapped physical block number is decremented to 0, the deletion deletes the physical block number whose reference count is 0.

在一些实施例中,事务条目包括自由状态、开始状态以及结束状态。In some embodiments, a transaction entry includes a free state, a start state, and an end state.

在一些实施例中,所述事务条目包含一个Trans-id变量,一个状态变量,以及至少一个元数据更新备份;其中,所述状态变量用于表征所述事务条目处于上所述自由状态、开始状态以及结束状态中的其中一种;Trans-id变量用作事务条目的序列号和它们被检查点的顺序。In some embodiments, the transaction entry includes a Trans-id variable, a state variable, and at least one metadata update backup; wherein, the state variable is used to represent that the transaction entry is in the above-mentioned free state, starting One of state and end state; the Trans-id variable is used as the sequence number of transaction entries and the order in which they were checkpointed.

在一些实施例中,所述将所述数据切割成固定大小的数据块,具体包括:In some embodiments, the cutting the data into data blocks of a fixed size specifically includes:

基于内存页和文件系统块大小,设置重复数据删除数据块大小为4KB。Based on memory page and file system block size, set the deduplication data block size to 4KB.

根据本申请实施例的第三方面,提供一种非易失性存储设备,包括:持久性内存存储器;所述持久性内存存储器用于实现前文所述的重复数据删除的元数据管理方法,持久性内存存储器通常采用具有良好的低延迟和字节寻址的存储器;能够达到近乎内存级的速度和字节寻址。本申请所涉及的一种重复数据删除的元数据管理方法,无论在写入时候还是在更新时候,都可以减少大量额外元数据I/O,引入与日志机制相结合的事务条目,确保事务条目内的原子性,保证崩溃时一致性的重复数据删除元数据。According to a third aspect of the embodiments of the present application, a non-volatile storage device is provided, including: persistent memory storage; the persistent memory storage is used to implement the above-described metadata management method for deduplication, which is persistent High-performance memory storage typically employs memory with good low latency and byte addressability; capable of achieving near-memory-level speed and byte addressability. The metadata management method for deduplication involved in the present application can reduce a large amount of additional metadata I/O at the time of writing or at the time of updating, and introduce transaction entries combined with the log mechanism to ensure transaction entries. Atomicity within, guarantees crash-consistent deduplication metadata.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the present application.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理,并不构成对本申请的不当限定。The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, serve to explain the principles of the present application, and do not constitute an improper limitation of the present application.

图1是根据一示例性实施例示出的当处理文件A数据块(LBNx)与文件B数据块(LBNy)重复的写请求时由于系统崩溃或掉电而导致的数据受损的场景示意图;1 is a schematic diagram illustrating a scenario of data corruption caused by a system crash or power failure when processing a duplicate write request of a file A data block (LBNx) and a file B data block (LBNy) according to an exemplary embodiment;

图2是根据一示例性实施例示出的基于非易失性内存文件系统的系统架构示意图;FIG. 2 is a schematic diagram of a system architecture based on a non-volatile memory file system according to an exemplary embodiment;

图3是根据一示例性实施例示出的一种重复数据删除的元数据管理方法的流程示意图;3 is a schematic flowchart of a metadata management method for deduplication according to an exemplary embodiment;

图4是根据一示例性实施例示出的事务条目的组成示意图;4 is a schematic diagram showing the composition of a transaction entry according to an exemplary embodiment;

图5是根据一示例性实施例示出的事务条目的三个状态的转换流程示意图;5 is a schematic diagram of a transition flow of three states of a transaction entry according to an exemplary embodiment;

图6是根据一示例性实施例示出的一种重复数据删除的元数据管理方法在写入新数据时的执行流程示意图;Fig. 6 is a schematic diagram of the execution flow of a metadata management method for deduplication according to an exemplary embodiment when writing new data;

图7是根据一示例性实施例示出的一种重复数据删除的元数据管理方法在写入新数据时的流程示意图。FIG. 7 is a schematic flowchart of a method for managing metadata for deduplication according to an exemplary embodiment when new data is written.

具体实施方式Detailed ways

为了使本领域普通人员更好地理解本申请的技术方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as recited in the appended claims.

如图2所示,本申请示例性示出了基于非易失性内存文件系统的系统架构示意图。As shown in FIG. 2 , the present application exemplarily shows a schematic diagram of a system architecture based on a non-volatile memory file system.

操作系统一般将可访问的内存空间分为二部分,一部分是内核空间,一部分是用户空间。内核空间是操作系统内核访问的区域,独立于普通的应用程序,是受保护的内存空间。用户空间是普通应用程序可访问的内存区域。The operating system generally divides the accessible memory space into two parts, one is the kernel space and the other is the user space. Kernel space is an area accessed by the operating system kernel, independent of ordinary applications, and is a protected memory space. User space is an area of memory accessible by normal applications.

内核空间中,重复数据删除系统(下文简称为NC-DEDUP)由元数据管理模块(图中标为元数据管理器)、哈希引擎模块和块接口模块三部分组成。如图2所示,NC-DEDUP位于文件系统底层,块设备驱动程序上层。也就是说,文件系统就是NC-DEDUP的上层,块设备驱动程序是NC-DEDUP的下层。这种结构保证了其良好的可移植性,并提供了良好的功能可扩展性。具体功能模块如下所述:In the kernel space, the deduplication system (hereinafter referred to as NC-DEDUP) consists of three parts: a metadata management module (marked as a metadata manager in the figure), a hash engine module and a block interface module. As shown in Figure 2, NC-DEDUP is located at the bottom layer of the file system and the upper layer of the block device driver. That is to say, the file system is the upper layer of NC-DEDUP, and the block device driver is the lower layer of NC-DEDUP. This structure ensures its good portability and provides good function expansibility. The specific functional modules are as follows:

元数据管理模块:元数据主要包含指纹索引到PBN(物理块号)的映射表、从LBN(逻辑块号)到PBN(物理块号)的映射表,以及PBN的引用计数。元数据管理模块负责元数据空间的分配和回收、定期持久化、快速查询,以及在PM(持久化内存)上执行日志机制,以确保崩溃一致性。Metadata management module: Metadata mainly includes the mapping table from fingerprint index to PBN (physical block number), the mapping table from LBN (logical block number) to PBN (physical block number), and the reference count of PBN. The metadata management module is responsible for the allocation and reclamation of metadata space, periodic persistence, fast query, and the implementation of the logging mechanism on PM (Persistent Memory) to ensure crash consistency.

哈希引擎(Hash)模块:顺序读取文件做遍历查找,速度很慢,因此需要建立索引,索引最常用的就是哈希表。如果我们对文件中的数据建个索引,“Key”保存着我们下次要查询的值,“Value”对应这哪个文件的哪个位置。基于每个块的内容选择一个指纹来标识它,其中,块指纹可以唯一标识数据块。利用哈希算法识别数据块是否重复,根据重复率的不同调整重复数据删除中的各种哈希方法以控制计算开销。Hash engine (Hash) module: read files sequentially for traversal search, which is very slow, so you need to build an index. The most commonly used index is a hash table. If we build an index on the data in the file, "Key" saves the value we want to query next time, and "Value" corresponds to which file location. A fingerprint is selected to identify each block based on its content, where the block fingerprint can uniquely identify the data block. Hash algorithm is used to identify whether data blocks are duplicated, and various hashing methods in data deduplication are adjusted according to different duplication rates to control computational overhead.

块接口模块:根据块接口的重复数据删除元数据中的信息,重复数据删除后的数据I/O(读/写)将被重定向或丢弃。Block Interface Module: Based on the information in the block interface's deduplication metadata, the deduplicated data I/O (read/write) will be redirected or discarded.

在一些实施例中,本申请的元数据管理基于持久性内存(PM)。任何写入请求的处理都涉及对重复数据消除元数据的一系列修改。所有可能的元数据更新都分为写新块、重复块以及更新块。写新块是指数据块没有被记录,即在指纹索引表中查询不到该表项,需要记录此块元数据信息以用于后续重复数据操作,需要添加一个指纹索引、一个LBN映射和一个PBN引用计数。重复块是指数据块或者逻辑块号没有被记录,但指纹信息被记录。对于这类数据块,查询到唯一数据块的PBN,需要更新一个LBN到唯一PBN的映射和一个PBN引用计数。更新块是指数据块被记录,也已经保存了LBN到PBN的映射关系,写数据时候需要更新一个LBN映射,并更新两个PBN引用计数和一个或零个索引。In some embodiments, the metadata management of the present application is based on persistent memory (PM). The processing of any write request involves a series of modifications to the deduplication metadata. All possible metadata updates are divided into writing new blocks, repeating blocks, and updating blocks. Writing a new block means that the data block is not recorded, that is, the entry cannot be queried in the fingerprint index table, and the metadata information of this block needs to be recorded for subsequent repeated data operations, and a fingerprint index, an LBN map and a PBN reference count. Duplicate blocks mean that data blocks or logical block numbers are not recorded, but fingerprint information is recorded. For this type of data block, to query the PBN of the unique data block, it is necessary to update a LBN-to-unique PBN mapping and a PBN reference count. Update block means that the data block is recorded, and the mapping relationship between LBN and PBN has been saved. When writing data, an LBN mapping needs to be updated, and two PBN reference counts and one or zero indexes are updated.

本申请提供的一种重复数据删除的元数据管理方法中,NC-DEDUP的实现基于开源框架Dmdedup,该框架继承了块I/O接口和块设备的bio处理。Dmdedup是一个开源的块级重复和数据删除模块,它使用COW B-tree(copy on write)策略来确保重复和数据删除元数据的一致性。In the metadata management method for deduplication provided by this application, the implementation of NC-DEDUP is based on the open source framework Dmdedup, which inherits the block I/O interface and the bio processing of the block device. Dmdedup is an open source block-level deduplication and deduplication module that uses a COW B-tree (copy on write) strategy to ensure consistency of deduplication and deduplication metadata.

如图3所示,所述方法执行以下步骤:As shown in Figure 3, the method performs the following steps:

S11:接收对数据的I/O的请求,将所述数据切割成固定大小的数据块,并利用哈希算法进行指纹计算,为所述数据块建立唯一指纹。S11: Receive an I/O request for data, cut the data into data blocks of a fixed size, and perform fingerprint calculation using a hash algorithm to establish a unique fingerprint for the data block.

在一些实施例中,由于内存页和文件系统块大小通常都为4KB,所以将重复数据删除数据块大小设置为4KB,这样可以避免块对齐问题,并能有效减少分块带来的开销。In some embodiments, since the memory page and file system block sizes are usually 4KB, the deduplication data block size is set to 4KB, which can avoid block alignment problems and effectively reduce the overhead caused by block partitioning.

一些是实施例中,使用MD5散列算法来计算数据块指纹,传统的MD5算法得到的指纹大小为128比特,与其他散列算法相比,可以有效地压缩指纹索引空间。In some embodiments, the MD5 hash algorithm is used to calculate the data block fingerprint. The size of the fingerprint obtained by the traditional MD5 algorithm is 128 bits, which can effectively compress the fingerprint index space compared with other hash algorithms.

S12:在预加载在内存中的指纹索引结构中,对所述数据块的指纹进行查询比对,以确定是否命中相同的数据块。S12: In the fingerprint index structure preloaded in the memory, query and compare the fingerprints of the data blocks to determine whether to hit the same data block.

S13:以位图形式创建事务条目,其中,一个所述I/O的请求对应一个事务条目,所述事务条目与所述指纹是否命中无关。S13: Create a transaction entry in the form of a bitmap, wherein one I/O request corresponds to one transaction entry, and the transaction entry has nothing to do with whether the fingerprint is hit or not.

在一些实施例中,基于PM的元数据管理中,与去重元数据相关的内存布局主要分为元数据区和日志区。元数据区主要存放数据块映射表的内容和物理块引用计数。由于PM的低访问延迟和字节寻址特性,访问重复数据删除元数据将显着加快。日志区设计为一个固定大小的区域,由N个事务条目组成,并使用位图标记不同条目的使用情况。In some embodiments, in the PM-based metadata management, the memory layout related to deduplication metadata is mainly divided into a metadata area and a log area. The metadata area mainly stores the content of the data block mapping table and the reference count of the physical block. Accessing deduplication metadata will be significantly faster due to PM's low access latency and byte-addressable nature. The log area is designed as a fixed-size area consisting of N transaction entries, and a bitmap is used to mark the usage of different entries.

在一些实施例中,将PM上日志区的事务条目数设置为512。更多的事务条目能缓存更多的元数据更新,但会影响后续重复写入请求的识别。In some embodiments, the number of transaction entries in the log area on the PM is set to 512. More transaction entries can cache more metadata updates, but will affect the identification of subsequent duplicate write requests.

S14:通过元数据管理器扫描所述位图,获取处于自由状态的事务条目,并为该事务条目分配一个全局唯一的Trans-id变量。S14: Scan the bitmap through the metadata manager to obtain a transaction entry in a free state, and assign a globally unique Trans-id variable to the transaction entry.

本申请实施例中,所述事务条目包括自由状态、开始状态以及结束状态。In this embodiment of the present application, the transaction entry includes a free state, a start state, and an end state.

在一些实施例中,如图4所示,每个事务条目包含一个Trans-id,一个状态变量(status),以及至少一个元数据更新备份(ref-op)。其中,所述状态变量用于表征所述事务条目处于上述3种状态中的其中一种;Trans-id变量用作事务条目的序列号和它们被检查点的顺序。In some embodiments, as shown in FIG. 4, each transaction entry contains a Trans-id, a status variable (status), and at least one metadata update backup (ref-op). Wherein, the state variable is used to represent that the transaction entry is in one of the above three states; the Trans-id variable is used as the sequence number of the transaction entry and the order in which they are checked.

对于上层下发的每一次bio(block input output),阻塞式的输入和输出)写入操作,所有对去重元数据的操作都会打包成一个事务条目,统一修改和提交。在PM空间的头部有一个checkpointed-id变量,它表示当前的最大Trans-id。For each bio (block input output), blocking input and output) write operation issued by the upper layer, all operations on deduplication metadata will be packaged into a transaction entry, which will be modified and submitted uniformly. There is a checkpointed-id variable at the head of the PM space, which represents the current maximum Trans-id.

如图5所示,当上层发起I/O写入请求时,元数据管理器扫描所述位图,获取处于自由状态的事务条目(也就是标记为FREE的事务条目),并将该事务条目的状态转换为BEGIN(也即开始状态)。如果在位图中找不到空闲项,操作系统需要重新安排重复数据消除的工作线程,并阻止该线程传入的读写请求。As shown in Figure 5, when the upper layer initiates an I/O write request, the metadata manager scans the bitmap, obtains the transaction entry in the free state (that is, the transaction entry marked as FREE), and stores the transaction entry The state transitions to BEGIN (that is, the start state). If no free entry is found in the bitmap, the operating system needs to reschedule the deduplication worker thread and block incoming read and write requests from that thread.

然后,事务区域将填充更新的元数据操作,并发出I/O请求。当下块设备完成I/O请求时,下块设备的驱动程序将发出中断请求,事务的状态将在设备的软件中断例程中转换为END(也即结束状态)。The transaction area is then populated with updated metadata operations and I/O requests are issued. When the lower block device completes the I/O request, the driver of the lower block device will issue an interrupt request, and the state of the transaction will be converted to END (that is, the end state) in the device's software interrupt routine.

每次对数据进行I/O动作完成后,元数据管理器将从当前的checkpointed-id开始,并按id顺序查看是否有事务条目可以被检查点到PM上的元数据区域。将所有符合条件的事务写入元数据区域后,将事务状态设置为FREE,并清除位图中的标志。After each I/O action on the data is completed, the metadata manager will start with the current checkpointed-id and check in id order to see if there are transaction entries that can be checkpointed into the metadata area on the PM. After writing all eligible transactions to the metadata area, set the transaction status to FREE and clear the flag in the bitmap.

上层用户程序只需要在PM上完成日志数据区的写入,即可安全返回。由于PM的低访问延迟,日志更新操作可以快速完成,因此可以快速向用户报告写入完成情况。当系统崩溃或电源故障发生时,只有日志区域中处于结束状态的条目需要被扫描并更新到元数据区域。The upper-level user program only needs to complete the writing of the log data area on the PM, and then it can return safely. Because of PM's low access latency, log update operations can complete quickly, so write completions can be quickly reported to users. When a system crash or power failure occurs, only entries in the log area that are in the end state need to be scanned and updated to the metadata area.

S15:如果接收到命中指纹索引的请求,则将上层访问的逻辑块号映射为指纹映射中的物理块号,以及与所述指纹对应的物理块号的引用计数加1。S15: If a request to hit the fingerprint index is received, map the logical block number accessed by the upper layer to the physical block number in the fingerprint map, and add 1 to the reference count of the physical block number corresponding to the fingerprint.

在一些实施例中,所述物理块号对应的元数据进行更新时,被写入一个已分配的事务。In some embodiments, when the metadata corresponding to the physical block number is updated, it is written into an allocated transaction.

在一些实施例中,所述命中指纹索引用于指示当前进行I/O的数据与已有数据在经过指纹查询后,被确定为是相同的数据块。In some embodiments, the hit fingerprint index is used to indicate that the data currently undergoing I/O and the existing data are determined to be the same data block after being queried by the fingerprint.

对于命中指纹索引的写请求,NC-DEDUP不会将上层数据转发给I/O设备,而是将更新后的重复数据删除元数据记录到日志区,然后通知用户I/O已完成。For write requests that hit the fingerprint index, NC-DEDUP does not forward the upper layer data to the I/O device, but records the updated deduplication metadata to the log area, and then informs the user that the I/O is completed.

S16:如果没有命中指纹索引的请求,则分配一个新的空闲物理块号,建立一个逻辑块号映射,将所述I/O请求向下转发,并将所述映射和引用计数写入到PM(持久化内存)的元数据区,以及对所述写入的数据块进行存储,其中,所述映射也需要写入到对应的事务条目中。S16: If the request for the fingerprint index is not hit, allocate a new free physical block number, establish a logical block number mapping, forward the I/O request downward, and write the mapping and reference count into the PM (persistent memory) metadata area, and store the written data block, wherein the mapping also needs to be written into the corresponding transaction entry.

如图6所示,NC-DEDUP接受写请求时,执行上述重复数据删除的元数据管理方法。对于写请求,NC-DEDUP将元数据的更新添加到一个事务中,确保事务条目内的原子性。此外,NC-DEDUP保证数据一致性的基础上,减少大量额外元数据I/O。As shown in Figure 6, when NC-DEDUP accepts a write request, it executes the above metadata management method for deduplication. For write requests, NC-DEDUP adds metadata updates to a transaction, ensuring atomicity within transaction entries. In addition, NC-DEDUP reduces a lot of additional metadata I/O on the basis of ensuring data consistency.

如图7所示,本申请提供的另一种重复数据删除的元数据管理方法,主要针对NC-DEDUP更新数据时的情况,包括:As shown in Figure 7, another metadata management method for deduplication provided by this application is mainly aimed at the situation when NC-DEDUP updates data, including:

S21:接收对数据的I/O的请求,将所述数据切割成固定大小的数据块,并利用哈希算法进行指纹计算,为所述数据块建立唯一指纹。S21: Receive an I/O request for data, cut the data into data blocks of a fixed size, and use a hash algorithm to perform fingerprint calculation to establish a unique fingerprint for the data block.

S22:在预加载在内存中的指纹索引结构中,对所述数据块的指纹进行查询比对,以确定是否命中相同的数据块。S22: In the fingerprint index structure preloaded in the memory, query and compare the fingerprints of the data blocks to determine whether to hit the same data block.

S23:以位图形式创建事务条目,其中,所述一个I/O的请求对应一个事务条目,所述事务条目与所述指纹是否命中无关。S23: Create a transaction entry in the form of a bitmap, wherein the one I/O request corresponds to one transaction entry, and the transaction entry has nothing to do with whether the fingerprint is hit or not.

在一些实施例中,基于PM的元数据管理中,与去重元数据相关的内存布局主要分为元数据区和日志区。元数据区主要存放数据块映射表的内容和物理块引用计数。由于PM的低访问延迟和字节寻址特性,访问重复数据删除元数据将显着加快。日志区设计为一个固定大小的区域,由N个事务条目组成,并使用位图标记不同条目的使用情况。In some embodiments, in the PM-based metadata management, the memory layout related to deduplication metadata is mainly divided into a metadata area and a log area. The metadata area mainly stores the content of the data block mapping table and the reference count of the physical block. Accessing deduplication metadata will be significantly faster due to PM's low access latency and byte-addressable nature. The log area is designed as a fixed-size area consisting of N transaction entries, and a bitmap is used to mark the usage of different entries.

S24:通过元数据管理器扫描所述位图,获取处于自由状态的事务条目,并为该事务条目分配一个全局唯一的Trans-id变量。S24: Scan the bitmap through the metadata manager to obtain a transaction entry in a free state, and assign a globally unique Trans-id variable to the transaction entry.

实际上,以上四个步骤与NC-DEDUP写入新数据时候,执行步骤相对一致。In fact, the above four steps are relatively the same as when NC-DEDUP writes new data.

S25:如果接收到命中指纹索引的请求,则将上层访问的逻辑块号映射为指纹映射中的目标物理块号,对应的物理块的引用计数加1,并减少原映射物理块号的引用计数。S25: If a request to hit the fingerprint index is received, the logical block number accessed by the upper layer is mapped to the target physical block number in the fingerprint mapping, the reference count of the corresponding physical block is increased by 1, and the reference count of the original mapped physical block number is decreased. .

在一些实施例中,所述目标物理块号对应的元数据进行更新时,被写入一个已分配的事务。In some embodiments, when the metadata corresponding to the target physical block number is updated, it is written into an allocated transaction.

对于命中指纹索引的写请求,NC-DEDUP不会将上层数据转发给I/O设备,而是将更新后的重复数据删除元数据记录到日志区,然后通知用户I/O已完成。For write requests that hit the fingerprint index, NC-DEDUP does not forward the upper layer data to the I/O device, but records the updated deduplication metadata to the log area, and then informs the user that the I/O is completed.

S26:如果没有命中指纹索引的请求,将所述I/O请求向下转发,并将重复数据删除元数据写入到PM的元数据区,以及对所述写入的数据块进行存储。S26: If the request for the fingerprint index is not hit, forward the I/O request downward, write the deduplication metadata into the metadata area of the PM, and store the written data block.

在一些实施例中,重复数据删除元数据包括映射表和引用计数。In some embodiments, deduplication metadata includes mapping tables and reference counts.

S27:如果所述原映射的物理块号的引用计数减为0,删除将所述引用计数为0的物理块号进行删除。S27: If the reference count of the originally mapped physical block number is decremented to 0, delete the physical block number whose reference count is 0 to be deleted.

在一些实施例中,如果原映射的PBN引用计数减为0,则说明没有别的文件共享其数据块。可通过垃圾回收机制回收清理数据块的存储空间。In some embodiments, if the original mapped PBN reference count is decremented to 0, it means that no other file shares its data block. The storage space for cleanup data blocks can be reclaimed through the garbage collection mechanism.

如图7所示,NC-DEDUP在更新数据时,,NC-DEDUP将元数据的更新添加到一个事务中,确保事务条目内的原子性。NC-DEDUP保证数据一致性的基础上,减少大量额外元数据I/O。此外,NC-DEDUP保证了元数据检查和数据I/O的顺序,这可以确保去重元数据指向正确和安全的数据块。As shown in Figure 7, when NC-DEDUP updates data, NC-DEDUP adds metadata updates to a transaction to ensure atomicity within transaction entries. On the basis of ensuring data consistency, NC-DEDUP reduces a lot of additional metadata I/O. In addition, NC-DEDUP guarantees metadata checking and data I/O ordering, which ensures that deduplicated metadata points to the correct and safe data block.

与现有的重复数据删除技术在保证数据间一致性时的执行方法相比,本申请所涉及的一种重复数据删除的元数据管理方法,无论在写入时候还是在更新时候,都可以减少大量额外元数据I/O,引入与日志机制相结合的事务条目,确保事务条目内的原子性,保证崩溃时一致性的重复数据删除元数据。Compared with the execution method of the existing deduplication technology when ensuring the consistency between data, the metadata management method for deduplication involved in the present application can reduce the amount of data in writing or updating. A large amount of additional metadata I/O, the introduction of transaction entries combined with the logging mechanism, to ensure atomicity within transaction entries, and to ensure consistent deduplication metadata in the event of a crash.

本申请实施例描述的应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着新应用场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The application scenarios described in the embodiments of the present application are for the purpose of illustrating the technical solutions of the embodiments of the present application more clearly, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It appears that the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

所属技术领域的技术人员能够理解,本申请的各个方面可以实现为系统、方法或程序产品。因此,本申请的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。As will be appreciated by one skilled in the art, various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application can be embodied in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which may be collectively referred to herein as implementations "circuit", "module" or "system".

在一些可能的实施方式中,根据本申请的电子设备可以包括至少一个处理器、以及至少一个存储器。其中,存储器存储有程序代码,当程序代码被处理器执行时,使得处理器执行本说明书上述描述的根据本申请各种示例性实施方式的运营数据管理方法。例如,处理器可以执行如运营数据管理方法中的步骤。In some possible implementations, an electronic device according to the present application may include at least one processor, and at least one memory. The memory stores program codes, which, when executed by the processor, cause the processor to execute the operation data management methods described above in this specification according to various exemplary embodiments of the present application. For example, the processor may perform steps as in an operational data management method.

在示例性实施例中,本申请提供的一种重复数据删除的元数据管理方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在计算机设备上运行时,程序代码用于使计算机设备执行本说明书上述描述的根据本申请各种示例性实施方式的重复数据删除的元数据管理方法中的步骤。In an exemplary embodiment, various aspects of a metadata management method for deduplication provided by the present application can also be implemented in the form of a program product, which includes program code, and when the program product runs on a computer device, The program code is used to cause the computer device to execute the steps in the metadata management method for deduplication according to various exemplary embodiments of the present application described above in this specification.

应当注意,尽管在上文详细描述中提及了装置的若干单元或子单元,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多单元的特征和功能可以在一个单元中具体化。反之,上文描述的一个单元的特征和功能可以进一步划分为由多个单元来具体化。It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, this division is merely exemplary and not mandatory. Indeed, according to embodiments of the present application, the features and functions of two or more units described above may be embodied in one unit. Conversely, the features and functions of one unit described above may be further subdivided to be embodied by multiple units.

此外,尽管在附图中以特定顺序描述了本申请方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。Furthermore, although the operations of the methods of the present application are depicted in the figures in a particular order, this does not require or imply that the operations must be performed in the particular order, or that all illustrated operations must be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined to be performed as one step, and/or one step may be decomposed into multiple steps to be performed.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程图像缩放设备的处理器以产生一个机器,使得通过计算机或其他可编程图像缩放设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable image scaling device to produce a machine such that the instructions executed by the processor of the computer or other programmable image scaling device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程图像缩放设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable image scaling device to function in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程图像缩放设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable image scaling device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that an image executed on the computer or other programmable device The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.

显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (9)

1.一种重复数据删除的元数据管理方法,其特征在于,所述方法包括:1. A metadata management method for deduplication, wherein the method comprises: 接收对数据的I/O的请求,将所述数据切割成固定大小的数据块,并利用哈希算法进行指纹计算,为所述数据块建立唯一指纹;Receive the I/O request to the data, cut the data into data blocks of a fixed size, and use a hash algorithm to perform fingerprint calculation to establish a unique fingerprint for the data block; 在预加载在内存中的指纹索引结构中,对所述数据块的指纹进行查询比对,以确定是否命中相同的数据块;In the fingerprint index structure preloaded in the memory, query and compare the fingerprints of the data blocks to determine whether to hit the same data block; 以位图形式创建事务条目,其中,一个所述I/O的请求对应一个事务条目,所述事务条目与所述指纹是否命中无关;Creating a transaction entry in the form of a bitmap, wherein one I/O request corresponds to one transaction entry, and the transaction entry has nothing to do with whether the fingerprint is hit; 通过元数据管理器扫描所述位图,获取处于自由状态的事务条目,并为该事务条目分配一个全局唯一的Trans-id变量;Scan the bitmap through the metadata manager, obtain the transaction entry in the free state, and assign a globally unique Trans-id variable to the transaction entry; 如果接收到命中指纹索引的请求,则将上层访问的逻辑块号映射为指纹映射中的物理块号,以及与所述指纹对应的物理块号的引用计数加1;If a request to hit the fingerprint index is received, the logical block number accessed by the upper layer is mapped to the physical block number in the fingerprint map, and the reference count of the physical block number corresponding to the fingerprint is increased by 1; 如果没有命中指纹索引的请求,则分配一个新的空闲物理块号,建立一个逻辑块号映射,将所述I/O请求向下转发,并将所述映射和引用计数写入到PM(持久化内存)的元数据区,以及对所述写入的数据块进行存储,其中,所述映射也需要写入到对应的事务条目中。If no request hits the fingerprint index, allocate a new free physical block number, build a logical block number map, forward the I/O request down, and write the map and reference count to the PM (persistent and storing the written data block, wherein the mapping also needs to be written into the corresponding transaction entry. 2.根据权利要求1所述的方法,其特征在于,所述事务条目包括自由状态、开始状态以及结束状态。2. The method of claim 1, wherein the transaction entry includes a free state, a start state, and an end state. 3.根据权利要求2所述的方法,其特征在于,所述事务条目包含一个Trans-id变量,一个状态变量,以及至少一个元数据更新备份;其中,所述状态变量用于表征所述事务条目处于上所述自由状态、开始状态以及结束状态中的其中一种;Trans-id变量用作事务条目的序列号和它们被检查点的顺序。3. The method of claim 2, wherein the transaction entry comprises a Trans-id variable, a state variable, and at least one metadata update backup; wherein the state variable is used to characterize the transaction Entries are in one of the free, start, and end states described above; the Trans-id variable is used as the sequence number of transaction entries and the order in which they were checkpointed. 4.根据权利要求3所述的方法,其特征在于,所述将所述数据切割成固定大小的数据块,具体包括:4. The method according to claim 3, wherein the cutting the data into data blocks of a fixed size specifically comprises: 基于内存页和文件系统块大小,设置重复数据删除数据块大小为4KB。Based on memory page and file system block size, set the deduplication data block size to 4KB. 5.根据权利要求4所述的方法,其特征在于,所述持久化内存中与去重元数据相关的内存布局被划分为为元数据区和日志区,其中,元数据区存放数据块映射表的内容和物理块引用计数,日志区设计为一个固定大小的区域,由N个事务条目组成,并使用位图标记不同条目的使用情况。5. The method according to claim 4, wherein the memory layout related to deduplication metadata in the persistent memory is divided into a metadata area and a log area, wherein the metadata area stores data block mappings The contents of the table and the physical block reference count, the log area is designed as a fixed-size area consisting of N transaction entries, and a bitmap is used to mark the usage of different entries. 6.一种重复数据删除的元数据管理方法,其特征在于,所述方法包括:6. A metadata management method for deduplication, wherein the method comprises: 接收对数据的I/O的请求,将所述数据切割成固定大小的数据块,并利用哈希算法进行指纹计算,为所述数据块建立唯一指纹;Receive the I/O request to the data, cut the data into data blocks of a fixed size, and use a hash algorithm to perform fingerprint calculation to establish a unique fingerprint for the data block; 在预加载在内存中的指纹索引结构中,对所述数据块的指纹进行查询比对,以确定是否命中相同的数据块;In the fingerprint index structure preloaded in the memory, query and compare the fingerprints of the data blocks to determine whether to hit the same data block; 以位图形式创建事务条目,其中,所述一个I/O的请求对应一个事务条目,所述事务条目与所述指纹是否命中无关;Creating a transaction entry in the form of a bitmap, wherein the one I/O request corresponds to a transaction entry, and the transaction entry has nothing to do with whether the fingerprint is hit; 通过元数据管理器扫描所述位图,获取处于自由状态的事务条目,并为该事务条目分配一个全局唯一的Trans-id变量;Scan the bitmap through the metadata manager, obtain the transaction entry in the free state, and assign a globally unique Trans-id variable to the transaction entry; 如果接收到命中指纹索引的请求,则将上层访问的逻辑块号映射为指纹映射中的目标物理块号,对应的物理块号的引用计数加1,并减少原映射物理块号的引用计数;If a request to hit the fingerprint index is received, the logical block number accessed by the upper layer is mapped to the target physical block number in the fingerprint map, the reference count of the corresponding physical block number is increased by 1, and the reference count of the original mapped physical block number is decreased; 如果没有命中指纹索引的请求,将所述I/O请求向下转发,并将重复数据删除元数据写入到持久化内存的元数据区,以及对所述写入的数据块进行存储;If the request for the fingerprint index is not hit, the I/O request is forwarded downward, and the deduplication metadata is written into the metadata area of the persistent memory, and the written data block is stored; 如果所述原映射的物理块号的引用计数减为0,删除将所述引用计数为0的物理块号进行删除。If the reference count of the originally mapped physical block number is decremented to 0, the deletion deletes the physical block number whose reference count is 0. 7.根据权利要求6所述的方法,其特征在于,事务条目包括自由状态、开始状态以及结束状态。7. The method of claim 6, wherein the transaction entry includes a free state, a start state, and an end state. 8.根据权利要求7所述的方法,其特征在于,所述事务条目包含一个Trans-id变量,一个状态变量,以及至少一个元数据更新备份;其中,所述状态变量用于表征所述事务条目处于上所述自由状态、开始状态以及结束状态中的其中一种;Trans-id变量用作事务条目的序列号和它们被检查点的顺序。8. The method of claim 7, wherein the transaction entry comprises a Trans-id variable, a state variable, and at least one metadata update backup; wherein the state variable is used to characterize the transaction Entries are in one of the free, start, and end states described above; the Trans-id variable is used as the sequence number of transaction entries and the order in which they were checkpointed. 9.根据权利要求8所述的方法,其特征在于,所述将所述数据切割成固定大小的数据块,具体包括:9. The method according to claim 8, wherein the cutting the data into data blocks of a fixed size specifically comprises: 基于内存页和文件系统块大小,设置重复数据删除数据块大小为4KB。Based on memory page and file system block size, set the deduplication data block size to 4KB.
CN202210737553.XA 2022-06-27 2022-06-27 Metadata management method for repeated data deletion Active CN115098481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210737553.XA CN115098481B (en) 2022-06-27 2022-06-27 Metadata management method for repeated data deletion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210737553.XA CN115098481B (en) 2022-06-27 2022-06-27 Metadata management method for repeated data deletion

Publications (2)

Publication Number Publication Date
CN115098481A true CN115098481A (en) 2022-09-23
CN115098481B CN115098481B (en) 2024-12-17

Family

ID=83294046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210737553.XA Active CN115098481B (en) 2022-06-27 2022-06-27 Metadata management method for repeated data deletion

Country Status (1)

Country Link
CN (1) CN115098481B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118672487A (en) * 2023-03-16 2024-09-20 慧与发展有限责任合伙企业 Backreference data structure for deduplication storage system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130086006A1 (en) * 2011-09-30 2013-04-04 John Colgrove Method for removing duplicate data from a storage array
CN107430602A (en) * 2015-12-29 2017-12-01 华为技术有限公司 Data de-duplication method and storage device
CN110618790A (en) * 2019-09-06 2019-12-27 上海电力大学 Mist storage data redundancy removing method based on repeated data deletion
US20220091766A1 (en) * 2020-09-23 2022-03-24 Hewlett Packard Enterprise Development Lp Data deduplication parameter computation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130086006A1 (en) * 2011-09-30 2013-04-04 John Colgrove Method for removing duplicate data from a storage array
CN107430602A (en) * 2015-12-29 2017-12-01 华为技术有限公司 Data de-duplication method and storage device
CN110618790A (en) * 2019-09-06 2019-12-27 上海电力大学 Mist storage data redundancy removing method based on repeated data deletion
US20220091766A1 (en) * 2020-09-23 2022-03-24 Hewlett Packard Enterprise Development Lp Data deduplication parameter computation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王国华: ""高效重复数据删除技术研究"", 中国博士学位论文全文数据库, 15 November 2014 (2014-11-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118672487A (en) * 2023-03-16 2024-09-20 慧与发展有限责任合伙企业 Backreference data structure for deduplication storage system

Also Published As

Publication number Publication date
CN115098481B (en) 2024-12-17

Similar Documents

Publication Publication Date Title
US10402091B1 (en) Managing data in log-structured storage systems
US10564850B1 (en) Managing known data patterns for deduplication
US9952765B2 (en) Transaction log layout for efficient reclamation and recovery
US10031672B2 (en) Snapshots and clones in a block-based data deduplication storage system
US10108547B2 (en) High performance and memory efficient metadata caching
US10176190B2 (en) Data integrity and loss resistance in high performance and high capacity storage deduplication
US10339132B2 (en) Flow control technique for EOS system
US10565230B2 (en) Technique for preserving efficiency for replication between clusters of a network
US10049118B2 (en) Consistency checker for global de-duplication clustered file system
US10133511B2 (en) Optimized segment cleaning technique
US9037544B1 (en) Snapshots and clones of volumes in a storage system
US8996797B1 (en) Dense tree volume metadata update logging and checkpointing
US9563555B2 (en) Systems and methods for storage allocation
US9250817B2 (en) Systems and methods for contextual storage
US8892818B1 (en) Dense tree volume metadata organization
US20160077744A1 (en) Deferred reference count update technique for low overhead volume metadata
US20170032005A1 (en) Snapshot and/or clone copy-on-write
CN106662981A (en) Storage device, program, and information processing method
US20160246522A1 (en) Exactly once semantics
CN115098481B (en) Metadata management method for repeated data deletion
US20240303200A1 (en) Caching techniques using a mapping cache and maintaining cache coherency using hash values
CN117406923A (en) Data deleting and managing system based on log structure merging tree
US11880584B2 (en) Reverse range lookup on a unified logical map data structure of snapshots
US12093183B1 (en) Caching techniques using a mapping cache and maintaining cache coherency using physical to logical address mapping
CN120295944B (en) Data processing method, electronic device and program product for block storage

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