Processing of offline storage disks
By selecting spare storage blocks in the RAID storage system to temporarily store data and perform data copy and reconstruction when the storage disk is restored or offline, the problem of low backup and reconstruction efficiency of traditional RAID storage systems is solved, and the performance and user experience of the storage system are improved. .
Patent Information
- Application Number
- CN201910357279.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-29
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-04-29
AI Technical Summary
Traditional RAID storage systems have inefficient backup and reconstruction operations when storage disks or storage blocks fail and cannot meet performance requirements, resulting in poor user experience.
When the storage disk is offline, spare storage blocks are selected to temporarily store data to be written, and data is copied and reconstructed when the storage disk is restored or permanently offline, avoiding traditional degraded writing and incremental reconstruction operations.
It improves the performance of the storage system when the storage block is restored after being offline or permanently offline, saves processor and storage disk bandwidth, reduces the impact on normal I/O operations, and simplifies the reconstruction process.
Smart Images

Figure CN111858189B
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure generally relate to computer systems or storage systems, and more particularly, to a storage management method, an electronic device, and a computer program product. Background Art
[0002] In a traditional storage system based on a redundant array of independent disks (RAID), if a storage disk (drive) or storage block (drive slice) in the RAID is removed or fails, the storage system will send a corresponding event notification to the backend to update the storage disk information. Thereafter, the backend can send an event notification to the RAID module to indicate that the storage disk or storage block has become offline. Next, the RAID module will update the information of the storage disk or storage block, wait for a preset period of time (for example, 5 minutes), and then trigger a backup operation to replace the offline storage disk or storage block with a spare storage disk or storage block, and perform data reconstruction in the spare storage disk or storage block.
[0003] However, the above backup operations and reconstruction operations of the traditional RAID storage system still have various defects and deficiencies, and cannot meet the performance requirements of the storage system in many scenarios, resulting in a poor user experience. Summary of the invention
[0004] Embodiments of the present disclosure relate to a storage management method, an electronic device, and a computer program product.
[0005] In a first aspect of the present disclosure, a storage management method is provided. The method includes: in response to a first storage disk becoming offline and remaining offline until a first time point, selecting a second storage block in a second storage disk as a backup storage block for a first storage block in the first storage disk. The first storage block is one of a plurality of storage blocks constituting a RAID, and the plurality of storage blocks are located on different storage disks. The method also includes: between the first time point and a second time point, writing data to be written to the first storage block in the RAID to the second storage block, wherein the second time point is later than the first time point. The method further includes: in response to the first storage disk remaining offline until the second time point, using the second storage block to replace the first storage block in the RAID.
[0006] In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes at least one processor and at least one memory storing computer program instructions. The at least one memory and the computer program instructions are configured to, together with the at least one processor, enable the electronic device to: in response to the first storage disk becoming offline and remaining offline to a first time point, select a second storage block in the second storage disk as a backup storage block for the first storage block in the first storage disk. The first storage block is one of a plurality of storage blocks constituting a RAID, and the plurality of storage blocks are located on different storage disks. The at least one memory and the computer program instructions are also configured to, together with the at least one processor, enable the electronic device to: between a first time point and a second time point, write data to be written to the first storage block in the RAID to the second storage block, wherein the second time point is later than the first time point. The at least one memory and the computer program instructions are further configured to, together with the at least one processor, enable the electronic device to: in response to the first storage disk remaining offline to a second time point, use the second storage block to replace the first storage block in the RAID.
[0007] In a third aspect of the present disclosure, a computer program product is provided. The computer program product is tangibly stored on a non-volatile computer readable medium and includes machine executable instructions. When the machine executable instructions are executed, the machine performs the steps of the method according to the first aspect.
[0008] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other purposes, features and advantages of the embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0010] Figure 1 A schematic diagram is shown of an exemplary storage system in which embodiments of the present disclosure may be implemented.
[0011] Figure 2 A schematic flow chart of a storage management method according to an embodiment of the present disclosure is shown.
[0012] Figure 3 A schematic diagram showing a RAID composed of multiple storage blocks from multiple storage disks according to an embodiment of the present disclosure.
[0013] Figure 4A schematic diagram is shown of selecting a second storage block as a backup storage block for a first storage block after a first storage disk has been offline for a first time point according to an embodiment of the present disclosure.
[0014] Figure 5 A schematic diagram of writing data to be written into a first storage block into a spare storage block according to an embodiment of the present disclosure is shown.
[0015] Figure 6 A schematic diagram is shown of rebuilding data in a first storage block to a spare storage block after the first storage disk is offline until a second time point according to an embodiment of the present disclosure.
[0016] Figure 7 A schematic diagram showing data copying from a spare storage block to a first storage block when the first storage disk is restored online according to an embodiment of the present disclosure is shown.
[0017] Figure 8 A schematic block diagram of a device that can be used to implement an embodiment of the present disclosure is shown.
[0018] The same or similar reference numerals are used throughout the drawings to designate the same or similar components. DETAILED DESCRIPTION
[0019] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments shown in the accompanying drawings. It should be understood that these specific embodiments are described only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way.
[0020] Figure 1 Schematic diagram of an exemplary storage system 100 in which embodiments of the present disclosure may be implemented. Figure 1 As shown, the storage system 100 may include a processor 110 and a storage structure 120, wherein the processor 110 is used to perform operations related to the storage system 100, such as input / output (I / O) operations, control operations, management operations, etc. More generally, with the cooperation of necessary hardware and software, the processor 110 may perform any operation related to the storage system 100. In addition, the storage structure 120 is used to organize and manage storage resources of the storage system 100, such as various physical storage disks, etc., in an appropriate organizational manner.
[0021] like Figure 1As shown, the storage structure 120 includes a storage block pool 130, which can be used to manage all storage disks in the storage structure 120. The storage disks in the storage block pool 130 will be organized into multiple RAID recovery sets (RRS) 132, RRS 134, RRS 136, RRS 138, etc. Each RRS is a fault domain, which means that if a storage disk in an RRS (e.g., RRS 132) fails, the failure will not affect the recovery of other RRSs. In a typical storage system, an RRS can include up to 25 storage disks. However, the embodiments of the present disclosure are not limited to the above specific numerical values. In other embodiments, the RRS can include any appropriate number of storage disks.
[0022] In the storage block pool 130, each storage disk can be divided into storage blocks of a fixed size. The size of each storage block can be set to 4 gigabytes (GB). However, the embodiments of the present disclosure are not limited to the above specific values. In other embodiments, the size of the storage block in the storage disk can be set to any appropriate size. It can be seen that the storage block pool 130 can be regarded as being composed of a collection of storage blocks, which is why it is called a storage block pool.
[0023] In the storage block pool 130, multiple storage blocks from different storage disks can form a small RAID (relative to a large RAID composed of multiple physical storage disks). The RAID can be of any appropriate type. For example, if the type of RAID is 4+1 RAID-5 to create a RAID group, the processor 110 allocates 5 free storage blocks from different storage disks and combines the 5 storage blocks into a small RAID. In some cases, all storage blocks in a RAID may be required to come from the same RRS. In addition, each RAID may include multiple RAID stripes. The size of each RAID stripe may be 2 megabytes (MB), which may also be referred to as a physical large block (PLB). It will be understood that the embodiments of the present disclosure are not limited to the above specific numerical values. In other embodiments, the size of the RAID stripe may be set to any appropriate size.
[0024] In addition, if Figure 1As shown, the storage block pool 130 can present or provide some layers (tiers) for use by other components, including a first layer 140, a second layer 142, a third layer 144, ..., an Nth layer 146 (N is a natural number), and so on. Each layer can be composed of a group of multiple RAIDs. For each layer, different RAID strategies can be applied based on the type of data stored. Typically, all RAIDs in the same layer can have the same RAID strategy, which means the same RAID width and RAID type. Each layer can be expanded as needed, that is, the processor 110 can dynamically allocate new RAIDs and add them to a certain layer.
[0025] The storage structure 120 may also include a mapper 150. The mapper 150 is a core component in the storage structure 120, which treats each layer as a flat linear physical address space. On the other hand, the mapper 150 provides a single flat linear logical address space to the namespace module 170. In some cases, the logical address space can be up to 8 exabytes (EB). As an example, the mapper 150 can utilize a B+ tree data structure to maintain the mapping between logical addresses and physical addresses at a granularity of 4K pages. It will be understood that the embodiments of the present disclosure are not limited to the above-mentioned specific numerical values and specific data structures. In other embodiments, the size of the above-mentioned logical address space and the granularity of the mapper can be set to any appropriate numerical value, and the mapper 150 can use other suitable data structures to maintain the mapping between logical addresses and physical addresses.
[0026] The storage structure 120 may further include a cache module 160. The cache module 160 may provide a cache function within a memory (not shown), which may have two instances in the storage system 100. One of the instances is used for user data, and the other instance is used for metadata. The cache module 160 may provide transaction operation functions to the mapper 150. It will be understood that the embodiments of the present disclosure are not limited to the above-mentioned specific examples. In other embodiments, the cache module 160 may have any other suitable number and purpose of instances. In addition, the storage structure 120 may further include the namespace module 170 mentioned above. As noted above, the namespace module 170 may consume and manage the flat linear logical space (e.g., a size of 8EB) provided by the mapper 150. On the other hand, the namespace module 170 may create and provide storage volumes to the host (not shown) of the storage system 110 for use by the host.
[0027] In some embodiments, the storage disks organized and managed by the storage structure 120 may include various types of devices with storage functions, including but not limited to hard disks (HDDs), solid-state disks (SSDs), removable disks, compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks, Blu-ray disks, serial-attached small computer system interface (SCSI) storage disks (SAS), serial advanced technology attachment (SATA) storage disks, any other magnetic storage devices, and any other optical storage devices, or any combination thereof.
[0028] Similarly, the processor 110 may include any device that implements control functions, including but not limited to a special-purpose computer, a general-purpose computer, a general-purpose processor, a microprocessor, a microcontroller, or a state machine. The processor 110 may also be implemented as an individual computing device or a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.
[0029] It should be understood that Figure 1 The units, modules or components in the storage system 100 that are related to the embodiments of the present disclosure are only schematically shown. In practice, the storage system 100 may also include other units, modules or components for other functions. Therefore, the embodiments of the present disclosure are not limited to Figure 1 The specific devices, units, modules or components depicted are generally applicable to any storage system based on RAID technology.
[0030] As pointed out above, the backup and reconstruction operations of conventional RAID storage systems still have various defects and deficiencies, and in many cases cannot meet the performance requirements of the storage system, resulting in a poor user experience. For example, conventional RAID storage systems widely use a method called "incremental reconstruction" to optimize the reconstruction process. This means that when a storage disk or storage block in a RAID goes offline and then comes back online in a short time (e.g., 5 minutes), the "incremental reconstruction" method only reconstructs the newly written data from the time the storage disk or storage block goes offline to the time it comes back online.
[0031] Specifically, if a write operation needs to be performed on a degraded RAID (i.e., a RAID including one offline storage disk or storage block) within 5 minutes from the time when the storage disk or storage block becomes offline, the traditional approach is to perform a "degraded write" operation algorithm on the degraded RAID, that is, data is only written to the remaining online storage disks or storage blocks in the degraded RAID, and which stripes in the degraded RAID have data written are recorded in metadata (e.g., virtual large blocks VLB).
[0032] If the offline storage disk or storage block is back online within 5 minutes, the RAID performs an "incremental reconstruction" algorithm, that is, only the stripes to which data was written after the storage disk or storage block was offline are rebuilt. As mentioned above, the information about which stripes were written is recorded in the metadata. Conversely, if the offline storage disk or storage block is not back online within 5 minutes, the RAID including the offline storage disk or storage block will perform a backup operation, that is, replace the offline storage disk or storage block in the RAID with a spare storage disk or storage block, and perform a complete data reconstruction in the new storage disk or storage block.
[0033] The above processing methods of traditional RAID for offline storage disks or storage blocks have at least the following problems and defects. First, components such as storage systems, mappers, and RAID modules need to support "degraded writes", in which data written on degraded RAID stripes is easily lost due to lack of redundant protection. Second, during the "incremental reconstruction" process, the mapper will read all RAID stripes. For example, in the case of a 4+1 RAID5 type, the RAID will read the data in the other four online storage disks or storage blocks, and rebuild the data in the offline storage disks or storage blocks, and then return all stripes to the mapper.
[0034] Next, the mapper sends a "repair write" operation instruction to the RAID, so that the RAID writes the data stored in the degraded RAID, and the RAID only writes to the restored storage disk or storage block. Therefore, when rebuilding a RAID stripe, the mapper will perform at least 4 read operations and 1 write operation, which will affect the normal I / O operation of the storage system because the access bandwidth of the storage disk and the processing bandwidth of the processor are occupied. In addition, if the offline storage disk or storage block is not restored to online, the RAID needs to perform a complete data reconstruction. This also occupies the bandwidth of the storage disk and the processor, and will affect the normal I / O operation of the storage system.
[0035] In view of the above problems and potential other problems existing in the traditional solution, the embodiments of the present disclosure propose a storage management method, an electronic device and a computer program product for improving the processing of a storage disk or a storage block in a RAID storage system becoming offline. The basic idea of the embodiments of the present disclosure is that when a storage block from a storage disk in the RAID goes offline and lasts until a first time point (for example, a few seconds), a spare storage block in a spare storage disk is selected to temporarily store data to be written to the offline storage block. If the offline storage disk is restored online before a second time point (for example, a few minutes), only the data in the spare storage block needs to be copied to the offline storage block. If the offline storage disk is not restored online before the second time point, a RAID backup process is performed, in which only the original data in the offline storage block needs to be rebuilt into the spare storage block.
[0036] The embodiments of the present disclosure can improve the performance of a RAID-based storage system in both cases of recovery after a storage block is offline and permanent offline. For example, in the case of recovery after a storage block is offline, the embodiments of the present disclosure only need to copy the data in the spare storage block to the offline and restored storage block, that is, one read operation and one write operation. Compared to four read operations and one write operation in the traditional method (in the case of 4+1 RAID5), this saves the bandwidth of the processor and the storage disk, and reduces the impact on the normal I / O performance of the storage system.
[0037] In addition, in the case where the offline storage block is permanently offline, the spare storage block will replace the offline storage block in the RAID, and for this purpose, only the data written in the offline storage block before the offline needs to be rebuilt in the spare storage block, thereby avoiding the complete data reconstruction in the traditional method, thereby accelerating the reconstruction process. Furthermore, the embodiments of the present disclosure will not affect the implementation of other potential reconstruction optimization methods, including the reconstruction-based valid data perception method (in which if the storage block is offline and not recovered, only the area containing valid data in the offline storage block is rebuilt), and the so-called "thin reconstruction" method, etc. The following is combined with Figures 2 to 7 Some example embodiments of the present disclosure are described in detail.
[0038] Figure 2 A flow chart of a storage management method 200 according to an embodiment of the present disclosure is shown. In some embodiments, the method 200 may be implemented by the processor 110 or processing unit of the storage system 100, or by various functional modules of the storage system 100. In other embodiments, the method 200 may also be implemented by a computing device independent of the storage system 100, or may be implemented by other units or modules in the storage system 100.
[0039] As mentioned above Figure 1 As described above, the storage disks in the storage system 100 can be divided into fixed-size storage blocks, and the storage blocks from different storage disks can form a RAID. In other words, based on the large number of storage blocks provided in the storage block pool 130, the storage system 100 can form multiple RAIDs. In some embodiments, Figure 2 The method 200 can be performed for an individual RAID consisting of multiple storage blocks. Figure 3 An example scenario is described in which multiple storage blocks from multiple different storage disks form a RAID.
[0040] Figure 3 FIG. 3 is a schematic diagram showing a plurality of storage blocks 315-355 from a plurality of storage disks 310-350 forming a RAID 305 according to an embodiment of the present disclosure. Figure 3As shown, storage disk 310 (hereinafter may also be referred to as the first storage disk) is divided into a plurality of storage blocks including storage block 315 (hereinafter may also be referred to as the first storage block). Similarly, storage disk 320 is divided into a plurality of storage blocks including storage block 325, storage disk 330 is divided into a plurality of storage blocks including storage block 335, storage disk 340 is divided into a plurality of storage blocks including storage block 345, storage disk 350 is divided into a plurality of storage blocks including storage block 355, and storage disk 360 is divided into a plurality of storage blocks including storage block 365.
[0041] As shown, storage blocks 315, 325, 335, 345, and 355 constitute a 4+1 RAID 5 type RAID 305, wherein storage block 315 stores data-1, storage block 325 stores data-2, storage block 335 stores data-3, storage block 345 stores data-4, and storage block 355 stores data-5. According to the nature of RAID5, any one of data-1 to data-5 can be reconstructed from the other four data through the RAID algorithm. In other words, the first storage block 315 in the first storage disk 310 is one of the multiple storage blocks that constitute RAID 305, and the multiple storage blocks that constitute RAID 305 are located on different storage disks. In addition, although not shown, a certain number of free storage blocks can be reserved in each storage disk as spare storage blocks so as to be replaced when a storage block in the RAID fails. For example, Figure 3 It is shown in the figure that the storage disk 360 (hereinafter may also be referred to as the second storage disk) includes a spare storage block 365 (hereinafter may also be referred to as the spare storage block).
[0042] It should be understood that although Figure 3 A specific number of storage disks, each storage disk including a specific number of storage blocks, and RAID 305 consisting of a specific number of storage blocks and having a specific RAID type are shown in an exemplary manner, but this is only exemplary and is not intended to limit the scope of the present disclosure in any way. In other embodiments, the embodiments of the present disclosure may be applicable to any number of storage disks or storage blocks, and may also be applicable to any type of RAID. For ease of discussion, the following will be combined with Figure 3 Let's discuss Figure 2 Storage management method 200 in.
[0043] Return to reference Figure 2At 205, the processor 110 of the storage system 100 determines whether the first storage disk 310 becomes offline and remains offline until the first time point. The first storage disk 310 becoming offline means that all its storage blocks (including storage block 315) will become offline. That is, the storage block 315, which is a component of RAID 305, will become offline and unavailable. In this case, RAID 305 will not be able to perform normal RAID operations. In addition, it is worth noting that in practice, a storage disk may have a short-term minor fault, which is manifested as the storage disk being temporarily offline and quickly recovering in a short time. In order to avoid performing too many remedial operations due to such a minor fault, the embodiment of the present disclosure sets a first time point, which can also be referred to as a storage disk offline overriding time point. In some embodiments, the first time point can be set to a number of seconds (for example, 5 seconds) from the time when the first storage disk 310 is offline. In other embodiments, the first time point can be pre-determined by a technician according to a specific technical environment and design requirements. In the following, for the convenience of description, the time point when the first storage disk 310 becomes offline can be referred to as t0, and the above-mentioned first time point can be referred to as t1.
[0044] At 210, if the first storage disk 310 becomes offline and remains offline until the first time point t1, the processor 110 selects the second storage block 365 in the second storage disk 360 as a spare storage block for the first storage block 315 in the first storage disk 310. Hereinafter, for the sake of convenience of description, the second storage block 365 may also be referred to as a spare storage block 365. The selected spare storage block 365 is used to temporarily store data to be written to the first storage block 315 in the RAID 305 during the period when the first storage block 315 is offline. As used herein, temporary storage means that the spare storage block 365 cannot completely replace the role of the first storage block 315 in the RAID 305, because the spare storage block 365 does not have the data stored in the first storage block 315 before the first storage disk 310 was offline. The following will refer to Figure 4 An example of selecting the second memory block 365 as a spare memory block for the first memory block 315 is described.
[0045] Figure 4 FIG. 3 is a schematic diagram showing a method of selecting a second storage block 365 as a backup storage block for a first storage block 315 after the first storage disk 310 is offline for a first time point t1 according to an embodiment of the present disclosure. Figure 4, state 405 represents the state of RAID 305 when the first storage disk 310 is not offline (i.e., before t0), wherein storage blocks 315 to 355 store data-1 to data-5 respectively. State 415 represents the state of RAID 305 when the first storage disk 310 is offline at time t0. As shown in 407, the first storage block 315 becomes offline at time t0, making data-1 unavailable. State 425 represents that at the first time point t1, the first storage block 315 has not been restored, and the processor 110 can select the second storage block 365 as a backup storage block for the first storage block 315.
[0046] As shown, in some embodiments, the information that the second storage block 365 is a spare storage block for the first storage block 315 can be recorded in the metadata 410. That is, the metadata 410 is used to record which storage block is selected as the spare storage block for the first storage block 315. As shown in 417, in Figure 4 In the specific example of , metadata 410 points to the second storage block 365 as a spare storage block. In some embodiments, metadata 410 may also be referred to as RAID geometry metadata, which may reuse existing metadata in the current RAID storage system to additionally record information about the spare storage block 365. As an example, this information may be recorded in the "copy location" information element of the RAID geometry metadata. By reusing existing metadata, the introduction of additional metadata in the storage disk or memory may be avoided. In addition, it is noted that the copy operation from the spare storage block 365 to the first storage block 315, which will be discussed in detail below, may have a lower priority than temporary backup operations and permanent backup operations, so it is safe to reuse existing RAID geometry metadata. However, it will be understood that in other embodiments, metadata 410 may also be metadata newly set in the storage system 100.
[0047] In some embodiments, the selection of spare storage blocks can be similar to the selection of spare storage blocks for reconstruction in a RAID system. For example, the processor 110 can select the second storage disk 360 from a plurality of storage disks so that the plurality of storage disks are evenly used to form a plurality of RAIDs. For example, among the plurality of storage disks of the storage system 100, it is assumed that the storage blocks in the second storage disk 360 are currently in the same RAID as the storage blocks in the storage disks 320 to 350 at least. In this case, in order to make each RAID as evenly distributed as possible on all storage disks, the processor 110 can determine to select a storage block in the second storage disk 360 as a spare storage block for the first storage block 315 of the RAID 305, so as to replace the first storage block 315 in the RAID 305 after the first storage block 315 is permanently offline. After determining to select the second storage disk 360, the processor 110 can further select a certain free storage block in the second storage disk 360 as the second storage block 365.
[0048] Return to reference Figure 2 At 215, between the first time point t1 and the second time point (hereinafter referred to as t2 for ease of description), the processor 110 writes the data to be written into the first storage block 315 in the RAID 305 into the second storage block 365. In other words, as a spare storage block for the first storage block 315, the second storage block 365 will be used to temporarily store the data originally to be written into the first storage block 315, thereby avoiding the "degraded writing" in the traditional solution. Figure 5 To describe this process. In addition, the second time point t2 here can be understood as the time point after which the storage disk 310 will no longer be able to become online again. Therefore, the second time point t2 can also be considered as the time point that triggers the use of the spare storage block 365 to completely replace the offline first storage block 310.
[0049] Figure 5 FIG. 3 shows a schematic diagram of writing data to be written to the first storage block 315 to the spare storage block 365 according to an embodiment of the present disclosure. Figure 5 As shown, assuming that between the first time point t1 and the second time point t2, the processor 110 receives an I / O request to write new data 510 to the RAID 305, and since there is a spare storage block 365, the processor 110 can normally write new data-2 to new data-5 associated with the data 510 in the storage blocks 325 to 355 according to the RAID algorithm. Hereinafter, for the convenience of description, the data stored in the RAID 305 associated with the data 510 is referred to as new data, and the data stored in the RAID 305 before the first storage block 310 is offline is referred to as old data.
[0050] Specifically, the processor 110 may write 512 new data-2 to the storage block 325, write 514 new data-3 to the storage block 335, write 516 new data-4 to the storage block 345, and write 518 new data-5 to the storage block 525. Different from when the first storage block 315 is online, since the first storage block 315 cannot be written at this time and there is a spare storage block 365, the new data-1 to be written to the storage block 315 will be written 520 to the spare storage block 365. Therefore, after the new data 510 is written, the old data-2 and the new data-2 are stored in the storage block 325, the old data-3 and the new data-3 are stored in the storage block 335, the old data-4 and the new data-4 are stored in the storage block 345, the old data-5 and the new data-5 are stored in the storage block 355, and the new data-1 is stored in the second storage block 365. In this way, the new data 510 can be written using a safe RAID algorithm, thereby avoiding the risk of data loss caused by using "degraded writing" in traditional solutions.
[0051] Return to reference Figure 2 At 220, the processor 110 determines whether the first storage disk 310 remains offline until time point t2. As mentioned above, the second time point t2 can be considered as a time point that triggers the use of the spare storage block 365 to completely replace the offline first storage block 310. In other words, at 220, the processor 110 can determine whether the first storage disk 310 needs to be replaced. In some embodiments, based on practical experience of the storage system, the second time point t2 can be set to several minutes (for example, 5 minutes). In other embodiments, the second time point t2 can be predetermined by a technician according to a specific technical environment and design requirements.
[0052] At 225, with the first storage disk 310 remaining offline until the second time point t2, the processor 110 replaces the first storage block 315 in the RAID 305 with the second storage block 365. This means that the second storage block 365 will permanently replace the first storage block 315 as part of the RAID 305. However, as described above, the second storage block 365 only stores the new data-1 associated with the new data 510, and does not store the old data-1 that has been stored in the first storage block 315 before going offline. Due to the nature of the redundant storage of the RAID 305, the old data-1 in the first storage block 315 can be reconstructed from the old data-2 to the old data-5 in the other storage blocks 325 to 355. In other words, the processor 110 can use the data of the other storage blocks in the RAID 305 to reconstruct the data in the first storage block 315 into the second storage block 365. This will be described below in conjunction with Figure 6 To describe the reconstruction process.
[0053] Figure 6 FIG. 3 is a schematic diagram showing a method of rebuilding data in the first storage block 310 to the spare storage block 365 after the first storage disk 310 is offline for a second time point t2 according to an embodiment of the present disclosure. Specifically, Figure 6 As shown, the processor 110 may copy 612 the old data-2 in the storage block 325, copy 614 the old data-3 in the storage block 335, copy 616 the old data-4 in the storage block 345, and copy 618 the old data-5 in the storage block 355. Then, the processor 110 may use the RAID reconstruction algorithm to recover the old data-1 stored in the first storage block 315 from the old data-2 to the old data-5. Then, the processor 110 may store 620 the reconstructed old data-1 in the second storage block 365. In this way, the second storage block 365 will have the data previously stored in the first storage block 315, and thus may completely replace the first storage block 315 in the RAID 305.
[0054] In some embodiments, the reconstruction of old data-1 can be performed by stripe. For example, the processor 110 can determine the stripe to which data is written in RAID 305 before the first storage disk 310 becomes offline. As an example, this information can be recorded in the metadata 410 mentioned above. For the determined stripe, the processor 110 can read the data associated with the determined stripe from other storage blocks 325 to 355 in RAID 305. Based on the read data, the processor 110 can calculate the data associated with the determined stripe stored in the first storage block 315. As an example, for RAID5 type, the processor 110 can derive the data stored in the first storage block 315 by calculating the XOR value of these data. Then, the processor 110 can write the calculated data into the second storage block 365. In the case where multiple stripes are written, the processor 110 can perform the above-mentioned reconstruction process for each stripe written. In this way, the old data-1 previously stored in the first storage block 315 can be reconstructed into the second storage block 365 more effectively. In some embodiments, after completing the above-mentioned reconstruction operation, the processor 110 can clear the relevant information in the metadata 410 and re-mark the RAID 305 as normal operation. In addition, the locking process of the metadata 410 may be performed in the usual manner.
[0055] On the other hand, at 220, if the first storage disk 310 is restored to online between the first time point t1 and the second time point t2, the processor 110 can copy the data in the second storage block 365 to the first storage block 310. As shown above, the copying only involves one read operation and one write operation, thereby avoiding the "incremental reconstruction" method in the traditional solution that requires multiple read operations and one write operation, greatly saving the bandwidth of the processor and the storage disk, and improving the performance of the storage system. Figure 7 To describe the replication process.
[0056] Figure 7 FIG. 2 shows a schematic diagram of copying data from the spare storage block 365 to the first storage block 315 when the first storage disk 310 is restored online according to an embodiment of the present disclosure. Figure 7 As shown, at the time point when the first storage disk 310 is restored to be online, the first storage block 315 contains the old data -1 stored before the first storage disk 310 is offline, the storage block 325 contains the old data -2 stored before the first storage disk 310 is offline and the new data -2 stored after the first storage disk 310 is offline, the storage block 335 contains the old data -3 stored before the first storage disk 310 is offline and the new data -3 stored after the first storage disk 310 is offline, the storage block 345 contains the old data -4 stored before the first storage disk 310 is offline and the new data -4 stored after the first storage disk 310 is offline, the storage block 355 contains the old data -5 stored before the first storage disk 310 is offline and the new data -5 stored after the first storage disk 310 is offline, and the second storage block 365 contains the new data -1 stored after the first storage disk 310 is offline.
[0057] It can be seen that at the time point when the first storage disk 310 is restored to be online, the first storage block 315 lacks the new data-1 after the first storage disk 310 is offline. Therefore, in order to allow the first storage block 315 to continue to form the RAID 305 with the storage blocks 325 to 355, the processor 110 can copy 710 the new data-1 in the second storage block 365 to the first storage block 315. In this way, through only one copy operation, the first storage block 315 restored to be online has not only the old data-1 but also the new data-1, so that it can become part of the RAID 305 again. As pointed out above, this effectively avoids the complex "incremental reconstruction" operation performed by the traditional RAID storage system when the offline storage block is restored to be online.
[0058] In some embodiments, the replication of new data-1 can also be performed by stripe. For example, the processor 110 can determine the stripe to which data is written in RAID 305 between the first time point t1 and the second time point t2. Then, the processor 110 can copy the data associated with the determined stripe in the second storage block 365 to the first storage block 315. In the case where there are multiple stripes to which new data is written, the above-mentioned replication operation by stripe can be performed sequentially for multiple stripes. In some embodiments, after completing the above-mentioned replication operation, the processor 110 can clear the relevant information in the metadata 410 and re-mark the RAID 305 as normal operation. In addition, in order to more conveniently perform the replication of new data-1, the processor 110 can record the stripe to which data is written in RAID 305 between the first time point t1 and the second time point t2. For example, recorded in the metadata 410.
[0059] In addition, in some embodiments, during the period from t0 to the first time point t1 when the first storage disk 310 becomes offline, the processor 110 can suspend the write operation to the RAID 305. That is to say, the write I / O operation generated for the RAID 305 during this period can wait until after the first time point t1, that is, after the spare storage block 365 is in place, and is safely written through the normal RAID algorithm. In this way, at the cost of a short delay (a few seconds), the safe writing of the data to be written is achieved. This is advantageous because in many technical scenarios, a few seconds of I / O delay does not cause the user to have an obvious sense of delay. On the other hand, since the RAID 305 lacking the first storage block 315 can still derive the stored data from other storage blocks, the processor 110 may not suspend the read operation to the RAID 305.
[0060] Figure 8 Schematically shows a block diagram of a device 800 that can be used to implement an embodiment of the present disclosure. Figure 8 As shown in FIG. 8 , the device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only storage device (ROM) 802 or loaded from a storage unit 808 to a random access storage device (RAM) 803. In RAM 803, various programs and data required for the operation of the device 800 can also be stored. CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0061] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0062] The various processes and processing described above, such as method 200, may be performed by processing unit 801. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by CPU 801, one or more steps of method 200 described above may be performed.
[0063] As used herein, the term "including" and similar terms should be understood as open inclusion, i.e., "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included herein.
[0064] As used herein, the term "determine" encompasses a wide variety of actions. For example, "determine" may include computing, calculating, processing, deriving, investigating, searching (e.g., searching in a table, a database, or another data structure), ascertaining, etc. In addition, "determine" may include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory), etc. In addition, "determine" may include resolving, selecting, choosing, establishing, etc.
[0065] It should be noted that the embodiments of the present disclosure may be implemented by hardware, software, or a combination of software and hardware. The hardware portion may be implemented using dedicated logic; the software portion may be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods may be implemented using computer executable instructions and / or contained in a processor control code, such as a programmable memory or a data carrier such as an optical or electronic signal carrier, providing such code.
[0066] In addition, although the operation of the method of the present disclosure is described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flow chart can change the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution. It should also be noted that the features and functions of two or more devices according to the present disclosure can be embodied in one device. Conversely, the features and functions of a device described above can be further divided into being embodied by multiple devices.
[0067] Although the present disclosure has been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed. The present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A storage management method, comprising: In response to the first storage disk becoming offline and remaining offline until a first time point, selecting a second storage block in the second storage disk as a spare storage block for a first storage block in the first storage disk, the first storage block being one of a plurality of storage blocks constituting a redundant array of independent disks (RAID), the plurality of storage blocks being located in different storage disks; Between the first time point and a second time point, writing the data of the first storage block to be written into the RAID into the second storage block, wherein the second time point is later than the first time point; as well as In response to the first storage disk remaining offline until the second time point, replacing the first storage block in the RAID with the second storage block; The method further comprises: In response to the first storage disk being restored online between the first time point and the second time point, the data in the second storage block is copied to the first storage block.
2. The method according to claim 1, wherein replacing the first storage block with the second storage block comprises: The data in the first storage block is rebuilt into the second storage block by using the data in other storage blocks in the RAID.
3. The method according to claim 2, wherein rebuilding the data in the first storage block into the second storage block comprises: Determining a stripe to which data is written in the RAID before the first storage disk becomes offline; For the identified bands, reading data associated with the stripe from other storage blocks in the RAID; Calculate the data associated with the stripe stored in the first storage block based on the read data; as well as The calculated data is written into the second storage block.
4. The method according to claim 1, further comprising: The stripe to which the data is written in the RAID between the first time point and the second time point is recorded so as to perform the copying.
5. The method according to claim 1, wherein copying the data in the second storage block to the first storage block comprises: Determine a stripe to which data is written in the RAID between the first time point and the second time point; as well as Data associated with the stripe in the second storage block is copied to the first storage block.
6. The method according to claim 1, wherein selecting the second storage block in the second storage disk as the spare storage block comprises: Selecting the second storage disk from a plurality of storage disks so that the plurality of storage disks are evenly used to form a plurality of RAIDs; as well as A free storage block in the second storage disk is selected as the second storage block.
7. The method according to claim 1, further comprising: The write operation to the RAID is suspended during the period from when the first storage disk becomes offline to the first time point.
8. An electronic device comprising: at least one processor; as well as at least one memory storing computer program instructions, the at least one memory and the computer program instructions being configured, together with the at least one processor, to cause the electronic device to: In response to the first storage disk becoming offline and remaining offline until a first time point, selecting a second storage block in the second storage disk as a spare storage block for a first storage block in the first storage disk, the first storage block being one of a plurality of storage blocks constituting a redundant array of independent disks (RAID), the plurality of storage blocks being located in different storage disks; Between the first time point and a second time point, writing the data of the first storage block to be written into the RAID into the second storage block, wherein the second time point is later than the first time point; and In response to the first storage disk remaining offline until the second time point, replacing the first storage block in the RAID with the second storage block; The at least one memory and the computer program instructions are further configured to, together with the at least one processor, cause the electronic device to: In response to the first storage disk being restored online between the first time point and the second time point, the data in the second storage block is copied to the first storage block.
9. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: The data in the first storage block is rebuilt into the second storage block by using the data in other storage blocks in the RAID.
10. The electronic device of claim 9, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: Determining a stripe to which data is written in the RAID before the first storage disk becomes offline; For the identified bands, reading data associated with the stripe from other storage blocks in the RAID; Calculate the data associated with the stripe stored in the first storage block based on the read data; as well as The calculated data is written into the second storage block.
11. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: The stripe to which the data is written in the RAID between the first time point and the second time point is recorded so as to perform the copying.
12. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: determining a stripe to which data is written in the RAID between the first time point and the second time point; and Data associated with the stripe in the second storage block is copied to the first storage block.
13. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: selecting the second storage disk from a plurality of storage disks so that the plurality of storage disks are evenly used to form a plurality of RAIDs; and A free storage block in the second storage disk is selected as the second storage block.
14. The electronic device of claim 8, wherein the at least one memory and the computer program instructions are further configured, together with the at least one processor, to cause the electronic device to: The write operation to the RAID is suspended during the period from when the first storage disk becomes offline to the first time point.
15. A computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions which, when executed, cause a machine to perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Optimized reconstruction and copyback methodology for a failed drive in the presence of a global hot spare disk
CN101523353A
Method for constructing disk array of horizontal grouping parallel distribution check
CN101976176A
Method and device for reconstructing independent redundancy array of inexpensive disks
CN103513942A
Method and device for revising hard disk information of redundant array group of independent disk (RAID)
CN104407806A
Data write-in method, apparatus and system
CN105138280A
