Memory controller for recovery of file-system to any point-in-time and method thereof
The memory controller optimizes file system recovery by selecting the shortest path to a desired PIT using snapshot technology, reducing recovery time and improving efficiency.
Patent Information
- Application Number
- PCT/EP2023/079947
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2025-05-01
AI Technical Summary
Existing file system recovery methods are inefficient as they require applying all changes from the initial backup time to a specific Point-In-Time (PIT), which is time-consuming and dependent on the number of changes, especially when using snapshot technologies.
A memory controller configured to perform snapshots and store indications of modifying operations, allowing it to determine the shortest path to a desired PIT by selecting either a preceding or succeeding snapshot, and applying changes in reverse or forward order accordingly.
This approach significantly reduces the recovery time of a file system by applying a small number of changes, enabling fast and efficient recovery to any PIT.
Smart Images

Figure EP2023079947_01052025_PF_FP_ABST
Abstract
Description
[0001] MEMORY CONTROLLER FOR RECOVERY OF FILE-SYSTEM TO ANY POINTIN-TIME AND METHOD THEREOF
[0002] TECHNICAL FIELD
[0003] The disclosure generally relates to file system management, and more particularly, the disclosure relates to a memory controller configured to provide a recovery of a file system to any Point-In-Time, PIT. The disclosure also relates to a method for the memory controller configured to provide the recovery of the file system to any Point-In-Time, PIT.
[0004] BACKGROUND
[0005] A file system is a method and data structure used by Operating Systems, OS to manage data storage and retrieval. Without the file system, data placed in a storage medium would be one large body of data with no way to differentiate where one piece of data ends and another begins, or where any piece of data is located when it needs to be retrieved. The file system plays a major role in naming, arranging, storing, and retrieving of files. The file system is essential for both isolating and effectively locating stored information. As data capacities increase, organizing and accessing individual files becomes even more important in data storage. Digital file systems are modelled after traditional paper-based filing systems and vary between Operating Systems, OS, including Windows, macOS, and Linux. The OS is a system software that manages computer hardware and software resources and provides common services for computer programs. The file systems may include various types, including distributed file systems, disk-based file systems, and special-purpose file systems. Also, the file systems can be designed for specific applications. The file system is configured to store and organize data and act as an index for all the data in a storage device like hard drives, optical drives, or flash drives. The file system sets rules for naming files, specifying maximum character limits, allowed characters, and case sensitivity in few cases. In addition to the file itself, the file system includes crucial data like file size, attributes, location, and hierarchy in the directory in the metadata. The metadata can also indicate available storage space on the drive, providing insights into the storage capacity.
[0006] The file system includes a format for specifying the path to the file through the structure of directories. Files are placed in a directory or a folder in Windows OS, or subdirectory at a desired place in a tree structure of the directory. The OS has the file systems where the files are hierarchically placed in the tree structure. Before the files and the directories can be established on the storage medium, partitions need to be created. The partitions are distinct regions of the storage device or other storage disks managed independently by the OS. A primary partition typically houses one file system, while certain OS permits multiple partitions on a single storage space. In such a scenario, if one file system becomes corrupted within one partition, the data in another partition remains safe.
[0007] The file systems rely on the metadata to store and retrieve the files. The metadata includes information like date created, date modified, last access date, last backup, user ID of the file creator, access permissions, and file size. The metadata is stored separately from the contents of the file, with many file systems storing file names in separate directory entries. Certain metadata may be stored within the directory, while other metadata is kept in a structure called an inode. In Unix-like operating systems, the inode can store the metadata unrelated to the file's content, indexing information by a number that allows access to the file's location and content. An example of the file system that leverages the metadata is OS X, which is the OS used by Apple, that permits the use of file names containing up to 255 characters.
[0008] The file systems can also impose restrictions on read and write access to specific user groups, typically using passwords. Such access control helps to manage and limit data modification by controlling who can read or modify files. File permissions, such as access or capability control lists, offer additional methods to regulate file system access. These types of file permissions are effective in preventing access to regular users, but may not be as effective against external intruders. Thereby, encrypting files can also be used to restrict user access, primarily safeguarding against external threats. Encryption keys are used to encrypt or decrypt the files and only users with the key can access the file. The file systems do not need to be aware of the encryption key to effectively manage the data.
[0009] A journaling file system is one type of the file system that keeps track of changes that haven't been committed to the main part of the file system by recording a goal of the changes in a data structure i.e. a journal. The journal, which is a circular log, is capable of bringing the file system back online quickly with a reduced risk of corruption in case of a system crash or power failure. Depending on the implementation, the journaling file system may track only metadata, which can enhance performance but potentially increase the risk of data corruption. Alternatively, the journaling file system may track both stored data and related metadata, and some implementations offer flexibility in this regard. FIG. 1A is a first exemplary implementation 100A for a Point-In-Time, PIT, recovery of a backup file system 102A using a common approach according to prior art. The PIT provides an option to restore application data to its state at any time since the base backup was taken. The PIT recovery provides additional insurance against logical data corruption. The backup file system 102A sequentially applies all changes, one by one, from the initial backup time up to the exact PIT. For example, to restore the file system to time 180, i.e. point-in-time file system at tl 80 104A, the backup file system 102A must apply all 180 changes, starting from the very beginning. The primary drawback of this backup file system 102A is constraining as a recovery time depends on a number of changes based on the log size to be applied on the recovered file system.
[0010] FIG. IB is a second exemplary implementation 100B of a Point-In-Time, PIT, recovery of a backup file system 102B using an internal snapshots approach according to prior art. The exemplary implementation 100B implements a background process that periodically processes the log once-in-a-while (e.g., every day) and generates snapshots of the backup file system 102B, i.e. an internal snapshot 1 106A, and an internal snapshot 2 106B. The snapshots, the internal snapshot 1 106A, and the internal snapshot 2 106B serve as recovery points, allowing the recovery process to commence from the nearest snapshot instead of starting from the initial backup. However, the exemplary implementation 100B limits the maximum log size that needs to be applied during recovery to the time elapsed between two consecutive snapshots the internal snapshot 1 106A, and the internal snapshot 2 106B. Although the number of actual changes within this time interval is not strictly limited, the snapshot interval can also be adjusted based on size to ensure that it remains manageable. For example, the number of changes between the backup file system 102B and the internal snapshot 1 106A may be 1-100 operations, and the number of changes between the internal snapshot 1 106A and the internal snapshot 2 106B may be 101-200 operations. The internal snapshot 1 106A may be a timestamp tlOO, and the internal snapshot 2 106B may be a timestamp t200. For example, to restore the file system to time tl 80, the first closest snapshot to the time tl 80 is identified, and then the changes from the snapshot time are applied for the restoration. For example, the first closest snapshot may be the internal snapshot 1 106A at tlOO, where the backup file system 102B makes the changes from the time tlOl to the time tl 80 for the restoration, which results in applying 80 changes from the first closest snapshot.
[0011] The primary drawback of the exemplary implementation 100B is that the size of the log may be bounded by the time between two consecutive snapshots, which may take a lot of recovery time. For instance, if the snapshot interval is set to one day, the backup file system 102B would involve applying changes spanning nearly one full day to achieve the desired PIT for the file system.
[0012] Therefore, there arises a need to address the aforementioned technical problem / drawbacks of providing a recovery of the file system utilizing a snapshot technology.
[0013] SUMMARY
[0014] It is an object of the disclosure to provide a memory controller configured to provide recovery of a file system to any Point-In-Time, PIT, and a method for a memory controller configured to provide recovery of a file system to any PIT while avoiding one or more disadvantages of prior art approaches.
[0015] This object is achieved by the features of the independent claims. Further, implementation forms are apparent from the dependent claims, the description, and the figures.
[0016] According to a first aspect, there is provided a memory controller configured to provide a recovery of a file system to any Point-In-Time, PIT, utilizing a snapshot technology. The memory controller is configured to perform one or more snapshots and to store indications of modifying operations performed on the file system between the one or more snapshots of the memory. The memory controller is further configured to receive an indication that a recovery is to be performed for a recovery PIT. The memory controller is further configured to determine a preceding snapshot. The preceding snapshot is a closest snapshot preceding the recovery PIT. The memory controller is further configured to determine if there is a succeeding snapshot. The succeeding snapshot is the closest snapshot succeeding the recovery point-in-time, and if so, the memory controller is configured to (i) determine a first length of a path of modifying operations from the preceding snapshot to the recovery PIT, (ii) determine a second length of the path of modifying operations from the succeeding snapshot to the recovery PIT, (iii) determine that the time stamp for the succeeding snapshot is closer to the recovery PIT than the preceding time stamp, if the second length is shorter than the first length, and if so, the memory controller is configured to (a) set a file system view according to the succeeding snapshot as a temporary file system view, (b) iterate for each stored indication of a modifying operation performed on the memory between the recovery PIT and the time stamp for the succeeding snapshot, (c) determine a reverse operation and perform the reverse operation(s) in a reverse order on the temporary file system view starting with the reverse operation for the stored indication closest prior to the succeeding snapshot and ending with the reverse operation for the stored indication closest after the recovery PIT. The memory controller is further configured to set the temporary file system view as the backed-up file system.
[0017] Shortest path to the desired PIT either from the preceding snapshot or the succeeding snapshot is selected with the memory controller, which enables log of changes to apply in (i) a reverse order when using the succeeding snapshot, and (ii) a forward order if there is no succeeding snapshot or if a timestamp for the succeeding snapshot is not closer to the recovery PIT than the preceding time stamp. The path can be significantly shorter, which enables the file system to recover fast to any PIT, and reduces the recovery time of the file system. The memory controller is configured to apply a small number of changes by detecting the shortest path instead of applying all the changes from the preceding snapshot time. The memory controller is configured to recover the file system to any PIT quickly and efficiently. The memory controller is configured to query the available recovered PIT, and the available internal snapshots. The recovery time can also be measured by selecting the last PIT before some snapshot. All the file system operations need to be collected to recover into any PIT. Consequently, the memory controller seamlessly integrates into any kind of technique for collecting the file system operations (e.g., interception). The memory controller may use Continuous Data Protection, CDP, to save all the file system operations.
[0018] Optionally, the memory controller is further configured to recover the memory for the recovery PIT based on the preceding snapshot as per the snapshot technology if there is no succeeding snapshot or if the time stamp for the succeeding snapshot is not closer to the recovery PIT than the preceding time stamp.
[0019] Optionally, the modifying operation relates to a metadata change.
[0020] Optionally, the modifying operation relates to a file data change.
[0021] Optionally, the memory controller is further configured to determine the reverse operation for the modifying operation that relates to a data change by initializing a linked-list for unresolved operations. Each entry indicates an operation and a data block on which the operation is to be made, when iterating over the indications of modifying operations from the time stamp for the succeeding snapshot down to the recovery PIT in the reverse order to determine the reverse operation for each modifying operation relating to the data change includes appending the modifying operation to the linked-list of unresolved operations. The memory controller is further configured to again iterate over the indications of modifying operations from the time stamp for the succeeding snapshot down to the recovery PIT in the reverse order to determine if the modifying operation relates to the data change and if so, copy the data for the modifying operation into the temporary file system and remove the modifying operation from the unresolved linked list. The memory controller is further configured to iterate over the entries in the unresolved linked-list and for each modifying operation. The memory controller is further configured to copy the data for the related data block from the preceding snapshot into the temporary file system. The memory controller is further configured to remove the modifying operation from the unresolved linked-list.
[0022] Optionally, the memory controller is further configured to initialize a change map. The memory controller is further configured to add a key of the modifying operation into the change map. The key includes inode and offset for the data block related to the modifying operation. When iterating over the modifying operations relating to data changes, the memory controller is further configured to determine whether the key for the modifying operation relating to the data changes exists in the change map, and if so the memory controller is further configured to copy the data inside the modifying operation into the temporary file system, the memory controller is further configured to remove the key from the change map, and the memory controller is further configured to remove the modifying operation from the unresolved linked-list.
[0023] Optionally, the change map is a hash map.
[0024] Optionally, the memory controller is further configured to determine the second length by applying a weighting multiplier to the length. The weighting multiplier is determined based on the number of modifying operations in the path of modifying operations from the succeeding snapshot to the recovery PIT.
[0025] Optionally, the weighting multiplier is determined based on the number of modifying operations related to the data change in the path of modifying operations from the succeeding snapshot to the recovery PIT.
[0026] Optionally, the weighting multiplier is determined based on a type of the modifying operation related to the data change in the path of modifying operations. According to a second aspect, there is provided a method for a memory controller configured to provide a recovery of a file system to any Point-In-Time, PIT, utilizing a snapshot technology. The method includes performing one or more snapshots of the file system. The method includes storing indications of modifying operations performed on the file system between the one or more snapshots of the memory. The memory controller is further configured to receive an indication that a recovery is to be performed for a recovery PIT. The memory controller is further configured to determine a preceding snapshot, the preceding snapshot is the closest snapshot preceding the recovery PIT. The memory controller is further configured to determine if there is a succeeding snapshot. The succeeding snapshot is the closest snapshot succeeding the recovery PIT, and if so the memory controller is configured to (i) determine a first length of a path of modifying operations from the preceding snapshot to the recovery PIT, (ii) determine a second length of a path of modifying operations from the succeeding snapshot to the recovery PIT, (iii) determine that the time stamp for the succeeding snapshot is closer to the recovery PIT than the preceding time stamp if the second length is shorter than the first length, and if so, the memory controller is configured to (a) set a file system view according to the succeeding snapshot as a temporary file system view, (b) iterate for each stored indication of a modifying operation performed on the memory between recovery PIT and the time stamp for the succeeding snapshot, (c) determine a reverse operation and perform the reverse operation(s) in reverse order on the temporary file system view starting with the reverse operation for the stored indication closest prior to the succeeding snapshot and ending with the reverse operation for the stored indication closest after the recovery PIT. The memory controller is further configured to set the temporary file system view as the backed-up file system.
[0027] Shortest path to the desired PIT either from the preceding snapshot or the succeeding snapshot is selected with the memory controller of this method, which enables log of changes to apply in (i) a reverse order when using the succeeding snapshot, and (ii) a forward order if there is no succeeding snapshot or if the time stamp for the succeeding snapshot is not closer to the recovery PIT than the preceding time stamp. The path can be significantly shorter, which enables the file system to recover to any PIT fast, and reduces the recovery time of the file system. The memory controller of this method is configured to apply a small number of changes by detecting the shortest path instead of applying all the changes from the preceding snapshot time. The memory controller of this method is configured to recover the file system into any PIT quickly and efficiently. The memory controller of this method is configured to query the available recovered PIT and the available internal snapshots. The recovery time can also be measured by selecting the last PIT before some snapshots. All the file system operations need to be collected to recover into any PIT. Consequently, the memory controller seamlessly integrates into any kind of technique for collecting the file system operations (e.g., interception). The memory controller may use Continuous Data Protection, CDP, to save all the file system operations.
[0028] According to a third aspect, a computer program product includes program instructions for performing the method when executed by one or more processors in a memory system.
[0029] Therefore, in contradistinction to the existing solutions, the memory controller is configured to provide a recovery of a file system to any PIT, utilizing a snapshot technology. The memory controller minimizes the recovery time of the file system by selecting the shortest path into the desired PIT either from the preceding snapshot or from the succeeding snapshot.
[0030] These and other aspects of the disclosure will be apparent from the implementation(s) described below.
[0031] BRIEF DESCRIPTION OF DRAWINGS
[0032] Implementations of the disclosure will now be described, by way of example only, with reference to the accompanying drawings, in which:
[0033] FIG. 1A is a first exemplary implementation of a Point-In-Time, PIT, recovery of a backup file system using a common approach according to prior art;
[0034] FIG. IB is a second exemplary implementation for a Point-In-Time, PIT recovery of a backup file system using an internal snapshots approach according to prior art;
[0035] FIG. 2 is a block diagram that illustrates a memory controller configured to provide a recovery of a file system to any Point-In-Time, PIT, utilizing a snapshot technology in accordance with an implementation of the disclosure;
[0036] FIG. 3A illustrates an exemplary implementation of recovery of a file system in accordance with an implementation of the disclosure;
[0037] FIG. 3B illustrates an exemplary implementation of modifying operations relating to data changes in accordance with an implementation of the disclosure; FIG. 3C illustrates an exemplary table of an inode for a data block related to a modifying operation in accordance with an implementation of the disclosure;
[0038] FIGS. 4A-4D are flow diagrams that illustrate a method for a memory controller configured to provide a recovery of memory storing a file system to recovery Point-In-Time, PIT, utilizing a snapshot technology in accordance with an implementation of the disclosure; and
[0039] FIG. 5 is an illustration of a computer system (e.g., a memory controller) in which the various architectures and functionalities of the various previous implementations may be implemented.
[0040] DETAILED DESCRIPTION OF THE DRAWINGS
[0041] Implementations of the disclosure provide a memory controller configured to provide a recovery of a file system to any Point-In-Time, PIT, a method for a memory controller configured to provide a recovery of a file system to any PIT, and pre-requisite of collecting all the file system operations including interception of the file system operations.
[0042] To make solutions of the disclosure more comprehensible for a person skilled in the art, the following implementations of the disclosure are described with reference to the accompanying drawings.
[0043] Terms such as "a first", "a second", "a third", and "a fourth" (if any) in the summary, claims, and foregoing accompanying drawings of the disclosure are used to distinguish between similar objects and are not necessarily used to describe a specific sequence or order. It should be understood that the terms so used are interchangeable under appropriate circumstances, so that the implementations of the disclosure described herein are, for example, capable of being implemented in sequences other than the sequences illustrated or described herein. Furthermore, the terms "include" and "have" and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, a method, a system, a product, or a device that includes a series of steps or units, is not necessarily limited to expressly listed steps or units but may include other steps or units that are not expressly listed or that are inherent to such process, method, product, or device. Definitions:
[0044] File System snapshot: The file system snapshot is a comprehensive and static representation of the entire file system operations at the snapshot time.
[0045] File System change: The File system change represents a single file system operation that, when executed, transitions the file system from its current stable state to a new stable state. Examples of file system operations: (i) writing data into the file system; (ii) creating a new directory in the file system; (iii) modifying file attributes; and (iv) removing a file / directory from the file system, etc.
[0046] Data block: The data block represents a sequence of bytes in the file system, starting from a specific offset and extending for a specified length of nbytes.
[0047] Log: The log is a record that keeps track of every modification made to the file system., for example, (i) updating the file’s inode, and (ii) writing new data into a disk.
[0048] FIG. 2 is a block diagram 200 that illustrates a memory controller 204 configured to provide a recovery of a file system 202 to any Point-In-Time, PIT, utilizing a snapshot technology in accordance with an implementation of the disclosure. The memory controller 204 is configured to perform one or more snapshots and to store indications of modifying operations performed on the file system 202 between the one or more snapshots of the memory. The memory controller 204 is further configured to receive an indication that a recovery is to be performed for a recovery PIT. The memory controller 204 is further configured to determine a preceding snapshot, the preceding snapshot is the closest snapshot preceding the recovery PIT. The memory controller 204 is further configured to determine if there is a succeeding snapshot. The succeeding snapshot is the closest snapshot succeeding the recovery PIT, and if so the memory controller 204 is configured to (i) determine a first length of a path of modifying operations from the preceding snapshot to the recovery PIT, (ii) determine a second length of a path of modifying operations from the succeeding snapshot to the recovery PIT, (iii) determine that the time stamp for the succeeding snapshot is closer to the recovery PIT than the preceding time stamp if the second length is shorter than the first length, and if so, the memory controller 204 is configured to (a) set a file system view according to the succeeding snapshot as a temporary file system view, (b) iterate for each stored indication of a modifying operation performed on the memory between recovery PIT and the time stamp for the succeeding snapshot, (c) determine a reverse operation and perform the reverse operation(s) in reverse order on the temporary file system view starting with the reverse operation for the stored indication closest prior to the succeeding snapshot and ending with the reverse operation for the stored indication closest after the recovery PIT. The memory controller 204 is further configured to set the temporary file system view as the backed-up file system.
[0049] Shortest path to the desired PIT either from the preceding snapshot or the succeeding snapshot is selected with the memory controller 204, which enables log of changes to apply in (i) a reverse order when using the succeeding snapshot, and (ii) a forward order if there is no succeeding snapshot or if a timestamp for the succeeding snapshot is not closer to the recovery PIT than the preceding time stamp. The path can be significantly shorter, which enables the file system to recover to any PIT fast, and reduces the recovery time of the file system. The memory controller 204 is configured to apply a small number of changes by detecting the shortest path instead of applying all the changes from the preceding snapshot time. The memory controller 204 is configured to recover the file system 202 into any PIT quickly and efficiently. The memory controller 204 is configured to query the available recovered PIT, and the available internal snapshots. The recovery time can also be measured by selecting the last PIT before some snapshot. Consequently, the memory controller 204 seamlessly integrates into any kind of technique to backup all the file system operations (e.g., interception), and features of Continuous Data Protection, CDP can be used to backup all the file system operations applied on a primary file system.
[0050] Optionally, the memory controller 204 is further configured to recover the memory for the recovery PIT based on the preceding snapshot as per the snapshot technology if there is no succeeding snapshot or if the time stamp for the succeeding snapshot is not closer to the recovery PIT than the preceding time stamp.
[0051] Optionally, the modifying operation relates to a metadata change.
[0052] Optionally, the modifying operation relates to a file data change.
[0053] Optionally, the memory controller 204 is further configured to determine the reverse operation for a modifying operation that relates to a data change by initializing a linked-list for unresolved operations. Each entry indicates an operation and a data block on which the operation is to be made, when iterating over the indications of modifying operations from the time stamp for the succeeding snapshot down to the recovery PIT in a reverse order to determine the reverse operation for each modifying operations relating to a data change includes appending the modifying operation to the linked-list of unresolved operations. The memory controller 204 is further configured to again iterate over the indications of modifying operations from the time stamp for the succeeding snapshot down to the recovery PIT in a reverse order to determine if the modifying operation relates to a data change and if so, copy the data for the modifying operation into the temporary file system and remove the modifying operation from the unresolved linked list. The memory controller 204 is further configured to iterate over the entries in the unresolved linked-list and for each modifying operation. The memory controller 204 is further configured to copy the data for the related data block from the preceding snapshot into the temporary file system. The memory controller 204 is further configured to remove the modifying operation from the unresolved linked-list.
[0054] Optionally, the memory controller 204 is further configured to initialize a change map. The memory controller 204 is further configured to add a key of a modifying operation into the change map. The key includes inode and offset for a data block related to the modifying operation. When iterating over the modifying operations relating to data changes, the memory controller 204 is further configured to determine whether a key for a modifying operation relating to data changes exists in the change map, and if so the memory controller 204 is further configured to copy the data inside the modifying operation into the temporary file system, the memory controller 204 is further configured to remove the key from the change map, and the memory controller 204 is further configured to remove the modifying operation from the unresolved linked-list.
[0055] Optionally, the change map is a hash map.
[0056] Optionally, the memory controller 204 is further configured to determine the second length by applying a weighting multiplier to the length. The weighting multiplier is determined based on the number of modifying operations in the path of modifying operations from the succeeding snapshot to the recovery PIT.
[0057] Optionally, the weighting multiplier is determined based on the number of modifying operations related to data change in the path of modifying operations from the succeeding snapshot to the recovery PIT.
[0058] Optionally, the weighting multiplier is determined based on a type of a modifying operation related to data change in the path of modifying operations. FIG. 3 A illustrates an exemplary implementation of recovery of a file system 302 in accordance with an implementation of the disclosure. The file system 302 is equipped with a memory controller that is configured to receive an indication that a recovery is to be performed for a recovery Point-In-Time, PIT. The exemplary implementation depicts a file system backup 304 at time tl, a recovery of the file system 302 for a recovery PIT, an internal snapshot 1 306A, and an internal snapshot 2 306B of the file system 302. The internal snapshot 1 306A may be at a time stamp tlOO including 1 to 100 operations of the file system 302, and the internal snapshot 2306B may be at a time stamp t200 including 101 to 200 operations of the file system 302. For example, if the recovery PIT is set as tl80, the internal snapshot 1 306A, may be a preceding snapshot, and the internal snapshot 2 306B, may be a succeeding snapshot. The preceding snapshot, that is the internal snapshot 1 306A is the closest snapshot at the time stamp preceding (tlOO) to the recovery PIT tl 80. The succeeding snapshot, that is the internal snapshot 2 306B is the closest snapshot at the time stamp succeeding (t200) to the recovery PIT tl 80. The internal snapshot 1 306A and internal snapshot 2 306B may represent the full state of the file system 302 at the snapshot times up to t200.
[0059] The memory controller is configured to determine a first length of a first path of modifying operations from the internal snapshot 1 306A to the recovery PIT tl 80. The first length of the first path may be from tlOO to tl 80, i.e. 80 operations. The memory controller is configured to determine a second length of a second path of modifying operations from the internal snapshot 2 306B to the recovery PIT tl 80. The second length of the second path may be from t200 to tl 80, i.e. 20 operations. The memory controller is configured to determine that a timestamp for the succeeding snapshot is closer to the recovery PIT than the timestamp for the preceding snapshot. If the second length of the second path, which is 20 operations is shorter than the first length of the first path which is 80 operations. Optionally, a file system view according to the internal snapshot 2 306B can be set as a temporary file system view. The memory controller is configured to iterate for each stored indication of the modifying operation performed on the memory between the recovery PIT tl 80, and the time stamp t200 for the succeeding snapshot, i.e. the internal snapshot 2 306B. The memory controller is configured to determine a reverse operation and perform the reverse operation(s) in a reverse order on the temporary file system view starting with the internal snapshot 2 306B and ending the reverse operation after the recovery PIT tl 80. For example, if the modifying operation is a metadata operation, denoted as OP, then there is a reverse operation, denoted as OP'1. The temporary file system view is set as the backed-up file system 308 at tl 80. The following table 1 depicts metadata operations and corresponding reverse metadata operations. For example, the metadata operations chattr, and setxattr are reversible if there is a previous state. Adding the previous state of the meta-data operations chattr, setxattr into the operations log makes getting the previous state of the file system 302 feasible and does not require taking extra action. And, if the previous state of the metadata operations is missing, then the metadata operation may be handled as a data change.
[0060] FIG. 3B illustrates an exemplary implementation of modifying operations relating to data changes in accordance with an implementation of the disclosure. The exemplary implementation depicts one or more snapshots of the file-system 302, including an internal snapshot 1 306A, i.e. a preceding snapshot at tlOO, and an internal snapshot 2 306B, i.e. a succeeding snapshot at t200. The data changes are the changes of the file object data on a disk. The operations that change the data on the disk may also be known as operations relating to the data changes. For example, writing data into a file. To reverse the data change, the previous data of the file block needs to be written into the file. For example, a block [0, 4k-l] at tlOl, and tl 81 depicts multiple writes on the same file inode 1234.
[0061] FIG. 3C illustrates an exemplary table 310 of an inode for a data block related to a modifying operation in accordance with an implementation of the disclosure. The exemplary table 310 depicts the exact location of each data block. For example, the inode 1234 depicts the exact location of each data block at tl 80. The exemplary table 310 includes block, and data on the recovery Point-In-Time, PIT tl 80. For example, the data block [0, 4K-1] may be written at time tl 81 which is after the recovery Point-In-Time, PITR tl 80 and before the internal snapshot 2 306B at t200. As the data block is written after the internal snapshot 1 306A at tlOO, the last write before tl 80 contains the data to be recovered. The data block [4K, 8K-1] may not be written after the PITR tl80, where the data for this data block is available in the internal snapshot 2306B at t200. The data block [8K, 12K-1] may be written at time tl 82 which is after the PITR tl 80 and before the internal snapshot 2 306B at t200. As the data block is not written before or after the previous snapshot and before tl80, the last write for the data block is available in the internal snapshot 1 306A at tlOO.
[0062] FIGS. 4A-4D are flow diagrams that illustrate a method for a memory controller configured to provide a recovery of a file system to recovery Point-In-Time, PIT, utilizing a snapshot technology in accordance with an implementation of the disclosure. At a step 402, the method includes performing one or more snapshots of the file system. At a step 404, the method includes storing indications of modifying operations performed on the file system between the one or more snapshots of the memory. At a step 406, the method includes receiving an indication that a recovery to the recovery Point-In-Time, PIT, is to be performed. At a step 408, the method includes determining a preceding snapshot, the preceding snapshot is the closest snapshot preceding the recovery PIT. At a step 410, the method includes determining if there is a succeeding snapshot. The succeeding snapshot is the closest snapshot succeeding the recovery PIT, and if so, at a step 412, the method includes determining a first length of a path of modifying operations from the preceding snapshot to the recovery PIT. At a step 414, the method includes determining a second length of a path of modifying operations from the succeeding snapshot to the recovery PIT. At a step 416, the method includes determining that the time stamp for the succeeding snapshot is closer to the recovery PIT than the preceding time stamp if the second length is shorter than the first length, and if so, at a step 418, the method includes setting a file system view according to the succeeding snapshot as a temporary file system view. At a step 420, the method includes iterating for each stored indication of a modifying operation performed on the memory between recovery PIT, and the time stamp for the succeeding snapshot. At a step 422, the method includes determining a reverse operation and performing the reverse operation(s) in reverse order on the temporary file system view starting with the reverse operation for the stored indication closest prior to the succeeding snapshot and ending with the reverse operation for the stored indication closest after the recovery PIT. At a step 424, the method includes setting the temporary file system view as the backed-up file system. Shortest path to the desired PIT either from the preceding snapshot or the succeeding snapshot is selected with the memory controller of this method, which enables log of changes to apply in (i) a reverse order when using the succeeding snapshot, and (ii) a forward order if there is no succeeding snapshot or if the time stamp for the succeeding snapshot is not closer to the recovery PIT, than the preceding time stamp. The path can be significantly shorter, which enables the file system to recover to any PIT fast, and reduces the recovery time of the file system. The memory controller of this method is configured to apply a small number of changes by detecting the shortest path instead of applying all the changes from the preceding snapshot time. The memory controller of this method is configured to recover the file system to any PIT quickly and efficiently. The memory controller of this method is configured to query the available recovered PIT and the available internal snapshots. The recovery time can also be measured by selecting the last PIT before some snapshots. Consequently, the memory controller of this method seamlessly integrates into any kind of technique to backup all the file system operations (e.g., interception), and features of Continuous Data Protection, CDP can be used to backup all the file system operations applied on a primary file system.
[0063] The algorithm for generating a Point-In-Time, PIT file-system state for recovery at t recovery includes following steps. Firstly, preceding and succeeding snapshots for t recovery are determined, which is a first snapshot before t recovery and a first snapshot after t recovery. The first snapshot before t recovery and the first snapshot after t recovery are represented as Snapshotk and Snapshot_k+1. If there is no succeeding snapshot, the algorithm waits until a snapshot is generated, or directly applies a forward recovery method where reverse recovery is not applicable. Secondly, a length of the path from Snapshot k to t recovery, and a length of the path from t recovery to Snapshotk+i are calculated. Thirdly, the shortest length of a path is selected from the calculated two lengths of the paths. Optionally, a weight factor i.e. > 1, can be added to the reverse path, as the reverse recovery may have some overhead, which finds the exact data block location. The weight factor may be a single value for the entire path or per operations group type. For example, xl for meta-data changes and xl.2 for data changes.
[0064] A standard forward recovery method is applied if the shortest path is the forward path from SnapshotK to t recovery, in which the operations are applied one after the other up to t recovery. If the shortest path is the backward path from Snapshot_k+1 to t recovery, the algorithm enables (i) cloning of Snapshot_k+1 into a new writable file-system, called as pitr- fs, (ii) initializing a new linked-list for unresolved operations, and (iii) initializing a new hash- map. Optionally, at the end of the cloning process, the file system represents the PIT recovery state of the file system.
[0065] The algorithm enables iterating of changes from t_snapshot_k+l to t recovery in a reverse order. If the change, OPi, is a meta-data change, the algorithm applies the OPi1on the pitr-fs file-system. If the change is a data change, then append it (i.e., add into the end of the list) into a new linked-list of unresolved operations. The changes from t_snapshot_k+l down to t recovery are iterated in a reverse order, If the change, OP i, is a meta-data change, then skip to the next change. If the change is a data change, the algorithm checks whether the key exists in the hash-map, which means that this operation contains the previous data for that specific data block, in that case, (i) copy the data inside the current operation into the pitr-fs file-system (i.e., overwrites the current newer data); (ii) remove the key from the hash-map; and (iii) remove the entry from the unresolved linked-list. The entries in the unresolved linked-list are iterated over (k) for each operation, copy the data from this data block from Snapshotk into the pitr-fs file-system and the entry from the linked-list is removed. At this point, the pitr-fs filesystem exactly represents the file-system at t_recovery.
[0066] The following pseudo-code describes the method.
[0067] / / Generate a Point-In-Time, PIT file-system state for recovery at t recovery function generate_pitr_fs(timestamp t recovery) { snap _pre = find the preceding snapshot for t recovery snap_suc= find the succeding snapshot for t recovery if snap suc == null then { call forward_recovery(t_recovery, snap _pre) exit
[0068] } length forward = calculate the length of the path from snap _pre up to t recovery length r everse = calculate the (weighted) length of the path from snap suc down to t recovery if length forward <= length r everse then call forward_recovery(t_recovery, snap _pre) else call reverse_recovery(t_recovery, snap _pre, snap_suc)
[0069] / / Recovery using the forward algorithm function forward_recovery(timestamp t recovery, snapshot snap _pre) { pitr fs = clone of snap_pre for each change op from snap _pre up-to t recovery { app,y op on pitr fs
[0070] }
[0071] }
[0072] / / Recovery using the reverse algorithm function reverse_recovery(timestamp t recovery, snapshot snap _pre, snapshot suc) { unres list = new linked list unres hash = new hash map pitr fs = clone of snap suc
[0073] / / Phase #1 for each change op from snap suc down-to t recovery { if op is a metadata change then { op r = reverse op of op apply op r on pitr fs
[0074] } else { key = <op_inode, op_offset> unres li st. add(op) unres_hash.put(key, op)
[0075] }
[0076] }
[0077] }
[0078] / / Phase #2: copy data from changes for each change op from t recovery down-to snap _pre { if op is a data change then { key = <op_inode, op_offset> apply op r on pitr fs if key exists in unres hash then { val = unres hashfkey] copy data from op into pitr fs unres hash. del(key) unres list.del(val)
[0079] }
[0080] }
[0081] }
[0082] / / Phase #3 : Copy data from snap _pre for each entry op in unres list { copy data from snap pre into pitr fs unres.list.del(op)
[0083] }
[0084] }
[0085] In an implementation, a computer program product comprising program instructions for performing the method, when executed by one or more processors in a memory system.
[0086] FIG. 5 is an illustration of a computer system (e.g., a memory controller) in which the various architectures and functionalities of the various previous implementations may be implemented. As shown, the computer system 500 includes at least one processor 504 that is connected to a bus 502, wherein the computer system 500 may be implemented using any suitable protocol, such as PCI (Peripheral Component Interconnect), PCI-Express, AGP (Accelerated Graphics Port), Hyper Transport, or any other bus or point-to-point communication protocol (s). The computer system 500 also includes a memory 506.
[0087] Control logic (software) and data are stored in the memory 506 which may take a form of random-access memory (RAM). In the disclosure, a single semiconductor platform may refer to a sole unitary semiconductor-based integrated circuit or chip. It should be noted that the term single semiconductor platform may also refer to multi-chip modules with increased connectivity which simulate on-chip modules with increased connectivity which simulate on- chip operation, and make substantial improvements over utilizing a conventional central processing unit (CPU) and bus implementation. Of course, the various modules may also be situated separately or in various combinations of semiconductor platforms per the desires of the user. The computer system 500 may also include a secondary storage 510. The secondary storage 510 includes, for example, a hard disk drive and a removable storage drive, representing a floppy disk drive, a magnetic tape drive, a compact disk drive, digital versatile disk (DVD) drive, recording device, universal serial bus (USB) flash memory. The removable storage drive at least one of reads from and writes to a removable storage unit in a well-known manner.
[0088] Computer programs, or computer control logic algorithms, may be stored in at least one of the memory 506 and the secondary storage 510. Such computer programs, when executed, enable the computer system 500 to perform various functions as described in the foregoing. The memory 506, the secondary storage 510, and any other storage are possible examples of computer-readable media.
[0089] In an implementation, the architectures and functionalities depicted in the various previous figures may be implemented in the context of the processor 504, a graphics processor coupled to a communication interface 512, an integrated circuit (not shown) that is capable of at least a portion of the capabilities of both the processor 504 and a graphics processor, a chipset (namely, a group of integrated circuits designed to work and sold as a unit for performing related functions, and so forth).
[0090] Furthermore, the architectures and functionalities depicted in the various previous-described figures may be implemented in a context of a general computer system, a circuit board system, a game console system dedicated for entertainment purposes, an application-specific system. For example, the computer system 500 may take the form of a desktop computer, a laptop computer, a server, a workstation, a game console, an embedded system.
[0091] Furthermore, the computer system 500 may take the form of various other devices including, but not limited to a personal digital assistant (PDA) device, a mobile phone device, a smart phone, a television, and so forth. Additionally, although not shown, the computer system 500 may be coupled to a network (for example, a telecommunications network, a local area network (LAN), a wireless network, a wide area network (WAN) such as the Internet, a peer-to-peer network, a cable network, or the like) for communication purposes through an I / O interface 508.
[0092] It should be understood that the arrangement of components illustrated in the figures described are exemplary and that other arrangement may be possible. It should also be understood that the various system components (and means) defined by the claims, described below, and illustrated in the various block diagrams represent components in some systems configured according to the subject matter disclosed herein. For example, one or more of these system components (and means) may be realized, in whole or in part, by at least some of the components illustrated in the arrangements illustrated in the described figures. In addition, while at least one of these components are implemented at least partially as an electronic hardware component, and therefore constitutes a machine, the other components may be implemented in software that when included in an execution environment constitutes a machine, hardware, or a combination of software and hardware.
[0093] Although the disclosure and its advantages have been described in detail, it should be understood that various changes, substitutions, and alterations can be made herein without departing from the spirit and scope of the disclosure as defined by the appended claims.
Claims
CLAIMS1. A memory controller (204) configured to provide a recovery of a file system (202, 302) utilizing a snapshot technology, wherein the memory controller (204) is configured to: perform one or more snapshots, and to store indications of modifying operations performed on the file system (202, 302) between the one or more snapshots of the memory, wherein the memory controller (204) is further configured to: receive an indication that the recovery is to be performed for a recovery Point-In-Time, PIT, determine a preceding snapshot, wherein the preceding snapshot is a closest snapshot preceding the recovery PIT, determine if there is a succeeding snapshot, wherein the succeeding snapshot is the closest snapshot succeeding the recovery PIT, and if so, determine a first length of a path of the modifying operations from the preceding snapshot to the recovery PIT, determine a second length of a path of the modifying operations from the succeeding snapshot to the recovery PIT, determine that a time stamp for the succeeding snapshot is closer to the recovery PIT than the preceding time stamp if the second length is shorter than the first length, and if so, set a file system view according to the succeeding snapshot as a temporary file system view, iterate for each stored indication of a modifying operation performed on the memory between the recovery PIT and the time stamp for the succeeding snapshot, determine a reverse operation and perform the reverse operation(s) in a reverse order on the temporary file system view starting with the reverse operation for the stored indication closest prior to the succeeding snapshot and ending with the reverse operation for the stored indication closest after the recovery PIT, and to set the temporary file system view as the backed-up file system.
2. The memory controller (204) according to claim 1, wherein the memory controller (204) is further configured to recover the memory for the recovery PIT based on the preceding snapshotas per the snapshot technology if there is no succeeding snapshot or if the time stamp for the succeeding snapshot is not closer to the recovery PIT than the preceding time stamp.
3. The memory controller (204) according to any preceding claim, wherein the modifying operation relates to a meta data change.
4. The memory controller (204) according to any preceding claim, wherein the modifying operation relates to a file data change.
5. The memory controller (204) according to claim 4, wherein the memory controller (204) is further configured to determine the reverse operation for the modifying operation that relates to a data change by initialize a linked-list for unresolved operations, wherein each entry indicates an operation and a data block on which the operation is to be made, when iterating over the indications of the modifying operations from the time stamp for the succeeding snapshot down to the recovery PIT in the reverse order to determine the reverse operation for each modifying operation relating to the data change includes appending the modifying operation to the linked-list of unresolved operations, again iterate over the indications of the modifying operations from the time stamp for the succeeding snapshot down to the recovery PIT in the reverse order to determine if the modifying operation relates to the data change and if so, copy the data for the modifying operation into the temporary file system, and remove the modifying operation from the unresolved linked list; iterate over the entries in the unresolved linked-list and for each modifying operation, copy the data for the related data block from the preceding snapshot into the temporary file system and remove the modifying operation from the unresolved linked-list.
6. The memory controller (204) according to claim 5, wherein the memory controller (204) is further configured to initialize a change map,add a key of the modifying operation into the change map, wherein the key comprises inode and offset for a data block related to the modifying operation, and when iterating over the modifying operations relating to data changes, determine whether the key for the modifying operation relating to data changes exist in the change map and if so, copy the data inside the modifying operation into the temporary file system, remove the key from the change map, and remove the modifying operation from the unresolved linked-list.
7. The memory controller (204) according to claim 6, wherein the change map is a hash map.
8. The memory controller (204) according to any preceding claim, wherein the memory controller (204) is further configured to determine the second length by applying a weighting multiplier to the length.
9. The memory controller (204) according to claim 8, wherein the weighting multiplier is determined based on the number of modifying operations related to the data change in the path of modifying operations from the succeeding snapshot to the recovery PIT.
10. The memory controller (204) according to claim 9, wherein the weighting multiplier is determined based on a type of the modifying operation related to the data change in the path of the modifying operations.
11. A method for a memory controller (204) configured to provide a recovery of a file system (202, 302) utilizing a snapshot technology, wherein the method comprises performing one or more snapshots of the file system (202, 302), and to storing indications of modifying operations performed on the file system (202, 302) between the one or more snapshots of the memory, wherein the memory controller (204) is further configured to receiving an indication that the recovery is to be performed for a recovery Point-InTime, PIT, determining a preceding snapshot, wherein the preceding snapshot is a closest snapshot preceding the recovery PIT, determining if there is a succeeding snapshot, wherein the succeeding snapshot is the closest snapshot succeeding the recovery PIT, and if so,determine a first length of a first path of the modifying operations from the preceding snapshot to the recovery PIT, determine a second length of a second path of the modifying operations from the succeeding snapshot to the recovery PIT, determine that a time stamp for the succeeding snapshot is closer to the recovery PIT than the preceding time stamp if the second length is shorter than the first length, and if so, setting a file system view according to the succeeding snapshot as a temporary file system view, iterating for each stored indication of a modifying operation performed on the memory between the recovery PIT and the time stamp for the succeeding snapshot, determining a reverse operation and performing the reverse operation(s) in a reverse order on the temporary file system view starting with the reverse operation for the stored indication closest prior to the succeeding snapshot and ending with the reverse operation for the stored indication closest after the recovery PIT, and setting the temporary file system view as the backed-up file system.
12. A computer program product comprising program instructions for performing the method according to claim 11, when executed by one or more processors in a memory system.
Citation Information
Patent Citations
Data resychronization methods and systems in continuous data protection
US20220179565A1
Continuous data protection in cloud using streams
US20220391288A1
Production recovery using a point in time snapshot
US9804934B1
Cited By
System and method for directory restoration for ransomware mitigation
US20260267967A1