Providing snapshots for a logical device includes maintaining a global sequence number for the logical device, providing a snapshot table having a plurality of entries, where each of the entries corresponds to a targetless snapshot and includes a sequence number associated with a particular one of the targetless snapshots, the sequence number corresponding to the global sequence number at a time each of the snapshots is created, and, if a sequence number associated with a specific portion of the logical device is less than the global sequence number, then prior to moving new data to a specific portion of the logical device, copying old data from the specific portion to a location in a pool device, setting a pointer in a replication data pointer table to point to the location in the pool device and setting the sequence number associated with the specific portion to equal the global sequence number.

BACKGROUND OF THE INVENTION

1. Technical Field

This application relates to computing devices, and more particularly to the field of managing storage for computing devices.

2. Description of Related Art

Host processor systems may store and retrieve data using storage devices containing a plurality of host interface units (host adapters), disk drives, and disk interface units (disk adapters). Such storage devices are provided, for example, by EMC Corporation of Hopkinton, Mass. and disclosed in U.S. Pat. No. 5,206,939 to Yanai et al., U.S. Pat. No. 5,778,394 to Galtzur et al., U.S. Pat. No. 5,845,147 to Vishlitzky et al., and U.S. Pat. No. 5,857,208 to Ofek. The host systems access the storage device through a plurality of channels provided therewith. Host systems provide data and access control information through the channels of the storage device and the storage device provides data to the host systems also through the channels. The host systems do not address the disk drives of the storage device directly, but rather, access what appears to the host systems as a plurality of logical volumes. The logical volumes may or may not correspond to the actual disk drives.

It is desirable to be able to quickly get a consistent snapshot of data of a logical volume. Snapshot functionality may be provided on a storage device using protection bits to indicate when a track needs to be copied to a target logical device for the snapshot. Such snapshot functionality is described, for example, in U.S. Pat. No. 7,340,489 to Vishlitzky, et al. titled “VIRTUAL STORAGE DEVICES”, which is incorporated by reference herein. A session corresponding to the protection bit may be established so that when a protection bit is set, a write operation to a track of the storage device is intercepted before the write operation modifies the track. However, each snapshot uses at least one of the session bits (which are provided separately for each data increment, such as a track) and uses a snapshot target volume, both of which require a significant amount of overhead. In instances where it is desirable to have a large number of snapshots, this associated overhead may be unacceptable.

Accordingly, it is desirable to provide a system where it is possible to maintain a relatively large number of snapshots for a logical device without incurring the significant amount of overhead that would be associated with snapshots provided using conventional snapshot mechanisms.

SUMMARY OF THE INVENTION

According to the system described herein, providing snapshots for a logical device includes maintaining a global sequence number for the logical device, providing a snapshot table having a plurality of entries, where each of the entries corresponds to a targetless snapshot and includes a sequence number associated with a particular one of the targetless snapshots, the sequence number corresponding to the global sequence number at a time each of the snapshots is created, and, if a sequence number associated with a specific portion of the logical device is less than the global sequence number, then prior to moving new data to a specific portion of the logical device, copying old data from the specific portion to a location in a pool device, setting a pointer in a replication data pointer table to point to the location in the pool device and setting the sequence number associated with the specific portion to equal the global sequence number. Reading data from a targetless snapshot associated with a particular sequence number may include determining that a sequence number corresponding to data being read is less than or equal to the particular sequence number. The logical device may be a thin logical device. Entries in the replication data pointer table may each include a pointer to specific data in the data pool and may include a sequence number associated with the specific data. The entries in the replication data pointer table may be accessed according to each portion of the logical device. The new data may be written to memory prior to being moved to the logical device. Data written to memory may include a value of the global sequence number at a time when the data is written. Providing snapshots for a logical device may also include linking a new logical device to a first particular targetless snapshot by creating a table and setting entries in the table to point to either a portion of the logical device or a location of the pool data. Prior to setting entries in the table, each of the entries may be provided with an initial value indicating that the corresponding entry is undefined. Providing snapshots for a logical device may also include relinking the new logical device to a second particular targetless snapshot by modifying entries in the table that point to a portion of the logical device to which a write operation is performed between a time of the first particular targetless snapshot and a time of the second particular targetless snapshot.

