Data deduplication for an eventually consistent system

Aspects of the present invention include a method, system and computer program product for performing data deduplication for eventually consistent distributed data storage (DDS) system. The method includes receiving data content from one or more clients by a DDS system, wherein the one or more clients do not coordinate transmitting of the data content. The method also includes calculating a hash for the data content by the distributed data storage system, writing the data content to an object used for data deduplication, wherein a name of the object is based on the hash and determining whether the data content is present in the distributed data storage system based on the name of an object previously stored on the DDS system. The method further includes keeping track of a number of references to the data content and delaying deletion of the data content for a predetermined period of time.

BACKGROUND

The present invention relates to distributed data storage systems, and more specifically to a method, system and computer program product for performing data deduplication for an eventually consistent distributed data storage system, where clients can read, write and delete data without any coordination between them, and the implementation is lock-free. Without loss of generality we explain our method for a distributed object storage system; it also applies to other distributed systems, e.g., for block and file storage.

Methods and systems exist for data deduplication in a distributed data storage system. Such a distributed data storage system typically comprises a plurality of data storage devices such as, e.g., servers with direct attached storage (e.g., disks), connected together in some type of network and could be located in a cloud. Such a system also commonly maintains multiple copies (replicas) of its data on a plurality of the servers (e.g., redundant data) so as to make the data more durable and less likely to be lost in the event of failure. Without loss of generality these copies could be erasure coded.

When a new version of an object is written and stored in a distributed storage system, it needs to be propagated to all of its replicas. Furthermore, there may also be storage metadata that needs to be propagated and/or updated. However, this propagation takes time and does not occur instantaneously. Thus, there may be a period of time (albeit usually relatively small) in which one or more replicas will have the new data while the other replicas may not be created or hold an older or previous version of the data. Thus, two clients that read the object at the same time may not see the same value. Eventually, the data will propagate to all of the replicas within the distributed data storage system such that the replicas will be consistent (hence, the term “eventually consistent”). The motivation for building such eventually consistent storage systems is the CAP theorem, which states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: consistency (all nodes see the same data at the same time), availability (a guarantee that every request receives a response about whether it succeeded or failed), and partition tolerance (the system continues to operate despite arbitrary partitioning due to network failures).

Data deduplication generally refers to a method that reduces the amount of data storage space needed to store data. Various methods of data deduplication exist. For example, different storage objects may contain identical content. Storing this duplicate data separately for each object is inefficient as it results in an excess amount of data storage space being utilized to store the same content.

Instead, data deduplication stores a piece of content once. Typically data deduplication employs a cryptographic hash function to identify duplicate content (with extremely high probability two pieces of content have the same hash only if they are identical) and maintains a dictionary of the content that has already been stored. When new data is written, the hash of its content is checked against the dictionary to see if the content is new. If new, a new content entity is created and a new entry is made for it in the dictionary. If a duplicate, an indication is made (e.g., a reference count increased), and a pointer or some other identifier is used to reference that content. The data deduplication method typically may take place on an object level, on the file level or on a finer grain data block level. The data pointer or other identifier usually takes up far less storage space than the piece of data itself. As a result, use of a data deduplication method can result in the saving of a relatively large amount of data storage space in a distributed data storage system. For example, consider a storage system for email attachments. In a deduplicated system, the content of a particular attachment might be stored once as (with appropriate redundancy for that content object), rather than once for each time it was sent in an email. The calculation of the hash and/or the detection of duplication may occur on the client side or in the storage system itself.

Sometimes it may be desired to delete a piece of data that has been previously deduplicated within a distributed data storage system, for example when that piece of data is no longer being referenced by any client. However, a potential issue with the deletion of deduplicated data within an eventually consistent distributed data storage system is that a race condition may occur in which it appears that no client is attempting to reference a particular piece of data while the system is in the process of deleting that particular piece of deduplicated data. However, in reality a client is indeed simultaneously in the process of attempting to reference that particular piece of data. That is, two conflicting operations are being attempted to be carried out at the same time on the particular piece of data (i.e., both the deletion of that data and access to that data). As a result, that particular piece of deduplicated data cannot be safely deleted from the distributed data storage system.

What is needed is an eventually consistent distributed data storage system that utilizes a data deduplication method, which allows for the safe deletion of deduplicated data. It is also desirable to allow for the avoidance of sending data content over the network (“over-the-wire”) into the system when that data content already exists in the distributed data storage system.

SUMMARY

According to an embodiment of the present invention, a method for performing data deduplication for an eventually consistent distributed data storage system includes receiving data content from one or more clients by a distributed data storage system, wherein the one or more clients do not coordinate transmitting of the data content. The method also includes calculating a hash for the data content by the distributed data storage system, writing the data content to an object used for data deduplication, wherein a name of the object is based on the hash and determining whether the data content is present in the distributed data storage system based on the name of an object previously stored on the distributed data storage system. The method further includes keeping track of a number of references to the data content and delaying deletion of the data content for a predetermined period of time.

