This application generally relates to data storage and more particularly to techniques used to protect loss of metadata and data described by such metadata.
Systems may include different resources used by one or more host processors. Resources and host processors in the system may be interconnected by one or more communication connections, such as network connections. These resources may include, for example, data storage devices such as those included in the data storage systems. These data storage systems may be coupled to one or more host processors and provide storage services to each host processor. Multiple data storage systems from one or more different vendors may be connected and may provide common data storage for one or more host processors in a computer system.
A host may perform a variety of data processing tasks and operations using the data storage system. For example, a host may perform basic system I/O (input/output) operations in connection with data requests, such as data read and write operations.
Host systems may store and retrieve data using a data storage system containing a plurality of host interface units, disk drives (or more generally storage devices), and disk interface units. The host systems access the storage devices through a plurality of channels provided therewith. Host systems provide data and access control information through the channels to a storage device of the data storage system and data of the storage device is also provided from the data storage system to the host systems also through the channels. The host systems do not address the disk drives of the data storage system directly, but rather, access what appears to the host systems as a plurality of files, objects, logical units, logical devices or logical volumes. These may or may not correspond to the actual physical drives. Allowing multiple host systems to access the single data storage system allows the host systems to share data stored therein.
Various embodiments of the techniques herein may include a method, a system and a computer readable medium for performing processing to recover metadata comprising: creating a plurality of shadow top structures, wherein a different one of the plurality of shadow top structures is created for each of a plurality of metadata (MD) top nodes included in a MD mapping structure used to determine storage locations of data stored at corresponding logical addresses in a file system logical address space, wherein each MD top node of the MD mapping structure is used in determining storage locations for a specified subrange of logical addresses of the file system logical address space, and wherein each of the plurality of shadow top structures for a corresponding one of the plurality of MD top nodes describes each file system object mapped to a logical address included in the specified subrange of logical addresses of the file system address space associated with said corresponding one of the plurality of MD top nodes; and performing first processing that uses the plurality of shadow top structures to recover first information for a first index node (inode) associated with a file system object of a file system having the file system logical address space.
In at least one embodiment, the first processing may include determining a first subrange of the file system logical address space, wherein the first subrange is mapped to the file system object of the file system having the file system logical address space, wherein the first inode is associated with the file system object; and updating the first information of the first inode to include a starting address of the first subrange. The file system object may be a file or a directory. The file system object may be a file, and a logical device may be implemented as the file system object in the file system. The logical address range of the logical device may correspond to the first subrange of the file system logical address space. The MD mapping structure may include a plurality of levels of MD nodes. A storage location mapped to a first logical address of the file system object may be determined using the MD mapping structure. Determining the storage location may include traversing a path of MD nodes of the MD mapping structure from a first MD node to a second MD node identifying the storage location. A first MD top node of the plurality of metadata (MD) top nodes may be included in the path traversed to determine the storage location. Each shadow top structure of the plurality of shadow top structures may include a plurality of entries. Each of the plurality of entries may be associated with a portion of logical addresses in the file system logical address space and may include an inode number of a corresponding file system object mapped to the portion. The file system object may be created in the file system. Creating the file system object may include creating the first inode and mapping the first inode into the file system logical address space.
Features and advantages of the present invention will become more apparent from the following detailed description of exemplary embodiments thereof taken in conjunction with the accompanying drawings in which:
Referring to
Each of the host systems 14a-14n and the data storage system 12 included in the system 10 may be connected to the communication medium 18 by any one of a variety of connections as may be provided and supported in accordance with the type of communication medium 18. The processors included in the host computer systems 14a-14n may be any one of a variety of proprietary or commercially available single or multi-processor system, such as an Intel-based processor, or other type of commercially available processor able to support traffic in accordance with each particular embodiment and application.
It should be noted that the particular examples of the hardware and software that may be included in the data storage system 12 are described herein in more detail, and may vary with each particular embodiment. Each of the host computers 14a-14n and data storage system may all be located at the same physical site, or, alternatively, may also be located in different physical locations. Examples of the communication medium that may be used to provide the different types of connections between the host computer systems and the data storage system of the system 10 may use a variety of different communication protocols such as block-based protocols (e.g., SCSI, Fibre Channel, iSCSI), file system-based protocols (e.g., NFS), and the like. Some or all of the connections by which the hosts and data storage system may be connected to the communication medium may pass through other communication devices, such switching equipment that may exist such as a phone line, a repeater, a multiplexer or even a satellite.
Each of the host computer systems may perform different types of data operations in accordance with different types of tasks. In the embodiment of
It should be noted that although element 12 is illustrated as a single data storage system, such as a single data storage array, element 12 may also represent, for example, multiple data storage arrays alone, or in combination with, other data storage devices, systems, appliances, and/or components having suitable connectivity, such as in a SAN, in an embodiment using the techniques herein. It should also be noted that an embodiment may include data storage arrays or other components from one or more vendors.
The data storage system 12 may be a data storage array including a plurality of data storage devices 16a-16n. The data storage devices 16a-16n may include one or more types of physical data storage devices (PDs or physical devices denoting backend, non-volatile storage) such as, for example, one or more rotating disk drives and/or one or more solid state drives (SSDs). An SSD is a data storage device that uses solid-state memory to store persistent data. An SSD using SRAM or DRAM, rather than flash memory, may also be referred to as a RAM drive. SSD may refer to solid state electronics devices as distinguished from electromechanical devices, such as hard drives, having moving parts. Flash devices or flash memory-based SSDs are one type of SSD that contains no moving mechanical parts.
The data storage array may also include different types of adapters or directors, such as an HA 21 (host adapter), RA 40 (remote adapter), and/or device interface 23. Each of the adapters may be implemented using hardware including a processor with local memory with code stored thereon for execution in connection with performing different operations. The HAs may be used to manage communications and data operations between one or more host systems and the global memory (GM). In an embodiment, the HA may be a Fibre Channel Adapter (FA) or other adapter which facilitates host communication. The HA 21 may be characterized as a front end component of the data storage system which receives a request from the host. The data storage array may include one or more RAs that may be used, for example, to facilitate communications between data storage arrays. The data storage array may also include one or more device interfaces 23 for facilitating data transfers to/from the data storage devices 16a-16n. The data storage interfaces 23 may include device interface modules, for example, one or more disk adapters (DAs) (e.g., disk controllers), adapters used to interface with the flash drives, and the like. The DAs may also be characterized as back end components of the data storage system which interface with the physical data storage devices.
One or more internal logical communication paths may exist between the device interfaces 23, the RAs 40, the HAs 21, and the memory 26. An embodiment, for example, may use one or more internal busses and/or communication modules. For example, the global memory portion 25b may be used to facilitate data transfers and other communications between the device interfaces, HAs and/or RAs in a data storage array. In one embodiment, the device interfaces 23 may perform data operations using a cache (e.g., data cache) that may be included in the global memory 25b, for example, when communicating with other device interfaces and other components of the data storage array. The other portion 25a is that portion of memory that may be used in connection with other designations that may vary in accordance with each embodiment.
The particular data storage system as described in this embodiment, or a particular device thereof, such as a disk or particular aspects of a flash device, should not be construed as a limitation. Other types of commercially available data storage systems, as well as processors and hardware controlling access to these particular devices, may also be included in an embodiment.
Host systems provide data and access control information through channels to the storage systems, and the storage systems may also provide data to the host systems also through the channels. The host systems do not address the drives or devices 16a-16n of the storage systems directly, but rather access to data may be provided to one or more host systems from what the host systems view as a plurality of logical devices, logical volumes (LVs) which may also referred to herein as logical units (e.g., LUNs). A logical unit (LUN) may be characterized as a disk array or data storage system reference to an amount of disk space that has been formatted and allocated for use to one or more hosts. A logical unit may have a logical unit number that is an I/O address for the logical unit. As used herein, a LUN or LUNs may refer to the different logical units of storage which may be referenced by such logical unit numbers. The LUNs may or may not correspond to the actual or physical disk drives or more generally physical storage devices. For example, one or more LUNs may reside on a single physical disk drive, data of a single LUN may reside on multiple different physical devices, and the like. Data in a single data storage system, such as a single data storage array, may be accessed by multiple hosts allowing the hosts to share the data residing therein. The HAs may be used in connection with communications between a data storage array and a host system. The RAs may be used in facilitating communications between two data storage arrays. The DAs may be one type of device interface used in connection with facilitating data transfers to/from the associated disk drive(s) and LUN (s) residing thereon. A flash device interface may be another type of device interface used in connection with facilitating data transfers to/from the associated flash devices and LUN(s) residing thereon. It should be noted that an embodiment may use the same or a different device interface for one or more different types of devices than as described herein.
In an embodiment in accordance with the techniques herein, the data storage system as described may be characterized as having one or more logical mapping layers in which a logical device of the data storage system is exposed to the host whereby the logical device is mapped by such mapping layers of the data storage system to one or more physical devices. Additionally, the host may also have one or more additional mapping layers so that, for example, a host side logical device or volume is mapped to one or more data storage system logical devices as presented to the host.
The device interface, such as a DA, performs I/O operations on a physical device or drive 16a-16n. In the following description, data residing on a LUN may be accessed by the device interface following a data request in connection with I/O operations that other directors originate. The DA which services the particular physical device may perform processing to either read data from, or write data to, the corresponding physical device location for an I/O operation. An I/O operation, such as to read or write data, may identify a logical device, such as a LUN, and an offset denoting a logical address or location on the LUN. Data storage at the LUN and offset may be stored at a physical storage location on one or more PDs. Thus, processing performed on the data storage system for the I/O operation may include mapping the LUN, offset to its corresponding physical storage location on one or more PDs of the data storage system.
In at least one embodiment in accordance with the techniques herein, data read from, and/or data written to PDs denoting the backend non-volatile physical storage devices may utilize a data cache that is a form of fast memory, such as a form of solid state storage. The data cache, also sometimes referred to herein as a cache, may be implemented, for example, using a portion of global memory 25b as noted above. In connection with a read I/O operation, processing may include first determining whether the requested read data is stored in the cache thereby denoting a read cache hit. If there is a read cache hit, the requested read data may be retrieved from cache and returned to the requester without having to actually access the data on the PDs thereby greatly reducing the response time for the read I/O operation. If the requested read data is not in cache thereby denoting a read cache miss, the requested read data is read from its corresponding location on the one or more PDs, stored in the data cache, and then returned to the requester. In connection with a write I/O operation, the write data is first written to the cache in a cache location and marked as write pending (WP). Once the write data has been stored in cache, an acknowledgement regarding completion of the write operation may be returned to the requester even without actually writing the write data out to its corresponding location on the one or more PDs. At some time later, the WP data may be destaged from the cache to its location on the one or more PDs. Once the WP data has been destaged from cache, the cache location including the write data may be updated to clear the WP state, and more generally, the cache location may be reused.
Also shown in
Each of the different adapters, such as HA 21, DA or disk interface, RA, and the like, may be implemented as a hardware component including, for example, one or more processors, one or more forms of memory, and the like. Code may be stored in one or more of the memories of the component for performing processing.
An embodiment of a data storage system may include components having different names from that described herein but which perform functions similar to components as described herein. Additionally, components within a single data storage system, and also between data storage systems, may communicate using any suitable technique that may differ from that as described herein for exemplary purposes. Each of the SPs 27 may be a CPU including one or more “cores” or processors and each may have their own memory used for communication between the different front end and back end components rather than utilize a global memory accessible to all storage processors. In such embodiments, memory 26 may represent memory of each such storage processor.
An embodiment of a data storage system in accordance with the techniques herein may include one or more data facilities or services such as may be performed with respect to physical and/or logical data storage entities of the data storage system. For example, a LUN and a file are each a storage entity for which the data storage system may include one or more data replication facilities. For example, a snapshot facility may be a local data replication facility or service on the data storage system that may be used to create one or more snapshots of a file, file system, LUN, and the like. As known in the art, a snapshot technique may be used by a snapshot facility to create a logical or virtual copy of the data source, such as a file, file system, or LUN. For example, a snapshot facility may be used in an embodiment in accordance with the techniques herein to create a snapshot characterized as a logical point in time copy of data of a data source. A snapshot of a source LUN, for example, may appear like a normal LUN and may be used for backup, testing, read operations, write operations, and the like. Snapshots may rely, for example, on copy on first write (COFW) and other techniques to track source LUN changes from the time when a snapshot was created. Any writes to the source may result in processing by snapshot software, for example, to copy the original data prior to changes into another area of storage. With respect to COFW techniques, the COFW occurs only once for each data block modified on the source. Since only changed data blocks of the source are retained rather than make a complete copy of the source, the storage capacity required to implement snapshots may be considerably less than that of the source. Though a snapshot of a source LUN may be presented to a user as a separate LUN along with the current source LUN, a snapshot of the source LUN is a virtual point in time copy and requires access to the unchanged data in the source LUN. Therefore failures affecting the source LUN also affect the snapshot of the source LUN. Snapshots of a source LUN may be contrasted, for example, with the physically complete bit-for-bit replicas of the source LUN.
In connection with the foregoing, COFW is only one example of a technology or technique that may be used in connection with snapshots. More generally, any suitable technique may be used in connection with snapshot creation and techniques described herein. As another example, redirect on Write (ROW) is another technique that may be used in connection with a snapshot implementation. With ROW, after a snapshot is taken, new writes to the primary source LUN are redirected (written) to a new location.
A data storage system may support one or more different types of logical devices presented to a host or other client as LUNs. For example, a data storage system may provide for configuration of thick or regular LUNs and also virtually provisioned or thin LUNs. A thick or regular LUN is a logical device that, when configured to have a total usable capacity such as presented to a user for storing data, has all the physical storage provisioned for the total usable capacity. In contrast, a thin or virtually provisioned LUN having a total usable capacity (e.g., a total logical capacity as published or presented to a user) is one where physical storage may be provisioned on demand, for example, as data is written to different portions of the LUN's logical address space. Thus, at any point in time, a thin or virtually provisioned LUN having a total usable capacity may not have an amount of physical storage provisioned for the total usable capacity. The granularity or the amount of storage provisioned at a time for virtually provisioned LUN may vary with embodiment. In one embodiment, physical storage may be allocated, such as a single allocation unit of storage, the first time there is a write to a particular target logical address (e.g., LUN and location or offset on the LUN). The single allocation unit of physical storage may be larger than the size of the amount of data written and the single allocation unit of physical storage is then mapped to a corresponding portion of the logical address range of a LUN. The corresponding portion of the logical address range includes the target logical address. Thus, at any point in time, not all portions of the logical address space of a virtually provisioned device may be associated or mapped to allocated physical storage depending on which logical addresses of the virtually provisioned LUN have been written to at a point in time.
In at least one embodiment, thin or virtually provisioned LUNs may be implemented with and organized as a type of mapped LUN. In such an embodiment, each thin LUN, or more generally, any suitable type of logical device or LUN, may be implemented as a file of a file system. It will be appreciated by those of ordinary skill in the art that techniques herein are not limited to use with thin LUNs and may more generally be used in connection with other types of LUNs.
Referring to
In at least one embodiment in accordance with the techniques herein, the file system 102 may be a UNIX-style file system. In such a file system, an index node (inode) is a data structure used to represent a filesystem object, such as a directory or file 104. In connection with thin LUN 101 implemented as file 104, the inode 106 for the file 104 stores metadata (MD) about the file 104 such as various file attributes and information. Generally, each inode associated with a particular file system object stores attributes and information about the file system object. For example, in at least one embodiment, each inode, such as inode 106, may be structure including an inode number 106a, an object type 106b, a family identifier (ID) 106c, object extent location 106d, and possibly other information.
The inode number (#) 106a of the structure 106 associated with the file 104 may be unique with respect to other inode numbers of other inode structure instances. A different inode number may be associated with each different file system object. In this manner, an inode number may be used to uniquely distinguish among different inodes and file system objects. In at least one embodiment, an additional mapping may be maintained that maps each LUN to its corresponding inode number where the additional mapping may be used, for example, in servicing I/Os directed to a particular LUN and LBA (logical block address).
The object type 106b may denote the particular type of file system object associated with the inode structure 106. For example, as noted elsewhere herein, inode types in one embodiment may include a file and a directory. In this example 100, the inode 106 is of type file denoting the file 104 used to implement the LUN 101 as a file system object in the file system 102.
The family ID 106c may be a unique ID associated with the LUN and all its associated related logical objects or related file system objects. For example, in at least one embodiment, a snapshot of LUN 101 may also be implemented as a second different file, file 2, in the file system 102. Although not illustrated in
The object extent location 106d may be a logical address location or offset in the file system 102's logical address space denoting the starting or base logical address for the file system object. Element 130 may denote the entire logical address range of the file system 102. In at least one embodiment, the logical address range 110 of the particular file system object 104 implementing the LUN 101 may map to a corresponding portion 130a of the file system logical address range 130. The starting or base address for LBA 0 of the LUN 101 may map to a corresponding base or starting address, such as N, within 130. In this case, the LUN's logical address space 110 is mapped to corresponding FS logical addresses N through M−1, where M denotes the last logical address in the LUN's LBA range 110. In such a case, any LBA of the LUN 101 may be mapped to a corresponding logical address in the file system logical address space 130 by adding the based logical address N. As described in more detail in following paragraphs and figures, each particular file system (FS) logical address in 130 may be mapped, using the MD (metadata) structure 108, to the data block locations storing the contents for the FS logical address. The data block locations may denote the allocated physical storage data blocks (DBs) 120 storing content for a FS logical address, such as for a FS logical address in the portion 130a for the LUN 101.
The MD mapping structure 108 may include multiple layers of MD nodes that ultimately map to data blocks (DBs) (e.g., physical storage locations) including data or contents. In at least one embodiment described in more detail herein (e.g.,
In connection with the thin LUN 101 in at least one embodiment, the first time there is a write to an LBA of the LUN's logical address space 110, there is no existing data block or physical storage mapped to the LBA. As a result, in response to the first write to the LBA, physical storage in the form of a data block may be allocated and mapped to the LUN's logical address space. In this manner, the structure 108 may map to DBs in a dynamic manner as storage is allocated responsive to first writes to LBAs in the logical address space 110 of the thin LUN 101.
Referring to
The example 200 illustrates in more detail various structures that may be mapped to the FS logical address space 130 of
The inode table 210 may be a table with an entry for each inode structure, such as the structure 106. As illustrated in the example 200, the structure inode 106 is for the LUN 101 implemented as the file 104 of the file system 102. Although not explicitly illustrated, the inode table 210 may also include an entry of the inode structure for the root inode #202b. The inode structure 106 includes an inode number (#) 1106a, has an object type 106b of file, has a family ID 106 of “family ID1”, and has an object extent location 106d of A1. In this example, element 106d indicates that the base or starting offset (e.g., logical address) within the FS logical address space for LBA 0 of LUN 101 is A1. Element 130a denotes the logical address space of LUN 101 having a base logical address of A1 whereby the content or data of the LUN 101 is stored at data blocks mapped to FS logical addresses in the portion 130a.
Element 220 denotes the subrange of the FS logical address space 130, where the subrange maps to the logical address range of the LUN 101 and also where the subrange maps to the data or contents for the LUN 101. For example, assume DATA1 is stored at LUN 101, LBA 0. To obtain the contents or data stored at LUN 101, LBA 0, an embodiment in accordance with the techniques herein may determine the corresponding FS logical address for LUN 101, LBA 0, which in this example is A1. The desired LBA or offset, 0 in this case, may then be added to the base address to determine the desired FS logical address of A1. As generally described above and in more detail elsewhere herein, the FS logical address A1 may then be mapped, using the MD mapping structure 108, to the data block including the data or content stored at the FS logical address A1.
In at least one embodiment, space for the file system 102 may be provisioned in physical storage portions referred to as slices which are then mapped into the FS logical address space 130. The file system 102 may then allocate blocks of storage, such as for inodes, FS objects such as the LUN 101, and the like, as needed. Physical storage for the file system may be provisioned in slices of storage from one or more RAID (redundant array of inexpensive disks) groups. A RAID group may be characterized as a logical storage entity defined from a group of physical storage devices, such as rotating disk drives, flash-based storage devices or other forms of non-volatile back end data storage devices. Physical devices of a RAID group are logically bound together to represent contiguous data storage space for applications. A RAID group represent a logically contiguous address space distributed across a set of physical storage devices of the group. Each physical storage device is subdivided into pieces used to spread the address space of the RAID group across the group (along with parity information if applicable to the RAID level). The physically contiguous pieces of the physical storage devices that are joined together to create the logically contiguous address space of the RAID group are called stripes. Stripes may form blocks and blocks may be allocated to create logical representations of storage space for use by applications within a data storage system. Each slice may denote an amount of storage, such as 256 MB (megabytes) although any suitable size may be used.
Referring to
With reference back to
Referring to
The example 400 include storage tiers 412 (SSD tier), 414 (15K RPM tier) and 416 (10K RPM tier) comprising the PDs 410. Element 130 may denote the FS logical address space as described above, having a starting logical address, block or offset of 0, and an ending maximum logical address, MAX. The FS logical address space 130 in the example 400 is partitioned into equal logical address space portions (denoted by 402a-h) where each of the portions 402a-h is mapped to region of physical storage, also referred to as slices or segments, on the different PDs of different ones of the storage tiers of 410. Data storage system software may periodically remap portions of the FS logical address space 130 to keep the most actively used or accessed portions of 402a-n on slices of the highest performance tier 412 in efforts to maximum data storage system I/O performance. As shown in
Data that may be written to a first LBA of a LUN, such as LUN 101, that is mapped into a target logical address of the FS logical address space 103. In at least one embodiment, an additional mapping may be maintained that maps each LUN to its corresponding inode number. Using the inode structure for the LUN's inode number, the base logical address for the LUN may be determined from the object extent location field 106d whereby the target logical address in the FS logical address space 103 may be determined by adding the first LBA to the based logical address. The data written to the target logical address is then stored on the PDs, or more generally, back-end non-volatile storage devices of 410. The MD mapping structure 108 corresponding to the mapping layer 104a may be updated to reference the physical location or data block at which the data is stored where the MD mapping structure maps the data block of containing the data to the target logical address within the FS logical address space 130. More generally, any logical address of the FS logical address space 130 may be mapped by the mapping layer 104a (and thus the MD mapping structure thereof) to a data block of physical storage in 410.
When performing various data storage services or processing I/O operations that access data stored on a LUN, data read from and/or written to a LUN may be processed using the typical I/O or data path such as described herein. For example, consistent with other discussion herein, when reading data from a LUN of the data storage system, the data may be read from the LUN, stored in the cache of the data storage system, and then further read from the cache for use by one or more other components of the data storage system. For example, data may be read from a LUN in response to a read I/O from a client, such as an external host. The data may result in a cache miss wherein the requested read data is read from a backend PD and then stored in the cache. The read data stored in the cache may then be read by another component, such as a front end component that is an HA or an FA, that returns the read data from the cache to the client that issued the read I/O operation.
As noted above and elsewhere herein, the MD mapping structure 108 of the mapping layer 104a, as well as other MD (e.g., inode table 210) that may be mapped into the FS logical address space, may be used in order to access and read the associated user data stored on the LUN and thus provisioned storage from the backend PDs. For example, reading the user data stored at LUN A, LBA 5 from the PDs includes reading MD as well as user data into the cache if such MD and user data is not already located in the cache. For example, MD (e.g., portions of the MD mapping structure 108) describing the physical storage location for user data stored at LUN A, LBA 5 may be read from a backend PD and stored in the cache. Subsequently, the cached MD may be read to determine the physical storage location on a backend PD for the user data stored at LUN A, LBA 5. Processing may proceed to read such user data for LUN A, LBA 5 from the backend PD into the cache. In performing this processing, such user data and MD may remain in the cache until removed, for example, based on the particular cache management policy of the cache.
Generally, it may be desirable to keep or retain in the cache as much of the MD as possible that describes the location of where data is stored. Furthermore, a data storage system may generally attempt to store in cache as much MD as possible, where such MD may be used to map a logical address of the FS logical address space 103 to its corresponding data block. In some embodiments, there may not be a sufficient amount of cache to store all the needed MD, such as for the LUN A and other LUNs of the system, in the cache. As a result, the data storage system may store the more frequently accessed MD for the LUNs in the cache with remaining MD for the LUNs stored on the backend PDs. As may be needed such as in connection with servicing I/Os, the MD for the LUNs stored on a backend PD may be loaded into the cache. In this case, a data storage system may use a paging mechanism for paging MD into cache from PDs and for storing cached MD to the PDs in order to reduce the amount of cache consumed with storing all desired the MD. The data storage system may also use paging in connection with mapping user data stored on the PDs in and out of memory.
Paging is generally known in the art and commonly used in connection with memory management, such as for virtual memory management. In connection with virtual memory management, paging is a method of writing data to, and reading it from secondary storage, such as physical disk or other non-volatile storage, for use in primary storage, such as main memory. In a memory management system that takes advantage of paging, the operating system reads data from secondary storage in blocks or chunks that may also be referred to as pages. Since the amount of the primary storage is typically much smaller than the amount of data on secondary storage, it is not possible to store all such data in the primary storage. Thus, data may be read from secondary storage and stored in the primary storage as needed. When the primary storage no longer has available locations and another primary storage location is needed for storing new or additional data not already in primary storage, techniques may be used to select a primary storage location whereby any data in the selected primary storage location may be overwritten with the new or additional data. Prior to overwriting the selected primary storage location with the new or additional data, the current data of the selected primary storage location may be written out, as needed, to its corresponding secondary storage location (e.g., written out if the primary storage location copy is more recent or up to date than the secondary storage copy). In such a case, the current data in the selected primary location may be characterized as paged out of the primary memory (e.g., available on secondary storage but not primary storage) and the new or additional data may be characterized as paged in to the primary memory. The new or additional data is also stored on the secondary storage.
In connection with storing MD in the cache, paging may be performed in a similar manner where the primary storage is the cache and the secondary storage is the physical storage device or PDs (e.g., disk or flash-based non-volatile backend storage accessed by the DAs). Thus, MD may be retrieved from back-end PDs as needed and stored in the cache, such as for servicing read operations requesting user data associated with the MD. Once the MD is in cache, such MD may be removed from cache (e.g., evicted, removed, overwritten, paged out, and the like) as cache locations storing such MD are needed in connection with other subsequent processing. A page may refer to a single unit or amount of memory located in the cache, whereby MD stored in each page in the cache may be brought into the cache (e.g., paged into the cache) and also paged out of (e.g., evicted from) the cache as may be needed. Various techniques may be used for general cache management (e.g., eviction policy for selecting data of cache slots for removal from cache, flushing policy for determining when and/or how much write pending data to flush from cache to non-volatile storage, and the like).
In at least one embodiment, a page table may be used to map or perform address translations of a physical storage location or address of a MD page on a PD (e.g., also sometimes referred to as an on-disk address or location) to a cache address or location, if that particular MD page is currently loaded in cache. Thus, the page table may be queried to return a cache location of a desired MD page based on the physical location or address of the MD page as stored on a back-end PD. If the particular MD page having a specified physical location on a PD is not currently stored in cache, the page table will not contain any mapping to a corresponding cache location. In such a case, a read or cache miss results as described elsewhere herein. Responsive to the read or cache miss with respect to a particular MD page located at a particular on-disk address or location, processing may be performed to page in the MD page (e.g., read the MD page from physical storage of the PD and store the MD page in cache).
In some systems, multiple MD pages referencing or pointing to each other may need to be accessed in a particular order and read in a serialized manner in order to ultimately access the desired data, such as user data, referenced by the final MD page. In such a case, all the multiple MD pages need to be in cache or otherwise paged in from PDs in order to access the desired data, which may or may not also be in cache and thus may also need to be paged into the cache.
In at least one embodiment, the MD mapping structure 108 of the
Each of the MD page leaf nodes may point to, or reference (directly or indirectly) one or more pages of stored data, such as user data stored on a LUN 101. Each MD node in the tree may correspond to a MD page including MD for a logical address of the FS logical address space 130. More generally, the tree or other hierarchical structure of various MD pages may include any suitable number of levels, such as more or less than 4 levels. In at least one embodiment the tree of MD pages may be an “N-ary” tree, where “N” indicates that each node in the tree structure may have up to a maximum of N child nodes. For example, in at least one embodiment, the tree of MD pages may specify N=512 whereby each node in the tree structure may have up to a maximum of N child nodes. In at least one embodiment the MD mapping structure 600 of
Referring to
In the example 600, there are RMAX root nodes where RMAX is an integer denoting the specified number of root nodes. In at least one embodiment, RMAX may be 32,000 used to map the FS logical address space 130 that is 8 exabytes. The structure head 601 may include pointers to all RMAX MD root nodes. The root level, level 1, includes MD pages 602a-602b denoting the RMAX root nodes. Each root node, such as 602a, has its own subtree of nodes at lower levels. For simplicity of illustration,
As also illustrated in the example 600, each of the leaf MD pages in level 4 of the entire tree structure points to, or references (e.g., directly or otherwise indirectly using one more additional levels of indirection of pointers not illustrated), data blocks (e.g., pages of data stored on the LUN 101). For example, MD leaf page 614a points or references, respectively, data blocks 624a. In at least one embodiment, each MD leaf node may be mapped to 512 data blocks using an intervening layer referred to as a virtualization layer of blocks (VLBs). Each of the 512 pointers in a single MD leaf may point to a different VLB that further points to a data block. The intervening VLBs may be used, for example, to relocate the underlying data blocks, facilitate data reduction techniques where two MD leafs may point to the same VLB identifying the shared data block, and the like.
Elements 624a-624p may each denote a set or group of data blocks. In such an embodiment in which each MD leaf points to 512 data blocks, where each data block is 4 KB and each MD block of the different layers or levels of 600 includes 512 child nodes, then each MD root node describes 256 TB of logical space, each MD top node describes 512 GB of logical space, each MD mid node describes 1 GB of logical space and each MD leaf node describes 2 MB of logical space.
Referring to
Referring back to
In at least one embodiment, each of the addresses or pointers included in a MD page may reference another MD page or reference a data block, where each such address or pointer may reference a physical storage location on the back-end PDs. Consistent with discussion elsewhere herein, a page table may be used to map each such on-disk address or pointer included in a MD page to a corresponding cache location or address, if the particular MD page is currently stored in cache. Thus, the traversal between connected nodes of the structure 300 may correspond to traversing physical address or storage locations included in pages or nodes that are parent nodes.
In connection with accessing a particular data block in at least one embodiment, all MD pages in a path from the root of the tree to the data block may be required to be traversed in a consecutive serialized order in which such pages appear in the path traversal down the path from the root level to the data block accessed using a particular one of the MD page leaf nodes. For example, assume data block X is included in the set of one or more data blocks 624a. In order to access data block X of 624a, the following denotes the consecutive serialized order in which the MD pages forming a sequence are accessed: MD page root1602a, MD page top 604a, MD page midi 608a, and MD page leaf1614a. Generally, in at least one embodiment, each of the MD pages may include pointers or addresses to locations of one or more child pages or nodes. Thus, the foregoing traversal of MD pages denotes the sequence of MD pages that are processed in consecutive serialized order in order to access the particular data block, such as data block X. In order to access the data block X as stored on PDs where data block X includes first data needed to service an I/O operation, such as a read miss, in connection with a cache miss of the first data, each of the MD pages in the foregoing sequence (e.g., MD page root 602a, MD page top 604a, MD page midi 608a, and MD page leaf 614a) needs to be accessed in consecutive serialized order. In at least one embodiment, the sequence of MD pages, and more generally, the path from the MD root 602a to the data block X, forms a linked list of nodes or pages of the structure 600. In at least one embodiment, each parent node or MD page of the structure 600 may generally include multiple pointers or references to its child nodes or pages. For example, MD page top 604a includes pointers to its 512 child nodes, MD pages 608a-608b.
As noted elsewhere herein, the data blocks, such as 624a-h and 624i-p, may include data stored on particular logical addresses of a LUN's address space, such as the LUN A's logical address space. In at least one embodiment each MD leaf may include MD for a specified number of LBAs of a LUN. For example, in one embodiment each MD leaf may include MD for 512 LBAs, or more generally, 512 data blocks. For example, with reference to
As generally known in the art, a depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each path extending from the root to a leaf node before backtracking up the path to find a yet another unexplored path. In at least one embodiment, traversal of the structure 600 of MD pages in a depth-first manner based on a DFS explores all paths, in sequential order, from the left-most path to the right most path as arranged in the tree. In at least one embodiment, when the overall tree including all MD page root nodes of 600 and their descendant nodes is traversed in this depth first manner, the MD page leaf nodes that occur in the DFS traversal correspond to consecutive sequential LBA subranges of LUNs, or more generally, consecutive sequential LBA subranges of the FS logical address space 130.
In at least one embodiment as described herein, each of the MD pages and data blocks in the example 600 may be of a predetermined size and each of the MD pages may hold a known number of entries containing pointer or address values. In such a case and in combination with the correspondence of sequential consecutive LBA ranges of each MD leaf page, an embodiment may perform a calculation to determine the MD page at a particular level that is accessed in the tree MD mapping structure 600 to determine the data block for a particular LUN and LBA, or more generally, for any logical address of the FS logical address space. Similarly, it is a straightforward mathematical calculation to determine the index, offset of entry in a particular page or node to be accessed in connection with obtaining data blocks stored at the particular LUN and LBA. Each MD page in 600a may be known to include MD relevant for accessing data on a particular LUN and one or more LBAs of that LUN. For example, consistent with discussion above, element 624a denotes the data blocks for LBAs 0-511 of LUN 101. In order to access the data block for an LBA of the LUN 101 in the LBA subrange 0-511, MD pages 602a, 604a, 608a and 614a may be traversed in sequential order. In particular, the first entry or offset of the MD page root 1602a may contain the address of the MD page top 1604a; the first entry or offset of the MD page top1604a may contain the address of the MD page mid 1608a; the first entry or offset of the MD page mid 1608a may contain the address of the MD page leaf 1614a; and the first entry or offset of the MD page leaf 1614a may contain the address of the data blocks 624.
In a similar manner, a mapping may be made regarding what MD pages of the structure 600 and entries thereof are used in connection with obtaining data blocks containing data for any particular LUN and LBA, or more generally, any FS logical address. In at least one embodiment, the particular MD pages used to access a data block including data for a particular LUN and LBA may be known based on such mappings and correspondence of LBA subranges to particular MD leaf pages.
In at least one embodiment, each MD page or node in the structure 600 is associated with a consecutive subrange of logical addresses of the FS logical address space. The MD nodes at the highest level, root nodes 602a-b, map to equally sized consecutive subranges of the FS logical address space 130. Generally, the FS logical address space 130 may be partitioned into RMAX consecutive subranges each mapped to a different one of the RMAX MD page root nodes 602a-n. When the structure 600 is traversed in a depth first manner, the descendants of each MD root node will be traversed before proceeding to the next MD root node. The MD root nodes may be considered child nodes of the head structure of pointers 601 where each MD root node is traversed in a depth first manner so that MD root nodes are traversed from left to right order as in the structure 600. Collectively, all the MD nodes at each level are associated with and used in mapping the entire FS logical address space 130
Generally, each child MD node is associated with a consecutive subrange of logical addresses of its parent MD node. In particular the logical address subrange of the parent MD node is partitioned into N equal number of consecutive logical address subranges where N denotes the number of child nodes. When the N child nodes are traversed in a particular order accordance with a depth first traversal of the structure 600, the N logical address subranges may be appended or concatenated in the particular order in which the N child nodes are visited to collectively form a larger logical address range of consecutive contiguous logical addresses.
Consider a simple example with reference to
The example 300 includes MDs page of the structure 600 as noted above with 4 levels. In the example 300, the root level 1 includes MD page 301; the top level, level 2, includes MD page 302; the mid level, level 3, includes MD pages 304, 306 and 308; and the bottom level, level 4, includes MD pages 310, 312, 314, 316, 318 and 320, which may also be referred to as leaf nodes. As also illustrated in the example 300, each of the leaf MD pages in level 4 of the tree points to, or references (e.g., directly or otherwise indirectly using one more additional levels of indirection of pointers not illustrated) data blocks (e.g., pages of data stored on the LUN B). For example, MD pages 310, 312, 314, 316, 318 and 320 point or reference, respectively, data block groups 310a, 312a, 314a, 316a, 318a and 320a.
The links or connections between a parent node (at level M) and its one or more child nodes (at level M+1) in the tree 300 generally represent mappings between the parent node and the one or more child nodes. In at least one embodiment, the parent node may include a reference used to access (directly or indirectly) each of its one or more child nodes. For example, the top node MD page top 302 may include addresses or pointers used to access each of its child nodes 304, 306 and 308. The mid-level node MD page midi 304 may include addresses or pointers used to access each of its child leaf nodes 310, 312. The mid-level node MD page mid1306 may include addresses or pointers used to access each of its child leaf nodes 314, 316. The mid-level node MD page mid1308 may include addresses or pointers used to access each of its child leaf nodes 318, 320.
In at least one embodiment, each of the addresses or pointers included in a MD page that references a location in another MD page or references a location of a data block may be a physical storage location on the back-end PDs. Consistent with discussion elsewhere herein, a page table may be used to map each such on-disk address or pointer included in a MD page to a corresponding cache location or address, if the particular MD page is currently stored in cache. Thus, the traversal between connected nodes of the structure 300 may correspond to traversing physical address or storage locations included in pages or nodes that are parent nodes.
In connection with accessing a particular data block in at least one embodiment, all MD pages in a path from the root or top level of the tree to the data block may be required to be traversed in a consecutive serialized order in which such pages appear in the path traversal down from the top or root level to the data block accessed using a particular one of the MD page leaf nodes. For example, assume a data block in 312a is to be accessed. In order to access the data block in 312a, the following denotes the consecutive serialized order in which the MD pages forming a sequence are accessed: MD page top 302, MD page midi 304, and MD page leaf2312. Generally, in at least one embodiment, each of the MD pages may include pointers or addresses to locations in one or more child pages or nodes. Thus, the foregoing traversal of MD pages denotes the sequence of MD pages that are processed in consecutive serialized order in order to access the particular data block. In order to access a data block, such as data block K, of 312a as stored on PDs where data block K of 312a includes first data needed to service a read I/O operation in connection with a cache miss of the first data, each of the MD pages in the foregoing sequence (e.g., MD page top 302, MD page midi 304, and MD page leaf2312) needs to be accessed in consecutive serialized order. In at least one embodiment, the sequence of MD pages, and more generally, the path from the MD page top to the data block K, forms a linked list of nodes of pages. In at least one embodiment, each parent node or MD page of the structure 300 may generally include multiple pointers or references to locations of its child nodes or pages. For example, MD page top 302 includes pointers to locations of its child nodes, MD pages 304, 306 and 308. MD page mid2306 includes pointers to locations of its child nodes, MD pages 314 and 316.
As noted elsewhere herein, the groups of data blocks 310a, 312a, 314a, 316a, 318a and 320a include data stored on particular logical addresses of a LUN's address space, such as the LUN B's logical address space. In at least one embodiment each MD leaf may hold MD for a specified number of LBAs of a LUN. For example, in one embodiment each MD leaf may hold MD for 512 LBAs. For example, with reference to
Each parent node is associated with, and used in determining data blocks, for the consecutive LBA subranges of its child nodes. For example, in
Continuing with the above example with respect to LUN B, MD page 304 includes 2 pointers to its child MD nodes 310 and 312, where MD page 304 is traversed when mapping LBAs 0-1023 of LUN B. MD page 306 includes 2 pointers to its child MD nodes 314 and 316, where MD page 304 is traversed when mapping LBAs 1024-2047 of LUN B. MD page 308 includes 2 pointers to its child MD nodes 318 and 320, where MD page 308 is traversed when mapping LBAs 2048-3071 of LUN B. MD page 302 includes 3 pointers to its child MD nodes 304, 306 and 308 where MD page 302s traversed when mapping LBAs 0-3071 of LUN B. In this manner, each MD node or page may include a table or list of entries of pointers to its children and, based on the logical address for which content is to be obtained, the particular entry of each MD node or page may be accessed where the entry points to the on-disk location of the next MD page in the path or points to the data block to be accessed. For example, the data block containing the data for LBA 1026 may be located by traversing MD page top 302, MD page Mid2306, and MD page leaf3314.
Depth first traversal of the nodes in the example 300 are as follows: 301, 302, 304, 310, 310a, 310b, 312, 312a, 312b, 306, 314, 314a, 316, 316a, 308, 318, 318a, 320, and 320a. When performing such a depth first traversal, the sequential order in which the MD leaf nodes are accessed forms a contiguous range of logical block addresses (e.g., the subranges of consecutive logical blocks for MD leaf nodes 310, 312, 314, 316, 318 and 320 are appended or concatenated in order of access in the depth first traversal to form the contiguous range of logical addresses 0-3072 for the LBAs of LUN B.
It should be noted that although the example 7 illustrates a single MD page top node mapping to LBAs of a single LUN, generally, the LBA range of a single LUN may map to any suitable number of MD pages. For example, multiple LUNs may have their LBAs mapped into the FS logical address subrange associated with a single MD top node. In such an embodiment, each LUN may have an associated LBA range and thus capacity that is at least the size of the LBA range associated with a single MD mid node. In at least one embodiment, a single LUN may have its LBAs of the LUN logical address range span multiple MD page top nodes.
Consistent with discussion above and with reference back to
In one aspect, the MD mapping structure (e.g., such as illustrated in
If information of an inode associated with a file system object is lost or corrupted, such as where one or more entries of the inode table 210 may become corrupted, the object extent location of the inode used to determine and access the MD location information, and thus determine and access the data blocks of the file system object, may be corrupted. Thus, if the information of an inode is corrupted, recovery of the data associated with the inode (e.g., data or content of the file system object associated with the inode) may be difficult or not possible depending on the particular recovery method and information used.
In at least one embodiment in accordance with the techniques herein, processing may be performed to protect inode information of the inode table. Information for each MD top page or node may be maintained and stored for example on non-volatile storage. In at least one embodiment, a shadow top structure may be created for each MD top node or page in the MD mapping structure, such as of
Referring to
The shadow top structure 710 may include an entry for each pointer or entry of a MD top node. For example with reference to
For example, with reference to
Any suitable technique may be used to determine the location of a particular shadow top structure for a corresponding MD top. Similarly, any suitable technique may be used to determine the location of a MD top for a corresponding shadow top structure.
In at least one embodiment with reference back to
In at least one embodiment, the location or address (e.g., on-disk location) of the shadow top block including information describing a particular MD top node may be mathematically determined. For example a function may mathematically map or determine the address or location of the shadow top block describing a particular MD top node N. For example, a table or list 810 of shadow top structures as illustrated in the
In at least one embodiment, the shadow top structures, such as those structures of the table or list 810 of
If an inode structure of a particular file system object, such as a file used to implement a LUN, is corrupted, erased, lost or otherwise unreadable, information in the shadow top structures in the table 810 may be used to determine, for each MD top node and its associated shadow top structure, the particular MD pointers to MD mid nodes describing each inode number. For example, assume that MD top 604a describes MD used to determine data blocks for only a single LUN, LUN 101 with inode #=1 where each entry of the shadow top structure for MD top node 604a includes the inode # and family ID for LUN 101. Assume the entry 1, 810a, of the table 810 includes the shadow top structure for MD top node 604a. Traversal of the other shadow top structures in the shadow top table 810 would determine that only the shadow top entry 1810a (the shadow top structure for MD top node 604a) includes inode #1 in all 512 entries of the structure 810a. In this case, processing may determine that the inode #1 has its data located at logical addresses of the FS logical address space that are associated with the particular MD pointers to MD mid nodes in the 512 entries of the shadow top structure 810a. Examination of the inode table determines that the inode structure for inode=1 is missing and may use the above-noted information to determine, recover and reconstruct, for example, the family ID 106c and the object extent location 106d for the inode=1. In at least one embodiment, remaining missing information of the inode structure for inode=1 may be possibly be determined from other sources of saved information. For example, an embodiment may store a list mapping LUNs to associated inode numbers. Such a list may be used to determine which inode numbers are of type file and used to determine the object type 106b as type file for inode=1.
In a manner similar to that as described above with respect to the LUN 101, information in the shadow top structures in the table 810 may be used to determine, for each MD top node and its associated shadow top structure, the FS logical addresses of 130 associated with the particular MD pointers to MD mid nodes describing each inode number.
Referring to
At the step 902, one or more file system objects are created in a file system having an FS logical address space. The file system objects may include files and/or directories. A LUN may be implemented as a file of the file system. For each object created, an inode structure is also created in the inode table. Each inode structure for a particular file system object may include an object extent location, an inode # and family ID. The inode # may be associated with the particular file system object. The object extent location may identify a first offset, location or logical address in the FS logical address space identifying a base logical address for data or contents of the particular file system object. The file system object's logical address space may be mapped into the FS logical address space where the base logical address may be added to each logical offset within the object's logical address space. The inode structures of the file system objects may be mapped into the FS logical address space. From the step 902, processing proceeds to the step 904.
At the step 904, processing may be performed that stores or write data to one or more of the file system objects created in the step 904. The step 904 may include receiving write and/or read operations issued to various LBAs or offsets in the LUN implemented as the file of the file system. The file, and thus the LUN, may have the write data stored at the various LBAs or offsets of the logical address space of the file (more generally file system object). The file's logical address space may be mapped into the FS logical address space where the base logical address for the file implementing the LUN is added to each logical offset within the LUN's logical address space. The base logical address is identified by the LUN's object extent location in the inode structure for the LUN. Each write to a target location denoted as an LBA of the LUN may be mapped to a corresponding logical address in the FS logical address space. The corresponding logical address in the FS logical address space may be mapped, using a MD mapping structure, to a storage location used to store the write data. The storage location may be an on-disk location. For read operations that alternatively read data from the corresponding logical address, the corresponding logical address may be used to retrieve currently stored data from the on-disk location. The MD mapping structure may include multiple layers or levels of MD nodes. The corresponding logical address may be used to determine a traversed ordered path in the MD mapping structure from a root MD node to a data block where data is stored for the corresponding logical address. From the step 904, control proceeds to the step 906.
At the step 906, processing is performed to create a table or list of shadow top structures. The table or list includes one shadow top structure for each MD top node in the MD mapping structure used to determine storage locations or addresses of data blocks stored at corresponding logical addresses and used to access the data blocks stored at the corresponding logical addresses. The logical addresses may be in the FS logical address space of the file system. Each MD top node is used in determining storage locations for content stored at a specified contiguous subrange of logical addresses of the FS logical address space. The shadow top structure for an MD top node may include the inode # and family ID of each object mapped to, or having data stored at, a logical address included the specified contiguous subrange of the MD top node. From the step 906, control proceeds to the step 910.
At the step 910, an inode structure of the inode table is corrupted or contains invalid data. For example, at least one of the inode number, object extent location and family ID of an inode structure may be corrupted. From the step 910, control proceeds to the step 912.
At the step 912, The table or list of shadow top structures is used to recover information of the corrupted inode structure. The table or list of shadow top structures may be traversed to determine first information identifying what FS logical addresses associated with each of the MD top nodes are mapped to each of the different inode #'s. From the first information, a subrange of FS logical address space may be identified for each inode # where the subrange denotes the portion of the FS logical address space mapped for storing data of a file system object having the inode #. From the first information, the starting or base address of the subrange for each inode # may denote the object extent location of the inode #. The family ID for each inode # may be determined from the information of the shadow top structures of the list. From the foregoing processing performed using the shadow top structures, a temporary set of inode structures may be constructed. The temporary set may be compared to the existing inode table and used to update the inode table, as needed. Any missing or invalid information in the existing inode table may be replaced with corresponding information of the temporary set. The existing information in the inode table may also be compared to the temporary set to determine inconsistencies. Any suitable processing may be performed responsive to detecting inconsistencies. For example, a user may be prompted regarding the detected inconsistency and may select whether to update the existing information to include any information of the temporary set.
In the step 912, processing is performed to recover information of a corrupted inode structure. More generally, the information extracted or derived from the table of shadow top structures may be used for recovery or inconsistency checking with respect to other MD that may be used in connection with the file system. For example, the logical address range for each inode number may be determined where, as noted above, the starting or base logical address is the object extent location for the inode number. The logical address range information may also be used to recover, for example other MD information that may be related to the particular file system object having the inode number. For example, other MD may be stored in other file system structures regarding the size of the logical address range mapped to the file system object having the inode number, whether there is currently storage allocated or mapped to particular logical addresses, and the like.
The techniques herein may be performed by any suitable hardware and/or software. For example, techniques herein may be performed by executing code which is stored on any one or more different forms of computer-readable media, where the code may be executed by one or more processors, for example, such as processors of a computer or other system, an ASIC (application specific integrated circuit), and the like. Computer-readable media may include different forms of volatile (e.g., RAM) and non-volatile (e.g., ROM, flash memory, magnetic or optical disks, or tape) storage which may be removable or non-removable.
While the invention has been disclosed in connection with embodiments shown and described in detail, their modifications and improvements thereon will become readily apparent to those skilled in the art. Accordingly, the spirit and scope of the present invention should be limited only by the following claims.