According further to the system described herein, a non-transitory computer-readable medium contains software that provides snapshots for a logical device. The software includes executable code that maintains a global sequence number for the logical device, executable code that provides a snapshot table having a plurality of entries, where each of the entries corresponds to a targetless snapshot and includes a sequence number associated with a particular one of the targetless snapshots, the sequence number corresponding to the global sequence number at a time each of the snapshots is created and executable code that, prior to moving new data to a specific portion of the logical device, copies old data from the specific portion to a location in a pool device, sets a pointer in a replication data pointer table to point to the location in the pool device and sets the sequence number associated with the specific portion to equal the global sequence number in response to a sequence number associated with the specific portion of the logical device being less than the global sequence number. Executable code that reads data from a targetless snapshot associated with a particular sequence number may determine that a sequence number corresponding to data being read is less than or equal to the particular sequence number. The logical device may be a thin logical device. Entries in the replication data pointer table may each include a pointer to specific data in the data pool and may include a sequence number associated with the specific data. The entries in the replication data pointer table may be accessed according to each portion of the logical device. The new data may be written to memory prior to being moved to the logical device. Data written to memory may include a value of the global sequence number at a time when the data is written. The software may also include executable code that links a new logical device to a first particular targetless snapshot by creating a table and executable code that sets entries in the table to point to one of: a portion of the logical device and a location of the pool data. Prior to setting entries in the table, each of the entries may be provided with an initial value indicating that the corresponding entry is undefined. The software may also include executable code that relinks the new logical device to a second particular targetless snapshot by modifying entries in the table that point to a portion of the logical device to which a write operation is performed between a time of the first particular targetless snapshot and a time of the second particular targetless snapshot.

DETAILED DESCRIPTION OF VARIOUS EMBODIMENTS