According to another embodiment of the present invention, a system includes a processor in communication with one or more types of memory, the processor configured to perform a method that includes receiving data content from one or more clients by a distributed data storage system, wherein the one or more clients do not coordinate transmitting of the data content. The method also includes calculating a hash for the data content by the distributed data storage system, writing the data content to an object used for data deduplication, wherein a name of the object is based on the hash and determining whether the data content is present in the distributed data storage system based on the name of an object previously stored on the distributed data storage system. The method further includes keeping track of a number of references to the data content and delaying deletion of the data content for a predetermined period of time.

According to yet another embodiment of the present invention, a computer program product for performing data deduplication for an eventually consistent distributed data storage system includes a non-transitory storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method that includes receiving data content from one or more clients by a distributed data storage system, wherein the one or more clients do not coordinate transmitting of the data content. The method also includes calculating a hash for the data content by the distributed data storage system, writing the data content to an object used for data deduplication, wherein a name of the object is based on the hash and determining whether the data content is present in the distributed data storage system based on the name of an object previously stored on the distributed data storage system. The method further includes keeping track of a number of references to the data content and delaying deletion of the data content for a predetermined period of time.

DETAILED DESCRIPTION

Characteristics are as follows:

Service Models are as follows:

Deployment Models are as follows:

Workloads layer90provides examples of functionality for which the cloud computing environment may be utilized. Examples of workloads and functions which may be provided from this layer include: mapping and navigation91; software development and lifecycle management92; virtual classroom education delivery93; data analytics processing94; transaction processing95; and a method96for the safe deletion of deduplicated data within an eventually consistent distributed data storage system that utilizes a data deduplication method while also allowing for the avoidance of sending data content “over-the-wire” into the system when that data content already exists in the distributed data storage system.

Thus, as configured inFIG. 3, the system100includes processing capability in the form of processors101, storage capability including system memory114and mass storage104, input means such as keyboard109and mouse110, and output capability including speaker111and display115. In one embodiment, a portion of system memory114and mass storage104collectively store an operating system to coordinate the functions of the various components shown inFIG. 3.

Referring now toFIG. 5, a block diagram of an exemplary system300is shown. As illustrated the system300includes multiple clients302that are in communication with a distributed data storage system304via a network306. The network306may include a public network such as the Internet, a private network, or a combination thereof. In exemplary embodiments, the distributed data storage system304includes a plurality of servers310. Each of the servers310are in communication with one another and each of the servers310include a processor312, a memory314and a storage device316. The storage device316may include a plurality of storage devices such as hard disk drives, solid state drives, or the like.

In exemplary embodiments, the client302of the distributed storage system304may be an applications running on a server310in the same (cloud) data center, or outside of the data center. In exemplary embodiments, the client(s)302may be embodied in a processing system such as the one shown and described with reference toFIG. 3. The clients302can also be laptops, pcs, phones, tablets, etc. running outside of the (cloud) data center.

In accordance with embodiments of the present invention, methods, systems, and computer program products are disclosed for the safe deletion of deduplicated data within an eventually consistent distributed data storage system that utilizes a data deduplication method. The deduplicated data is safely deleted, as described in more detail hereinafter, when it is no longer referenced by any of the clients of the system. Other embodiments of the disclosure utilize a data deduplication method that allows the clients of the system to avoid sending the data “over-the-wire” (i.e., from one location to another) when they write objects whose content is already stored in the distributed data storage system.

In the known related art of data deduplication, one approach is content addressable data storage in which each stored data object is named by the hash of its content. Typically a client uploads the data object and the distributed data storage system returns the name of the data object created to the client. This name is typically based on the hash of the content of the data object, such that all equivalent content has the same name. Deletion is not possible, without strong consistency and serialization of the nodes in a distributed system, because the system cannot know for certain when no client remains that still may need the data. Also, to avoid sending data content that is already stored in the system, a client first calculates the hash of the data content and the sends the hash to check if the data content is already in the system. If the data content is there, it does not need to be sent. If the data content is not there, then it is sent.

With reference now toFIG. 4, there illustrated is a flow diagram of an embodiment of a method200that avoids sending data content over-the-wire that is already stored in the distributed data storage system and also allows for the safe deletion of deduplicated data from the system.

When a client accesses an eventually consistent distributed data storage system, that particular client may not see the same order of operations as other clients. Furthermore, each individual operation may be atomic (i.e., instantaneous), but there is usually no way to put together multiple operations atomically. Thus, with reference to the method200ofFIG. 4, to implement data deduplication with a delete function and to also avoid writing data content to the system when that content is already in the system, the following problems are solved by embodiments of the present invention (in no particular specific order):