Referring toFIG. 1, a diagram20shows a plurality of hosts22a-22ccoupled to a data storage array24that may be used in connection with an embodiment of the system described herein. Each of the hosts22a-22cmay all be located at the same physical site or may be located in different physical sites and may be coupled to the data storage array24using SCSI, Fibre Channel, iSCSI, etc. The data storage array24includes a memory26that facilitates operation of the storage array24, as further described elsewhere herein. The data storage array24also includes a plurality of host adapters (HA's)28a-28cthat handle reading and writing of data between the hosts22a-22cand the storage array24. Although the diagram20shows each of the hosts22a-22ccoupled to each of the HA's28a-28c, it will be appreciated by one of ordinary skill in the art that one or more of the HA's28a-28cmay be coupled to other hosts. In various embodiments, the storage array24may be a Symmetrix storage device, a CLARiiON storage device and/or a VPLEX product produced by EMC Corporation of Hopkinton, Mass., although the system described herein may also operate in connection with any other suitable storage devices and products.

In an embodiment, the storage array24may include one or more Remote Data Facility (RDF) adapter units (RA's)32a-32c. An RDF product produced by EMC Corporation, may be used to copy data from one storage array to another. For example, if a host writes data to a first storage array (e.g., a local storage array), it may be desirable to copy that data to a second storage array provided in a different location (e.g., a remote storage array). The RA's32a-32care coupled to an RDF link40and are similar to the HA's28a-28c, but are used to transfer data between the storage array24and other storage arrays that are also coupled to the RDF link40. The storage array24may be coupled to additional RDF links (not shown) in addition to the RDF link40. For further discussion of example RDF systems and the use thereof in data storage and recovery techniques, see, for example, U.S. Pat. No. 7,779,291 to Yoder et al., entitled “Four Site Triangular Asynchronous Replication,” which is incorporated herein by reference.

The storage array24may also include one or more disks36a-36c, each containing a different portion of data stored on the storage array24. Each of the disks36a-36cmay be coupled to a corresponding one of a plurality of disk adapter units (DA)38a-38cthat provides data to a corresponding one of the disks36a-36cand receives data from a corresponding one of the disks36a-36c. The disks36a-36cmay include any appropriate storage medium or mechanism, including hard disks, solid-state storage (flash memory), etc. Note that, in some embodiments, it is possible for more than one disk to be serviced by a DA and that it is possible for more than one DA to service a disk. It is noted that the term “data” as used herein may be appropriately understood, in various embodiments, to refer to data files, extents, blocks, chunks and/or other designations that indicate a unit, segment or collection of data.

The logical storage space in the storage array24that corresponds to the disks36a-36cmay be subdivided into a plurality of volumes or logical devices. The logical storage space may also be merged in connection with use of a plurality of volumes or logical devices. The logical devices may or may not correspond to the physical storage space of the disks36a-36c. Thus, for example, the disk36amay contain a plurality of logical devices or, alternatively, a single logical device could span both of the disks36a,36b. The hosts22a-22cmay be configured to access any combination of logical devices independent of the location of the logical devices on the disks36a-36c. A device, such as a logical device described above, has a size or capacity that may be expressed in terms of device geometry. The device geometry may include device geometry parameters regarding the number of cylinders in the device, the number of heads or tracks per cylinder, and the number of blocks per track, and these parameters may be used to identify locations on a disk. Other embodiments may use different structures.

One or more internal logical data path(s) exist between the DA's38a-38c, the HA's28a-28c, the RA's32a-32c, and the memory26. In some embodiments, one or more internal buses and/or communication modules may be used. In some embodiments, the memory26may be used to facilitate data transferred between the DA's38a-38c, the HA's28a-28cand the RA's32a-32c. The memory26may contain tasks that are to be performed by one or more of the DA's38a-38c, the HA's28a-28cand the RA's32a-32cand a cache for data fetched from one or more of the disks36a-36c. Use of the memory26is further described elsewhere herein in more detail. The storage array24may be provided as a stand-alone device coupled to the hosts22a-22cas shown inFIG. 1or, alternatively, the storage array24may be part of, and/or otherwise coupled to, a storage area network (SAN) that may include a plurality of other storage arrays as well as switches, routers, network connections, etc., as further discussed elsewhere herein.

FIG. 2is a schematic diagram50illustrating an embodiment of the storage array24where each of a plurality of directors52a-52care coupled to the memory26. Each of the directors52a-52cmay represent one of the HA's28a-28c, RA's32a-32c, and/or DA's38a-38c. In an embodiment herein, there may be up to sixty four directors coupled to the memory26. Of course, for other embodiments, there may be a higher or lower maximum number of directors that may be used.

The diagram50also shows an optional communication module (CM)54that provides an alternative communication path between the directors52a-52c. Each of the directors52a-52cmay be coupled to the CM54so that any one of the directors52a-52cmay send a message and/or data to any other one of the directors52a-52cwithout needing to go through the memory26. The CM54may be implemented using conventional MUX/router technology where a sending one of the directors52a-52cprovides an appropriate address to cause a message and/or data to be received by an intended receiving one of the directors52a-52c. Some or all of the functionality of the CM54may be implemented using one or more of the directors52a-52cso that, for example, the directors52a-52cmay be interconnected directly with the interconnection functionality being provided on each of the directors52a-52c. In addition, a sending one of the directors52a-52cmay be able to broadcast a message to all of the other directors52a-52cat the same time.

In some embodiments, one or more of the directors52a-52cmay have multiple processor systems thereon and thus may be able to perform functions for multiple directors. In some instances, at least one of the directors52a-52chaving multiple processor systems thereon may simultaneously perform the functions of at least two different types of directors (e.g., an HA and a DA). Furthermore, in some embodiments, at least one of the directors52a-52chaving multiple processor systems thereon may simultaneously perform the functions of at least one type of director and perform other processing with the other processing system. In addition, the memory26may be a global memory in which all or at least part of the global memory may be provided on one or more of the directors52a-52cand shared with other ones of the directors52a-52c. The memory26may be part of a global memory distributed across the processor systems of more than one storage array and accessible by each of the storage arrays.

Note that, although specific storage array configurations are disclosed in connection withFIGS. 1 and 2, it should be understood that the system described herein may be implemented on any appropriate platform. Thus, the system described herein may be implemented using a platform like that described in connection withFIGS. 1 and 2or may be implemented using a platform that is somewhat or even completely different from any particular platform described herein.

Referring toFIG. 3, a diagram60illustrates tables that are used to keep track of logical device information. A first table62corresponds to all of the logical devices used by the storage device24or by an element of a storage device, such as an HA and/or a DA. The table62includes a plurality of logical device entries66-68that correspond to all the logical devices used by the storage device24(or portion of the storage device24). The entries in the table62include descriptions for standard logical devices, virtual devices, log devices, thin devices, and other types of logical devices.

Each of the entries66-68of the table62corresponds to another table that contains information for each of the logical devices. For example, the entry67may correspond to a table72. The table72includes a header that contains overhead information. The table72also includes entries76-78for separate contiguous data portions of the logical device (e.g., a cylinder and/or a group of tracks). In an embodiment disclosed herein, a logical device may contain any number of data portions depending upon how the logical device is initialized. However, in other embodiments, a logical device may contain a fixed number of data portions.

Each of the data portion entries76-78corresponds to a track table. For example, the entry77may correspond to a track table82that includes a header84having overhead information. The track table82also includes entries86-88for each of the tracks. In an embodiment disclosed herein, there are fifteen tracks for every contiguous data portion. However, for other embodiments, it may be possible to have different numbers of tracks for each of the data portions or even a variable number of tracks for each data portion. For standard logical devices, the information in each of the entries86-88includes a pointer (either direct or indirect) to a physical address on one of the disk drives36a-36cof the storage device24(or a remote storage device if the system is so configured). Thus, the track table82may be used to map logical addresses of the logical device corresponding to the tables62,72,82to physical addresses on the disk drives36a-36cof the storage device24.

The tables62,72,82ofFIG. 3may be stored in the global memory26of the storage device24during operation thereof and may otherwise be stored in non-volatile memory (i.e., with the corresponding physical device). In addition, tables corresponding to logical devices accessed by a particular host may be stored in local memory of the corresponding one of the HA's28a-28c. In addition, the RA's32a-32cand/or the DA's38a-38cmay also use and locally store portions of the tables62,72,82.

Referring toFIG. 4, a table72′ for a thin logical device is shown as including null pointers as well as entries similar to entries for the table72, discussed above, that point to a plurality of track tables82a-82e. The thin logical device is allocated by the system to show a particular storage capacity while having a smaller amount of physical storage that is actually allocated. When a thin logical device is initialized, all (or at least most) of the entries in the table72′ are set to null. Physical data may be allocated for particular sections as data is written to the particular data portion. If no data is written to a data portion, the corresponding entry in the table72′ for the data portion maintains the null pointer that was written at initialization.

Referring toFIG. 5A, a replication data pointers table100includes a first linked list102of a plurality of data portion numbers104a-104c. The replication data pointers table100is used to maintain data that is moved in connection with providing targetless snapshots, as described herein. Each of the data portion numbers104a-104ccorresponds to a contiguous data portion of a logical device. The logical device may be a conventional logical device with all of the data portions having corresponding physical data storage allocated thereto or may be a thin logical device, described above.

Each of the data portion numbers104a-104ccorresponds to one or more table entries that are maintained using an appropriate data structure, such as a linked list. The data portion number104acorresponds to a plurality of table entries106a-108a, the data portion number104bcorresponds to a plurality of table entries106b-108b, and the data portion number104ccorresponds to a plurality of table entries106c-108c. Note that, although the table100is illustrated with three data portion numbers104a-104ceach having three table entries, the table100can contain any number of data portion numbers each having any number of table entries. In some cases, which will become apparent from the additional discussion herein, it is possible for there to be no data portion number or corresponding table entries associated with a particular data portion of a logical device. Each of the table entries106a-108cincludes a sequence number and a pointer to storage, which are explained in more detail elsewhere herein.

Referring toFIG. 5B, a replication data pointers tree110includes a plurality of table entries112a-112fthat each correspond to a particular data portion. Each of the table entries112a-112fincludes a sequence number and a pointer to storage. The replication data pointers tree110corresponds to one of the linked lists pointed to by one of the data pointers104a-104cof the replications data pointers table100, discussed above. The sequence number and the pointer to storage are similar to the sequence number and pointer to storage used in connection with the table100, and are described in more detail elsewhere herein. In an embodiment herein, the tree110is a balanced binary tree ordered according to sequence number.

Referring toFIG. 6, a data pool115includes storage for data that is moved in connection with maintaining targetless snapshots. Data stored in the data pool115is pointed to by the pointers provided with the table entries106a-108cor the table entries112a-112f. In some embodiments, the data pool115is provided in a single logical and/or physical location. In other embodiments, the data pool115may be distributed and/or may use more than one physical and/or logical data storage element. Providing data to the data pool115is discussed in more detail elsewhere herein.

Referring toFIG. 7, a snapshot table120includes a plurality of entries corresponding to particular snapshots. Each of the entries includes a snapshot ID and a sequence number. The snapshot ID may be used to identify a particular snapshot and could be text (e.g., “Mar. 12, 2014, 8:00 am snapshot”) or could be a token that is used by other software (not shown herein) to identify each of the snapshots. The sequence number provided with each of the snapshots is used in connection with providing targetless snapshots and is described in more detail elsewhere herein.

Referring toFIG. 8, a sequence number table130is shown as having a plurality of entries. Each of the entries of the table130contains a sequence number, described in more detail elsewhere herein. The table130can contain a single entry for each data portion number (or other appropriate data increment) of the logical device (e.g., thin logical device) for which targetless snapshots are being provided. Thus, for example, if there are one hundred data portions in a logical device, there are one hundred entries for sequence numbers in the table130. Use of the sequence number table130and of sequence numbers is described in more detail elsewhere herein.

Referring toFIG. 9, a flow diagram200illustrates operations performed in connection with performing targetless snapshots for a logical device. Processing begins at a first step202where a global sequence number (associated with the logical device for which targetless snapshots are being provided) and the tables100,120,130that are used with targetless snapshots are initialized. Note that the tree110may be used in addition to or instead of the table100. In an embodiment herein, snapshot sequence numbers start at zero and are incremented by one for each snapshot, but of course in other instances it is possible to start at any number and increment or decrement by any amount. At the step202, the replication pointers table data pointers table100(and/or the tree110) is initialized to be empty (contain no entries), the snapshot table120is initialized to be empty, the sequence number table130is initialized so that each entry contains zero (the initial sequence number), and the global sequence number is initialized to zero (the initial sequence number).

Following the step202is a step204where the system waits for a snapshot to occur. A snapshot may be user initiated or may be automated to occur at specific times (e.g., every hour). Once a snapshot occurs, control transfers from the step204to a step206where an entry corresponding to the snapshot is created in the snapshot table120. At the step206, the ID value is provided to the new entry in the snapshot table120and the corresponding sequence number is set to one greater than the current global sequence number. The ID value may include a user specified name that is to be associated with the sequence number provided to the entry. Following the step206is a step208where the global sequence number is incremented. Following the step208, control transfers back to the step204to wait for the next snapshot to occur.

Referring toFIG. 10, a flow diagram220illustrates steps performed in connection with a write operation to a logical device for which snapshots are being provided. Processing begins at a first test step222where it is determined if the global sequence number equals the sequence number associated with the data portion to which the write is being provided, which is provided by the sequence number table130. If so, then control transfers from the test step222to a step224where the write operation is performed in a usual fashion. No special processing is performed in this case because the global sequence number being equal to the sequence number where the data is being written means that any snapshot data associated with that particular data section has already been protected (copied to the data pool115, as described in more detail elsewhere herein). Following the step224, processing is complete.

If it is determined at the step222that the global sequence number does not equal the sequence number associated with the data portion to which the write is being performed (the global sequence number is greater), then control transfers from the step222to a step226where an entry in the replication data pointers table100is created by placing the new entry in a linked list using the data portion number where the write is being performed on the logical device and using the sequence number for the source data portion (from the sequence number table130). If the replication data pointers tree110is used, then at the step226a new entry is created for the tree110. Following the step226is a step228where data that is being overwritten is copied from the logical device to the data pool115. Note that the step228may be omitted in instances where the logical device is a thin device and the particular data portion is empty (e.g., the pointer for the data portion points to null). Note also that, in some cases data on the logical device may be cached, in which case the copy may be from the cache memory.

Following the step228is a step232where the pointer in the table entry created at the step226, described above, is set to point to the data in the data pool115that was copied at the step228, described above, or to null in the case of a thin logical device with no data in the data portion. Following the step232is a step234where the sequence number for the entry in the sequence number table130is set to the global sequence number, indicating that the corresponding data written to the logical device corresponds to the current global sequence number. Following the step234is the step224, discussed above, where the write operation to write the new data to the device is performed. Following the step224, processing is complete.

Referring toFIG. 11, a flow diagram250illustrates processing performed in connection with reading different versions from different snapshots of data on the logical device. Processing begins at a first step252where it is determined if a sequence number associated with a desired version (VER in flow diagram250) is greater than or equal to a version number from the sequence number table (SNT in the flow diagram250). For example, if it was desired to read a version of data associated with a particular snapshot (e.g., “8:00 am on Mar. 12, 2014”) having a sequence number X, then the test at the step252would compare X with an entry in the sequence number table for the data portion of interest containing data being read, which is provided in the sequence number table130. If it is determined at the step252that the sequence number of the desired version is greater than or equal to a version number from the sequence number table corresponding to the data being read, then data on the logical device was written prior to the time of the snapshot and control transfers from the step252to the step254where the data is read from the logical device. Note that this also occurs when it is desired to read current data from the logical device since data on the logical volume is always the latest version. Following the step254, processing is complete.

If it is determined at the step252that the sequence number of the desired version is not greater than or equal to a version number from the sequence number table corresponding to the data being read, then data on the logical device was written after the time of the snapshot and the desired data is in the data pool115and control transfers from the step252to a step256where an iteration pointer is set to point to a first item in a list of items in the replication data pointers table100. The iteration pointer is used to traverse a list of pointers for a data portion corresponding to the data being read. For the explanation herein, it is assumed that the list of pointers is arranged with the most recently added table entry (having the highest sequence number) being first in the list, followed by the next most recently added table entry (having the second highest sequence number), etc. Generally, the iteration pointer iterates through table entries for a specific data portion from highest sequence number to lowest sequence number. Note that, in instances where the replication data pointers tree110is used, the iteration pointer is set to point to the top of the tree110and is used to traverse the tree110.

Following the step256is a test step258where it is it is determined if a sequence number associated with the desired version is greater than or equal to a version number associated with the table or tree entry indicated by the iteration pointer, similar to the test at the step252, discussed above. If so, then control transfers from the test step258to a step262where data is read from the data pool115according to the data pointer of the table or tree entry indicated by the iteration pointer. Following the step262, processing is complete. Otherwise, if it is determined at the step258that the sequence number associated with the desired version is not greater than or equal to the version number associated with the table or tree entry indicated by the iteration pointer, then control transfers from the step258to a step264where the iteration pointer is set to point to a next table or tree entry. Note that the final item of the table or tree entries has a sequence number of zero so that, eventually, the test at the step258will cause the step262to be executed.

In some instances, it is possible to maintain written data in memory (e.g., in a cache database in the global memory26). Version information may be maintained with the written data in memory to facilitate eventually moving the data to the logical device while providing targetless snapshots as described herein. The data may be moved using a background process.

Referring toFIG. 12, a table280is shown as including a plurality of entries282-284. Each of the entries282-284has a sequence number used for targetless snapshots and has corresponding data. The sequence number represents a value of the global sequence number at a time that the data is written. Data that is written to the logical device may be initially provided to the table280, which may be stored in relatively fast volatile memory. Data from the table280may then be migrated to the logical device in a background operation. This is described in more detail elsewhere herein.

Referring toFIG. 13, a flow diagram300illustrates steps performed in connection with initially writing data to memory in a system using targetless snapshots. Processing begins at a first test step302where it is determined if other data corresponding to the particular data portion being written is already in memory from a previous write operation. If so, then control transfers from the test step302to a test step304where it is determined if the data currently in memory corresponds to data written during the current cycle (current value of the global sequence number associated with the logical device). If so, then control transfers from the step304to a step306where the data being written overwrites the data in memory. Following the step306, processing is complete.

If it is determined at the step304that the data currently in memory does not correspond to data written during the current cycle, then control transfers from the test step304to a step308where the data currently in memory is moved to the logical device. Processing at the step308is discussed in more detail elsewhere herein. Following the step308is a step312where an entry for the data currently being written is created in the memory and the data being written is copied to the just-created memory entry. Note that the step312is also reached from the step302if it is determined at the step302that there is no data in memory corresponding to the portion being written. Following the step312is a step314where the sequence number for the data portion (from the sequence number table130) is copied to the new memory entry. Following the step314is a step316where the sequence number in the sequence number table is set to the current value of the global sequence number. Following the step316, processing is complete.

Referring toFIG. 14, a flow diagram330illustrates in more processing performed in connection with the step308of the flow diagram300, described above. The processing illustrated by the flow diagram330may also be provided in connection with a background process for moving data from memory to the logical device, discussed elsewhere herein. Processing begins at a first step332where an entry is created in the replication data pointers table100or the replication data pointers tree110(whichever is used). The entry is similar to other entries in the table100or tree110, discussed elsewhere herein. Following the step332is a step334where data from the logical device is copied to the data pool115. Following the step334is a step336where the pointer in the new table or tree entry (created at the step332) is set to point to the data copied to the pool at the step334.

Following the step336is a step338where the sequence number of the new table or tree entry is set to the sequence number of the entry of the table280in memory that is being moved. Following the step338is a step442where the data in memory is copied to the logical device just as if the data were being written to the logical device. Following the step342is a step344where the memory entry is deleted (or possibly returned to a pool of free memory entries, as appropriate). Following the step344, processing is complete. Note that the result of processing illustrated by the flow diagram330is similar to the result provided by processing illustrated by the flow diagram220, described above, where data is written to a logical device without being first maintained in memory.

In some cases, it may be desirable to link a target volume for an otherwise targetless snapshot to provide a conventional snapshot volume. Although, as described elsewhere herein, it is possible to access different versions of targetless snapshots, providing a link for a targetless snapshot allows application access to the linked volume in a conventional manner.

Referring toFIG. 15, a diagram360illustrates creating a linked volume. The linked volume includes a table362that is similar to the other tables72,72′ discussed elsewhere herein where a plurality of entries364a-364fin the table362include pointers to data portions. In the case of a linked volume, the each of the entries364a-364fpoints to one of: an underlying logical volume366for which targetless snapshots are being provided, the data pool115, or null (if the logical volume366is a thin volume). The entries364d-364fthat contain a “U” indicate that those particular entries are undefined. As discussed in more detail elsewhere herein, when a linked volume is first allocated, then entries in the corresponding table are all undefined. Subsequently, a process traverses the table and defines all the entries to point to the either underlying logical volume, the data pool, or, in the case of a thin logical volume, null (indicating an unallocated portion on the underlying thin logical volume). This is described in more detail elsewhere herein. The linked volume may correspond to a snapshot having a particular sequence number, which becomes the target global sequence number of the linked volume.

Referring toFIG. 16, a flow diagram380illustrates processing performed in connection with traversing undefined entries in a table for a linked volume (like the table362, discussed above) and causing the entries to be defined. Processing begins at a first step382where an iteration counter is set to point to a first one of the entries in the table. Following the step382is a test step384where it is determined if all of the entries in the table have been processed. If so, then processing is complete. Otherwise, control transfers from the step384to a test step386where it is determined if the data portion corresponding to the entry indicated by the iteration counter points to the underlying logical device. The determination at the step386is similar to processing for the flow diagram250, discussed above, and depends upon the version number being linked.

If it is determined at the step386that the data portion corresponding to the entry indicated by the iteration counter points to the underlying logical device, then control transfers from the test step386to a step388, where the corresponding table entry is set to point to the logical device. Otherwise, control transfers from the test step386to a test step392where it is determined if the data portion corresponding to the entry indicated by the iteration counter is allocated. If not, then control transfers to a step394where the corresponding entry in the table is set to null. Otherwise, control transfers to a step396where the corresponding entry in the table is set to point to the data pool115. Following the step396is a step398where the iteration counter is incremented. Note that the step398also follows the steps388,394. Following the step398, control transfers back to the step384for a subsequent iteration.

In some instances, it may be desirable to relink a logical volume from one targetless snapshot to another targetless snapshot. That is, a logical volume that has been or is in the process of being linked to a first snapshot may be unlink from the first snapshot and, at the same time, linked to a second, different, snapshot.

Referring toFIG. 17, a flow diagram410illustrates processing performed in connection with relinking a logical volume from a first snapshot (first target global sequence number) to a second, different, snapshot (second target global sequence number). Processing begins at a first step412where a new table (like the table362, discussed above) is created. When a logical device is relinked from one targetless snapshot to another, a separate table is maintained for each of the snapshots. Once all appropriate data is provided to the new table (corresponding to the second targetless snapshot), then the old table may be deleted. Following the step412is a step414where an iteration counter is set to point to a first one of the entries in the old table. Following the step414is a test step416where it is determined if all of the entries in the old table have been processed. If so, then processing is complete. Otherwise, control transfers from the step416to a test step418where it is determined if a table entry corresponding to the iteration counter is different between the old table and the new table. Note that, if data is written to the logical device for which targetless snapshots are being provided any time between the first targetless snapshot and the second targetless snapshot, then the corresponding entries in the old and new tables will be different. Note that, in some embodiments, any writes provided to the logical volume being relinked prior to the relinking may be discarded.

If it is determined at the step418that the table entry corresponding to the iteration counter is not different between the old table and the new table, then control transfers from the test step418to a step422where the table entry is copied from the old table to the new table. Otherwise, control transfers from the step418to a step424where the table entry corresponding to the iteration counter is set to indicate that entering the table entry is to be deferred to a later time. Setting the table entry to indicate that entering the table entry is to be deferred to a later time makes the transition occur more quickly. The table entry may be provided at a later time using, for example, processing similar to the processing illustrated in connection with the flow diagram330, described above. Following the step424is a step426where the iteration counter is incremented. Note that the step426also follows the step422. Following the step426, control transfers back to the step416for a subsequent iteration.

Various embodiments discussed herein may be combined with each other in appropriate combinations in connection with the system described herein. Additionally, in some instances, the order of steps in the flow diagrams, flow diagrams and/or described flow processing may be modified, where appropriate. Further, various aspects of the system described herein may be implemented using software, hardware, a combination of software and hardware and/or other computer-implemented modules or devices having the described features and performing the described functions. The system may further include a display and/or other computer components for providing a suitable interface with a user and/or with other computers.

Software implementations of the system described herein may include executable code that is stored in a non-transitory computer-readable medium and executed by one or more processors. The computer-readable medium may include volatile memory and/or non-volatile memory, and may include, for example, a computer hard drive, ROM, RAM, flash memory, portable computer storage media such as a CD-ROM, a DVD-ROM, a flash drive or other drive with, for example, a universal serial bus (USB) interface, and/or any other appropriate tangible or non-transitory computer-readable medium or computer memory on which executable code may be stored and executed by a processor. The system described herein may be used in connection with any appropriate operating system.