The execution of a request for a first client, Client A, may check if a particular data content is already in the distributed data storage system. Assuming the data content is in the system, a new data object may be created which references that existing data content. However, meanwhile Client B has deleted that data content. This problem may be solved by embodiments of the present invention by eliminating the check by the execution of the request for a client (here, Client A) for the existence of a particular data content within the system. As such, when data content is uploaded to the distributed data storage system in a step204, the system may also always write the content object used for deduplication. This holds true because since the operation is idempotent, the content object is always the same.

Also, a step208keeps track of the references to a particular data object's content and allows an execution for a client's request to check if the number of references has reached zero. For this, the hierarchical naming available in object store systems such as OpenStack Swift and S3 may be used. For example, assume “hash” is text derived from the content hash of a data object. Then the content object can be stored with the name “hash” and references to the data object can be zero byte objects with the name “hash/reference/objectname.”

Further, when an execution of client request perceives that the last reference to a piece of data content has been deleted (e.g., no more zero byte objects with “hash/reference” in the prefix of their name), the request execution cannot delete the content object, since the request execution cannot know for sure that there has not been an intervening upload of that particular data content to the system by another client.

This problem can be solved by delaying the deletion of the content object in a step212for a predetermined period of time until it is certain that all intervening operations have been completed and that the number of references is still zero. In particular, the execution of a delete request may create a zero byte object called “hash/locked” (e.g., a “lock object”) and queue the content object for deletion by an asynchronous delete process that runs relatively much later in time after all operations have been completed. While the lock object is set, no new deduplication can occur for the content object for requests by other clients. Thus, for the period of time until the asynchronous delete process runs, a window of time exists in which data deduplication does not occur for this particular piece of data content. In addition, when the lock object is set, the next request execution to see it may create a new copy of the data content, if desired.

Furthermore, in embodiments of the present invention, to enable over-the-wire data deduplication, some of the software protocol may be run at the client side and some on the server side, in particular the calculation of the hash may occur on the client side and be sent to the server side where the remainder of the protocol executes. Furthermore, WSGI middleware may be used to run the server side of the protocol, e.g., for OpenStack Swift.

In an exemplary embodiment of the present invention, a generation scheme is used such that each time the reference count goes down to zero, the next attempt to deduplicate data with the same content will start a generation of a new version of the content object. Each generation has its own copy of the content object. This may lead to multiple copies of the content object, one for each active generation. However, deduplication for a particular content object will never be suspended (i.e., deduplication is always running).

Assume that each data object's content is named by the hash of its content. The name provided by the client for an object is “objectname.” For each content object, there is a pseudo-directory (we call it a pseudo-directory because there is not really a directory, rather it is part of a hierarchical name) named “hash,” where “hash/reference/objectname” is a zero byte object created for each reference to a content object. And “hash/locked” is a zero byte object created for during the execution of a delete operation when it perceives that there are no remaining references for a content object.

On the client side there may be a function that calculates the hash and sends it over the wire. On the server side there may be a piece of middleware that receives the hash and checks if it is already in the system.

To allow data deduplication to occur all of the time, even during a waiting period for the asynchronous delete process to run, the aforementioned generation scheme is utilized. Each generation has its' own copy of the content object and its own set of references to its content object. When the number of references in a generation goes down to zero, the locked object is created for that generation and the generation number is increased by one.

The protocols for implementing the embodiments of the present invention may be split or divided into two parts—one part that runs on the client's side and another part that runs on the server side. These protocols may be implemented in any suitable programming language in light of the teachings herein.

The asynchronous delete process mentioned above is typically a process that runs in the background. That delete process “wakes up” when enough time has passed such that the store of data is eventually consistent with respect to a particular content object—for example twelve hours after the delete occurred. Also, locks from prior generations may be deleted.

Embodiments of the present invention solution avoid races, using the aforementioned techniques such as avoiding the existence check (e.g., when content is uploaded then always write the content object used for deduplication). This operation is idempotent, i.e., has no additional effect if executed multiple times. Also, keeping track of the references to a content object can be done with the hierarchical naming available in object store systems such as OpenStack Swift and S3. Further, delayed deletion is utilized in which when the execution for a client request notices the reference count to content is zero, it creates a lock object. Other clients stop deduplicating with this copy of the content. Its deletion is delayed to avoid the race with another request execution that did not see the lock in time. Also, generations are utilized such that when a lock is set, the next request execution to see it creates a new copy of the content.

Embodiments of the present invention also allow clients to read, write and delete data without any coordination between them. Also, in eventually consistent systems, users or clients may not see the same order of operations. The embodiments leverage a unique combination of idempotent operations (operations that can be repeated without additional effect), delayed deletion, generations and hierarchical naming. Also, embodiments of present invention can save significant storage capacity for applications and services making use of eventually consistent data stores and services such as object stores and cloud object store services.