WO2014082216A1 - 数据恢复方法、数据恢复装置、存储器及存储系统 - Google Patents

数据恢复方法、数据恢复装置、存储器及存储系统 Download PDF

Info

Publication number
WO2014082216A1
WO2014082216A1 PCT/CN2012/085419 CN2012085419W WO2014082216A1 WO 2014082216 A1 WO2014082216 A1 WO 2014082216A1 CN 2012085419 W CN2012085419 W CN 2012085419W WO 2014082216 A1 WO2014082216 A1 WO 2014082216A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage medium
chunk
unreconstructed
occupied
Prior art date
Application number
PCT/CN2012/085419
Other languages
English (en)
French (fr)
Inventor
任仕飞
熊伟
舒坦
曹红强
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/085419 priority Critical patent/WO2014082216A1/zh
Priority to CN201280003016.7A priority patent/CN103975309B/zh
Publication of WO2014082216A1 publication Critical patent/WO2014082216A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems
    • G06F11/1088Reconstruction on already foreseen single or plurality of spare disks

Definitions

  • the present invention relates to the field of data processing technologies, and more particularly to a data recovery method, a data recovery device, a memory, and a storage system. Background technique
  • the common processing method is to delay for a period of time (which can be called delay time), if within the delay time,
  • delay time a period of time
  • full storage medium reconstruction is not initiated for the storage medium; and if the delay time is exceeded, full storage medium reconstruction is initiated for the exited storage medium.
  • full storage medium reconstruction refers to, for the exiting storage medium, calculating all or part of the data stored on the exiting storage medium according to the data stored in other storage media of the RAID group, and writing to other storage media of the RAID group. In this way, the purpose of restoring the data on the exiting storage medium can be achieved.
  • the purpose of the embodiments of the present invention is to provide a data recovery method, a data recovery device, a memory, and a storage system, so as to solve the problem that the data recovery takes a long time.
  • the embodiment of the present invention provides the following technical solutions:
  • a data recovery method including: performing full storage medium reconstruction for an exiting storage medium when a storage medium exits; detecting whether to perform full storage medium reconstruction There is new storage medium access;
  • the detecting whether the newly accessed storage medium is the same as the storage medium for which the full storage medium is being reconstructed includes: the serial number of the storage medium is the same, If they are the same, the test result is yes. If they are not the same, the test result is no.
  • the unreconstructed data occupies at least one chunk; the verifying the new access
  • the unreconstructed data in the storage medium specifically includes: checking each chunk occupied by the unreconstructed data by chunks.
  • each of the chunks includes at least one chunk; and each chunk that is occupied by the unreconstructed data includes: Each chunk of the data occupied by the constructor.
  • the performing, by the block-by-blocking, each of the chunks occupied by the unreconstructed data comprises: a chunk; or, verifying the selected partition in each chunk occupied by the unreconstructed data.
  • the unreconstructed data is determined according to the stored metadata.
  • the data that fails the validity check occupies at least one first chunk; and the data that is not validated by the unreconstructed data is performed.
  • the re-construction includes: reconstructing, for each first chunk, the data stored in the detected first chunk; or, after all the chunks occupied by the unreconstructed data are verified Reconstructing the data stored in all the detected first chunks.
  • the data that passes the validity check occupies at least one second chunk; the pair is not heavy
  • the data recovery through the validity check in the structured data may include: each detecting a second chunk, that is, recovering the data stored on the detected second chunk; or, in the unreconstructed After all the chunks occupied by the data are verified, the data stored on all the detected second chunks is restored.
  • a data recovery apparatus including: a full storage medium reconstruction unit, configured to perform full storage medium reconstruction for an exiting storage medium when a storage medium exits;
  • a detecting unit configured to detect whether a new storage medium is accessed when performing full storage medium reconstruction
  • An identification unit configured to detect, when a new storage medium is accessed, whether the newly accessed storage medium is the same as the storage medium for which the entire storage medium is being reconstructed, and obtain a detection result;
  • a control unit configured to stop the full storage medium reconstruction when the detection result is YES;
  • a check unit configured to check validity of unreconstructed data in the newly accessed storage medium
  • a first data recovery unit configured to pass validity check on the unreconstructed data Data recovery is available
  • a second data recovery unit configured to reconstruct data of the unreconstructed data that fails the validity check.
  • the detecting whether the newly accessed storage medium is the same as the storage medium for which the full storage medium reconstruction is being performed comprises: a sequence of the pair of storage media Whether the numbers are the same, if they are the same, the test result is yes, if they are not the same, the test result is no.
  • the unreconstructed data occupies at least one chunk;
  • the unreconstructed data in the newly accessed storage medium specifically includes: checking each chunk occupied by the unreconstructed data by chunks.
  • each of the chunks includes at least one chunk; and each chunk that is occupied by the unreconstructed data includes: Verify each chunk occupied by the unreconstructed data.
  • each chunk that is occupied by the unreconstructed data by the block check specifically includes: parsing the unreconstructed data by a block by block Each chunk occupied; or, the selected chunk in each chunk occupied by the unreconstructed data is checked.
  • the unreconstructed data is determined according to the stored metadata.
  • the data that fails the validity check occupies at least one first chunk; and the data that fails to pass the validity of the unreconstructed data
  • the data to be reconstructed specifically includes: each time a first chunk is detected, that is, the data stored in the detected first chunk is reconstructed; or, all the chunks occupied by the unreconstructed data are After the verification is completed, the data stored for all the detected first chunks are separately reconstructed.
  • the data that passes the validity check occupies at least one second chunk;
  • the data recovery by the validity check in the unreconstructed data may include: each detecting a second chunk, that is, recovering the data stored on the detected second chunk; or After all the chunks occupied by the reconstructed data are verified, the data stored on all the detected second chunks is restored.
  • a controller including a CPU and a memory, the CPU communicating with a storage medium through a communication interface, and storing the software program stored in the memory and calling the storage device To describe the data in the memory, perform the following steps:
  • the detecting whether the newly accessed storage medium is the same as the storage medium for which the full storage medium reconstruction is being performed comprises: a sequence of the pair of storage media Whether the numbers are the same, if they are the same, the test result is yes, if they are not the same, the test result is no.
  • the unreconstructed data occupies at least one chunk;
  • the unreconstructed data in the newly accessed storage medium specifically includes: checking each chunk occupied by the unreconstructed data by chunks.
  • each of the chunks includes at least one chunk; and each chunk that is occupied by the unreconstructed data includes: Each chunk of data that is not reconstructed is described.
  • each chunk that is occupied by the unblocked data by the block check specifically includes: parsing the unreconstructed data by a block by block Each chunk occupied; or, the selected chunk in each chunk occupied by the unreconstructed data is checked.
  • the unreconstructed data is determined according to the stored metadata.
  • the data that fails the validity check occupies at least one first chunk; and the validity of the unreconstructed data fails Reconstructing the verified data specifically includes: reconstructing, for each chunk, the data stored in the first chunk detected; or deleting all the chunks occupied by the unreconstructed data After the verification is completed, the data stored in all the detected first chunks are separately reconstructed.
  • the data that passes the validity check occupies at least one second chunk;
  • the data recovery by the validity check in the unreconstructed data may include: each detecting a second chunk, that is, recovering the detected data stored on the second chunk; or, in the After all the chunks occupied by the reconstructed data are verified, the data stored on all the detected second chunks is restored.
  • a storage system including at least two storage media and the above data recovery device is provided.
  • a storage system including at least two storage media and the controller.
  • the full storage medium reconstruction is stopped, and the newly accessed storage medium is The validity of the unreconstructed data in the storage medium is verified, and the data recovery through the validity check is available, thereby avoiding data reconstruction by the validity check to other storage media, and the prior art
  • the reconstruction time of the data verified by the validity is saved, thereby reducing the time required for data recovery, and at the same time reducing the occupation of storage space of other storage media.
  • Figure la is a schematic diagram of hardware RAID provided by an embodiment of the present invention.
  • Figure lb is a schematic diagram of a RAID group composition provided by an embodiment of the present invention.
  • FIG. 2 is a flowchart of a data recovery method according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram showing the composition of a stripe according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a situation before the disk 1 is unplugged according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a final result according to an existing processing manner according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a final result of processing a data recovery method according to an embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of a data recovery apparatus according to an embodiment of the present invention.
  • FIG. 8a and 8b are schematic structural diagrams of a controller according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a storage system according to an embodiment of the present disclosure.
  • FIG. 10 is another schematic structural diagram of a storage system according to an embodiment of the present invention. DETAILED DESCRIPTION
  • abbreviations or abbreviations used below are summarized as follows:
  • RAID Redundant Arrays of Inexpensive Disks, Redundant Array of Independent Disks; chunk: Abbreviated as CK, is a small contiguous space where storage media is partitioned according to the specified granularity;
  • SCSI Small Computer System Interface, small computer system interface. A stand-alone processor standard for system-level interfaces between computers and smart devices (hard disks, floppy drives, optical drives, printers, scanners, etc.). SCSI is an intelligent, universal interface standard. It is the interface standard between various computers and external devices;
  • iSCSI Internet Small Computer System Interface, Internet small computer system interface
  • FC Fiber Channel, Guangxiang thousand channels
  • SSD solid state disk, solid state drive
  • IDE Integrated-Drive-Electronics, electronic integrated drive.
  • the IDE is an external interface that is now commonly used, mainly connecting hard disks and optical drives;
  • ID IDentity, identification number
  • PCI Peripheral Component Interconnect, the standard for interconnecting components
  • SATA Serial Advanced Technology Attachment
  • a serial advanced technology accessory an industry-standard serial hardware driver interface
  • Intel Intel, IBM, Dell, APT, Maxtor, and Seagate.
  • the storage medium may include at least one of a logical hard disk (for example, virtualizing a volume on one storage device as a logical hard disk), a physical hard disk, an SSD, and an optical disk.
  • a logical hard disk for example, virtualizing a volume on one storage device as a logical hard disk
  • a physical hard disk for example, a hard disk
  • an SSD for example, a hard disk
  • an optical disk for example, a logical hard disk
  • full storage medium reconfiguration can be performed for the exiting storage medium.
  • the timing of performing full storage medium reconstruction may be that the storage medium is reconstructed immediately when the storage medium exits, or a time threshold (that is, the foregoing delay time) may be set. If the threshold is reached, the exiting storage medium has not been re-established. Access, then perform full storage medium reconfiguration.
  • the full storage medium reconstruction may use the data stored by all the remaining storage media in the storage system, or may use the data stored in a part of the storage medium in the remaining storage medium in the storage system, as long as the exiting storage medium can be recovered.
  • the data can be.
  • the storage medium for the full storage medium reconstruction in the embodiment of the present invention is the exiting storage medium, and the number thereof may be one or more.
  • the exit of the storage medium means that the storage medium cannot be used normally.
  • a certain hard disk is pulled out of the storage system or powered off.
  • the embodiment of the present invention can be applied to a storage system based on RAID for data protection, and can also be applied to a storage system based on other data protection, as long as all or part of the storage medium remaining in the storage system can be utilized, and the exiting storage medium is performed. Data recovery can be done.
  • RAID will be introduced as an example.
  • RAID is divided into software RAID and hardware RAID.
  • software RAID is a disk management function provided by a computer operating system (such as Windows, Netware, and Linux), and a plurality of storage media connected to the computer are configured into a RAID group. All operations in software RAID are handled by the central processing unit of the computer.
  • the hardware RAID mainly includes a storage controller mode: Referring to FIG. 1a, the storage controller 101 is connected to the computer 102 through an interface card (SCSI, iSCSK FC), and the storage controller 101 is connected to a plurality of storage media 103.
  • a computer + storage medium (software RAID) or a storage controller + storage medium (hardware RAID) can be configured with a RAID group, which is implemented by: a computer processor or a storage controller divides the storage space of each storage medium into small segments according to a specified granularity. The contiguous space-chunk (also called partition), and then randomly selects a certain number of storage media from the storage medium according to the requirements of the raid level, and randomly selects one chunk to form a RAID group on each of the selected storage media.
  • a computer processor or a storage controller divides the storage space of each storage medium into small segments according to a specified granularity.
  • the contiguous space-chunk also called partition
  • the physical hard disk Diskl-Disk5 is the selected storage medium, and each physical hard disk is divided into 4 chunks (chunk-chunk4), and the 4 chunks are allocated to 4 RAID groups (RAIDGroupl to RAIDGroup 4).
  • the common processing method is to delay for a period of time (the specific delay time may be several tens of seconds to several minutes). If the exiting storage medium is re-accessed within the delay time, the full storage medium reconstruction is not initiated, but the rewritten data in the storage medium is restored according to the log or other manner of recording;
  • the full storage medium reconstruction is initiated for the exiting storage medium, that is, all or part of the data stored on the exiting storage medium is calculated according to the data stored in the other storage medium of the RAID group, and written. Go to the chunk on the other storage medium of the RAID group to achieve the purpose of restoring the data on the exiting storage medium.
  • the inventors have found that, in the process of performing full storage medium reconstruction, if the exiting storage medium is re-accessed to the RAID group, the storage medium will be identified as a new storage medium. The data will also be considered unavailable. That is, even if the exiting storage medium is re-accessed, the full storage medium reconstruction will continue.
  • the storage of the entire storage medium takes a long time, which results in a longer time for data recovery. Taking a typical 2TB capacity SATA disk as an example, it takes about 2 hours to perform full storage medium reconstruction.
  • an embodiment of the present invention provides a data recovery method. Referring to FIG. 2, the method includes at least the following steps:
  • the step S1 may specifically include: when the storage medium exits, the needle is immediately retracted when the storage medium is exited. Performing full storage medium reconstruction on the exiting storage medium;
  • step S1 may specifically include: setting a time threshold, and if the threshold is reached, the exiting storage medium is not re-accessed, and then the full storage medium is reconstructed.
  • the purpose of the check is to determine whether data has not been rewritten in the unreconstructed data. If the rewritten data has no validity, it will not pass the validity check, and the unrewritten data will have validity. check.
  • the data stored in the storage medium that is newly accessed (and identified as being the same as the storage medium for which the entire storage medium is being reconstructed) has been reconstructed.
  • the data on other storage media is "reconstructed data”
  • the data that is not reconstructed to other storage media is "unreconstructed data”.
  • the reconstruction needs to calculate the data stored on the exiting storage medium and write it to other storage media, in the present embodiment, the "data verified by validity" can be directly restored and available without being written. On other storage media, it also reduces the storage space of other storage media. Below, a more detailed introduction will be made.
  • each of the storage media in the above embodiments has a unique identifier, called a WWN.
  • the identifier can be a serial number. Therefore, in the above step S3, "detecting whether the newly accessed storage medium and the storage medium for which the entire storage medium is being reconstructed is the same, and obtaining the detection result" can be realized as follows: Is the serial number of the storage medium The same, if the same, the test result is yes, if not the same, the test result is no.
  • the serial number of the storage medium for which the full storage medium reconstruction is being performed is retained (recorded), and the serial number can be recorded in the computer/storage controller Cache, or recorded on a certain / some storage medium, so that when the new storage medium is accessed, the serial number of the newly accessed storage medium is the same as the recorded serial number, and the detection result is obtained. .
  • the recorded serial number may be deleted or may not be deleted.
  • the allocated space information (which may be referred to as metadata) of each storage medium in all of the above embodiments may be recorded on a cache of the computer/storage controller, or recorded in a certain storage medium. on. It will be understood by those skilled in the art that the data stored in the unallocated space on the storage medium need not be reconstructed or restored available. In this way, when the newly accessed storage medium is the same as the storage medium for which the full storage medium reconstruction is being performed, the controller may determine, according to the stored metadata, that the newly accessed storage medium is not heavily executed. The region is constructed to determine unreconstructed data, which is described in detail herein below.
  • the storage space of the storage medium is divided into chunks according to the specified granularity. Therefore, the allocated space of the storage medium also includes at least one chunk, and correspondingly, the allocated spatial information (ie, metadata) of the storage medium is also Chunk related.
  • the above metadata is related to the serial number of the storage medium and the chunk ID.
  • the physical hard disk Diskl-Disk5 is still taken as an example. Assume that each physical hard disk in Diskl-Disk5 is divided into 4 chunks (chunk - chunk4). When configuring a RAID group, you can determine the number of chunks required to form a RAID group based on the RAID level. Here, it is assumed that 4 chunks are required to form a RAID group. Then, it can be configured to form RAIDGroupl by 4 chunkl in Diskl-Disk4, and RAID2 by 4 chunk2 in Diskl-Disk4, by Diskl- The four chunk3s in Disk4 constitute RAIDGroup3, and the four chunk4s in Diskl-Disk4 constitute RAIDGroup4. For example, in the above metadata, it is described that the RAID Group1 is composed of chunk1 of Disk1, chunk 1 of Disk 2, chunk 1 of Disk 3, and chunk 1 of Disk 4.
  • the storage medium reconstruction can be performed according to the description of the metadata: After the storage medium is exited, by searching for the metadata, the chunk ID of the storage medium belonging to the exit in the metadata can be found, so that other storage media according to the RAID group can be obtained.
  • the stored data calculates the data stored in the chunk corresponding to the chunk ID.
  • the chunk ID of the storage medium belonging to the newly accessed data recorded in the metadata can be found.
  • the chunks identified by the chunk IDs belonging to the new access storage medium are the regions in which the reconstruction is not performed, and the data stored on the regions not reconstructed are not reconstructed into other storage media, that is, in the metadata.
  • the data stored on the chunk identified by the chunk ID of the newly accessed storage medium is the unreconstructed data.
  • Diskl After Diskl exits, the full storage medium reconstruction for Diskl is started. It is assumed that during the process of reconstituting the entire storage medium, the data on the chunkl of the exited Diskl has been calculated and written to the chunk1 of Disk5. At this point, Diskl re-accesses.
  • RAIDGroup1 is composed of chunkl of Diskl, chunkl of Disk2, chunkl of Disk3, and chunkl of Disk4, and when Diskl is re-accessed, in the description of metadata, RAIDGroupl It becomes composed of chunk1 of Disk2, chunkl of Disk3, chunkl of Disk4, and chunkl of Disk5.
  • RAIDGroup1 is composed of chunkl of Diskl, chunkl of Disk2, chunkl of Disk3, and chunkl of Disk4, and when Diskl is re-accessed, in the description of metadata, RAIDGroupl It becomes composed of chunk1 of Disk2, chunkl of Disk3, chunkl of Disk4, and chunkl of Disk5.
  • RAIDGroup1 is composed of chunkl of Diskl, chunkl of Disk2, chunkl of Disk3, and chunkl of Disk4.
  • RAIDGroup3 is still composed of chimk3 of Diskl, chimk3 of Disk2, chunk3 of Disk3, and chunk3 of Disk4.
  • the RAIDGroup4 is still composed of chimk4 of Diskl, chimk4 of Disk2, chimk4 of Disk3, and chunk4 of Disk4.
  • Unreconstructed data occupies at least one chunk.
  • "check new The unreconstructed data in the accessed storage medium may also include: checking each chunk occupied by the unreconstructed data by chunks. That is, not being heavy on the newly accessed storage medium. The constructed data is checked by chunk.
  • each chunk may in turn be divided into at least one chunk.
  • the chimkl in the physical hard disk Diskl-Disk5 is divided into four partitions (A1-A4), and the chunks at the same position of each Chunkl form a stripe.
  • the five partitions A1 together form a stripe 1 (stripel), and the five sub-blocks A2 together form a stripe 2 ( stripe2 ), and so on.
  • each RAID group includes one or more stripes.
  • one of the blocks A1 can be used as a check block to store check data
  • the other four blocks A1 can be used as four data blocks.
  • the check data is generated by XORing the data on the four data blocks.
  • the check data can also be generated by other operations.
  • the data on the exited data block can be calculated by the check data stored in the check block and the data stored in other data blocks in the stripe 1, and the calculation will be performed.
  • the result is written to the chunk of the other storage media in the RAID group.
  • the check data stored on the exit check block may be regenerated according to the data stored in the data block, and the calculation result is written to the chunk of the other storage medium of the RAID group. on.
  • the foregoing full storage medium reconstruction may be performed on a chunk by block basis (blocking) according to the description of the metadata, that is, assuming diskl exits, according to the metadata, According to the order from chunkl-chunk4, the data stored in each chunk of each chunk of diskl is calculated according to the stripe, and the calculation result is written to the chunk of other storage medium of the RAID group.
  • the exiting storage medium when the exiting storage medium is re-accessed, the following may exist: The data stored in a part of the chunk on a certain chunk of the storage medium that is re-accessed and re-accessed has been reconstructed to other by calculation. The data stored on the storage medium, but the remaining blocks are not reconstructed onto other storage media. For example, after Diskl exits and re-accesses, the data stored in A1 and A2 on the chunk1 of Diskl has been calculated, and the calculation result is saved in chunk1 of Disk5, but the chunk1 of Diskl has not been calculated yet. Data stored by A3 and A4.
  • the foregoing “stopping the full storage medium reconstruction” may specifically include: stopping the full storage medium reconstruction after reconstructing the data on the chunk currently targeted for the full storage medium reconstruction.
  • the foregoing "checking each chunk occupied by unreconstructed data” can be further refined to include: chunking to verify each chunk occupied by unreconstructed data.
  • a chunk can include more than one chunk, so when it is checked by chunks, it can be done in at least two ways:
  • the first way is: Check each chunk occupied by unreconstructed data on a block by block basis. That is, if a chuck contains 8 partitions, the data stored in the 8 partitions will be verified in sequence during verification. In the first mode, the data stored in the 8 blocks must pass the check, and the data stored in the entire chunk passes the validity check. If the data stored in any of the 8 blocks does not pass the check, the data stored in the entire chunk fails the validity check.
  • the second way is to verify the selected partition in each chunk occupied by the unreconstructed data. Still assuming that there are 8 chunks in a chuck, you can choose to verify any one or several of the eight chunks.
  • the data stored in the selected block must pass the check, and the data stored in the entire chunk passes the validity check. If the data stored in any of the selected partitions fails to pass the check, the data stored in the entire chunk fails the validity check.
  • the second method can achieve faster data recovery because the amount of data read and verified is less.
  • the verification performed for a certain block may refer to the existing stripe check technique, and will not be described herein.
  • the stripe check verifies that the data stored in the data block in the stripe is overwritten. If it is not rewritten, the data stored in the data block is valid. Otherwise, the data stored in the data block is invalid.
  • each chunk occupied by data that fails the validity check may be referred to as a first chunk, that is, data that fails the validity check occupies at least one "first chunk”;
  • Each chunk occupied by the data of the sex check is referred to as a second chunk, that is, the data verified by the validity occupies at least one "second chunk”.
  • step S7 may specifically include:
  • the data stored in the detected “first chunk” is reconstructed, that is, the RAID of the detected “first chunk” is determined according to the metadata.
  • the group and other chunks included in the RAID group calculate the detected data on the "first chunk” according to the data stored in the other chunks, thereby obtaining the calculation result, and writing the calculation result to the chunk of the other storage medium;
  • the RAID group to which each "first chunk” belongs and other chunks included in the RAID group are determined according to the metadata, according to the RAID of each "first chunk".
  • the data stored in other chunks in the group calculates the data on each "first chunk” and writes the calculation result to the chunk of other storage medium.
  • step S6 may specifically include:
  • a person skilled in the art can perform flexible combination, for example, every time a "second chunk” is detected, that is, data recovery on the detected “second chunk” is available, but is not reconstructed. After all the chunks occupied by the data are verified, all the detected "first chunks” are reconstructed. After all the chunks occupied by the unreconstructed data are verified, the detection is performed. The data stored in all the “second chunks” is available for recovery, and all the “first chunks" detected are reconstructed; each "second chunk” is also detected, that is, the detected “second chunk” "The stored data is available for recovery, and each time a "first chunk” is detected, that is, it is reconstructed, etc., and will not be described here.
  • the Diskl is re-accessed, and the unreconstructed data can be verified, and the data verified by the validity can be avoided.
  • the write operation can save the reconstruction time of the data that has passed the validity check in the unreconstructed data. Due to the shortening of the reconstruction time, the risk of double disk failure during the whole storage medium reconstruction process is greatly reduced, and the influence of the reconstructed write operation of the relevant storage medium on the host 10 (Input/Output) can be avoided, and the performance is guaranteed. .
  • the storage medium that is logged out and re-accessed will be identified as a new storage medium, and thus new logical information will be allocated for the re-accessed storage medium. If a storage medium is frequently logged out and accessed, the logical information records for the same storage medium may be frequently repeated, and even related resources may be exhausted (such as the memory space occupied during the running process and other storage space occupied by the persistent storage). .
  • the technical solution provided by the embodiment of the present invention detects whether the newly accessed storage medium and the storage medium for which the entire storage medium is being reconstructed is the same. When the two are the same, New logical information is allocated for re-entering the storage medium, thereby avoiding the frequent repetition of logical information records for the same storage medium, and even the problem of exhausting related resources by related resources.
  • the storage medium may be shielded, and the blocked storage medium is regarded as the exit regardless of whether it is actually in the exit state or in the access state.
  • a preset condition may be set by a person skilled in the art according to the actual situation. For example, the preset condition may be set to the number of exits within one hour being greater than or equal to the threshold, and the value of the threshold may be any natural number.
  • the execution body of the data recovery method claimed in all the above embodiments may be the foregoing computer processor or storage controller, and the computer processor or the storage controller may be used as the data recovery device.
  • the data is The recovery device can include:
  • the full storage medium reconstruction unit 700 is configured to perform full storage medium reconstruction for the exiting storage medium when the storage medium exits;
  • the detecting unit 701 is configured to detect whether a new storage medium is accessed when performing full storage medium reconstruction;
  • the identifying unit 702 is configured to detect, when a new storage medium is accessed, whether the newly accessed storage medium is the same as the storage medium for which the entire storage medium is being reconstructed, and obtain a detection result; the full storage medium
  • the reconstruction control unit 703 is configured to stop the full storage medium reconstruction when the detection result is YES (that is, when the detection result is YES, the full storage medium reconstruction control unit 703 controls the full storage medium reconstruction Unit 700 stops the full storage medium reconstruction operation);
  • a checking unit 704 configured to verify validity of unreconstructed data in the accessed storage medium
  • the first data recovery unit 705 is configured to recover data that passes the validity check in the unreconstructed data
  • the second data recovery unit 706 is configured to reconstruct data that has not passed the validity check in the unreconstructed data.
  • the controller 800 may include a CPU 81 and a memory 82 on the hardware, wherein the CPU 81 passes The communication interface 811 is in communication with the storage medium 83, and by running the software program 821 stored in the memory 82 and calling the data stored in the memory 82, the following steps can be performed:
  • the foregoing memory 82 may specifically be an SSD, and the SSD may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function (for example, the software program 821 described above).
  • the data storage area can store the data finally generated according to the execution of the CPU.
  • the intermediate data generated by the CPU in executing the above steps it is stored in the memory.
  • the storage controller may specifically include a CPU, a motherboard, a memory, a memory, a power source, a battery, and a fan.
  • the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, and a flash memory. Devices, or other volatile solid-state storage devices.
  • the memory in the memory controller may also include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, and the like, and the data storage area may be stored according to The resulting data of the CPU's execution. Moreover, the intermediate data generated by the CPU when performing the above steps may also be stored in the memory of the storage controller.
  • Figure 9 shows a structure of a storage system to be protected by an embodiment of the present invention: comprising a data recovery device 91 and at least two storage media 92.
  • the data recovery device 91 communicates with the storage medium 92 via a communication interface.
  • the structure of the data recovery device is shown in Figure 7, and will not be described here.
  • Figure 10 shows another structure of the memory system to be protected by the present invention: comprising a controller 800 and at least two storage media 83; the specific structure of the controller 800 can be seen in Figures 8a and 8b: it can include a CPU 81 and a memory 82.
  • the CPU 81 communicates with the storage medium 83 through the communication interface 811. The following steps are performed by running a software program stored in the memory and calling data stored in the memory:
  • the present invention can be implemented by means of software plus necessary general hardware including general-purpose integrated circuits, general-purpose CPUs, general-purpose memories, general-purpose components, and the like.
  • general-purpose integrated circuits general-purpose CPUs
  • general-purpose memories general-purpose components
  • dedicated hardware including an application specific integrated circuit, a dedicated CPU, a dedicated memory, a dedicated component, etc., but in many cases, the former is a better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, can be embodied in the form of a software product.
  • the product can be stored in a readable storage medium, such as a USB flash drive, a removable storage medium, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or a compact disk.
  • a readable storage medium such as a USB flash drive, a removable storage medium, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or a compact disk.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or a compact disk a compact disk.
  • a variety of media that can store software program code, including instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例公开了数据恢复方法、数据恢复装置及存储器。上述数据恢复方法包括:在进行全存储介质重构时,检测是否有新的存储介质接入;当有新的存储介质接入时,检测新接入的存储介质与正在执行的全存储介质重构所针对的存储介质是否为同一个,得出检测结果;当检测结果为是时,停止全存储介质重构;校验存储介质中未被重构的数据;对未被重构的数据中通过有效性校验的数据恢复可用;对未被重构的数据中未通过有效性校验的数据进行重构。

Description

数据恢复方法、 数据恢复装置、 存储器及存储系统 技术领域 本发明涉及数据处理技术领域, 更具体地说, 涉及数据恢复方法、 数据 恢复装置、 存储器及存储系统。 背景技术
在 RAID技术中, 当某一存储介质因故障或被拔出等原因而退出 RAID组 ( RAID Group )时, 常见的处理方式是延迟一段时间 (可称为延迟时间), 如 果在延迟时间内, 存储介质重新接入, 则不会针对该存储介质启动全存储介 质重构; 而如果超过延迟时间, 则针对该退出的存储介质启动全存储介质重 构。 所谓的全存储介质重构是指, 针对退出的存储介质, 依据 RAID组其他存 储介质所存储的数据计算出退出的存储介质上所存储的全部或部分数据, 并 写入到 RAID组其他存储介质上, 这样可以达到恢复该退出的存储介质上的数 据的目的。
然而, 在进行全存储介质重构过程中, 如退出的存储介质再接入, 其上 的数据将被认为不可用, 而全存储介质重构又需要占用较长的时间, 进而造 成数据恢复所需时间较长。 发明内容
有鉴于此, 本发明实施例的目的在于提供数据恢复方法、 数据恢复装置、 存储器及存储系统, 以解决数据恢复需要时间较长的问题。
为实现上述目的, 本发明实施例提供如下技术方案:
根据本实用新型实施例的第一方面, 提供一种数据恢复方法, 包括: 当有存储介质退出时, 针对退出的存储介质进行全存储介质重构; 在进行全存储介质重构时, 检测是否有新的存储介质接入;
当有新的存储介质接入时, 检测新接入的存储介质与正在执行的全存储 介质重构所针对的存储介质是否为同一个, 得出检测结果;
当检测结果为是时, 停止所述全存储介质重构;
校验所述新接入的存储介质中未被重构的数据的有效性;
对所述未被重构的数据中通过有效性校验的数据恢复可用;
对所述未被重构的数据中未通过有效性校验的数据进行重构。 在第一种可能的实现方式中, 所述检测新接入的存储介质与正在执行的 全存储介质重构所针对的存储介质是否为同一个具体包括: 对的存储介质的序列号是否相同, 如果相同, 检测结果为是, 如果不相同, 检测结果为否。
结合第一方面, 或第一方面的第一种可能的实现方式, 在第二种可能的 实现方式中, 所述未被重构的数据占用至少一个 chunk; 所述校验所述新接入 的存储介质中未被重构的数据具体包括: 逐 chunk检验所述未被重构的数据 所占用的每一 chunk。
在第三种可能的实现方式中, 每个所述 chunk 包括至少一个分块; 所述 检验所述未被重构的数据所占用的每一 chunk具体包括: 按分块校验所述未 被重构的数据所占用的每一 chunk。
在第四种可能的实现方式中, 所述按分块校验所述未被重构的数据所占 用的每一 chunk 具体包括: 逐分块校验所述未被重构的数据所占用的每一 chunk; 或者, 校验所述未被重构的数据所占用的每一 chunk中的选定分块。
结合第一方面, 或第一方面的第一种可能的实现方式, 或第一方面的第 二种可能的实现方式, 或第一方面的第三种可能的实现方式, 或第一方面的 第四种可能的实现方式, 在第五种可能的实现方式中, 所述未被重构的数据 是根据已存储的元数据确定出的。
结合第一方面的第二种可能的实现方式, 或第一方面的第三种可能的实 现方式, 或第一方面的第四种可能的实现方式, 或第一方面的第五种可能的 实现方式, 在第六种可能的实现方式中, 所述未通过有效性校验的数据占用 至少一个第一 chunk;所述对所述未被重构的数据中未通过有效性校验的数据 进行重构具体包括: 每检测出一个第一 chunk, 即针对检测出的第一 chunk所 存储的数据进行重构; 或者, 在所述未被重构的数据所占用的全部 chunk 均 校验完成后, 针对检测出的所有第一 chunk所存储的数据分别进行重构。
结合第一方面的第二种可能的实现方式, 或第一方面的第三种可能的实 现方式, 或第一方面的第四种可能的实现方式, 或第一方面的第五种可能的 实现方式, 或第一方面的第六种可能的实现方式, 在第七种可能的实现方式 中, 所述通过有效性校验的数据占用至少一个第二 chunk; 所述对所述未被重 构的数据中通过有效性校验的数据恢复可用具体包括: 每检测出一个第二 chunk, 即对检测出的第二 chunk上所存储的数据恢复可用; 或者, 在所述未 被重构的数据所占用的全部 chunk均校验完成后,对检测出的所有第二 chunk 上所存储的数据恢复可用。 根据本实用新型实施例的第二方面, 提供一种数据恢复装置, 包括: 全存储介质重构单元, 用于当有存储介质退出时, 针对退出的存储介质 进行全存储介质重构;
检测单元, 用于在进行全存储介质重构时, 检测是否有新的存储介质接 入;
识别单元, 用于当有新的存储介质接入时, 检测新接入的存储介质与正 在执行的全存储介质重构所针对的存储介质是否为同一个, 得出检测结果; 全存储介质重构控制单元, 用于当所述检测结果为是时, 停止所述全存 储介质重构;
校验单元, 用于校验所述新接入的存储介质中未被重构的数据的有效性; 第一数据恢复单元, 用于对所述未被重构的数据中通过有效性校验的数 据恢复可用;
第二数据恢复单元, 用于对所述未被重构的数据中未通过有效性校验的 数据进行重构。
在第二方面的第一种可能的实现方式中, 所述检测新接入的存储介质与 正在执行的全存储介质重构所针对的存储介质是否为同一个具体包括: 对的存储介质的序列号是否相同, 如果相同, 检测结果为是, 如果不相同, 检测结果为否。
结合第二方面, 或第二方面的第一种可能的实现方式, 在第二方面的第 二种可能的实现方式中, 所述未被重构的数据占用至少一个 chunk; 所述校验 所述新接入的存储介质中未被重构的数据具体包括: 逐 chunk检验所述未被 重构的数据所占用的每一 chunk。
在第二方面的第三种可能的实现方式中, 每个所述 chunk 包括至少一个 分块; 所述检验所述未被重构的数据所占用的每一 chunk具体包括: 按分块 校验所述未被重构的数据所占用的每一 chunk。
在第二方面的第四种可能的实现方式中, 所述按分块校验所述未被重构 的数据所占用的每一 chunk具体包括: 逐分块校验所述未被重构的数据所占 用的每一 chunk; 或者, 校验所述未被重构的数据所占用的每一 chunk中的选 定分块。
结合第二方面, 或第二方面的第一种可能的实现方式, 或第二方面的第 二种可能的实现方式, 或第二方面的第三种可能的实现方式, 或第二方面的 第四种可能的实现方式, 在第二方面的第五种可能的实现方式中, 所述未被 重构的数据是根据已存储的元数据确定出的。
结合第二方面的第二种可能的实现方式, 或第二方面的第三种可能的实 现方式, 或第二方面的第四种可能的实现方式, 或第二方面的第五种可能的 实现方式, 在第二方面的第六种可能的实现方式中, 所述未通过有效性校验 的数据占用至少一个第一 chunk;所述对所述未被重构的数据中未通过有效性 校验的数据进行重构具体包括: 每检测出一个第一 chunk, 即针对检测出的第 一 chunk所存储的数据进行重构; 或者, 在所述未被重构的数据所占用的全 部 chunk均校验完成后,针对检测出的所有第一 chunk所存储的数据分别进行 重构。
结合第二方面的第二种可能的实现方式, 或第二方面的第三种可能的实 现方式, 或第二方面的第四种可能的实现方式, 或第二方面的第五种可能的 实现方式, 或第二方面的第六种可能的实现方式, 在第二方面的第七种可能 的实现方式中, 所述通过有效性校验的数据占用至少一个第二 chunk; 所述对 所述未被重构的数据中通过有效性校验的数据恢复可用具体包括: 每检测出 一个第二 chunk, 即对检测出的第二 chunk上所存储的数据恢复可用; 或者, 在所述未被重构的数据所占用的全部 chunk 均校验完成后, 对检测出的所有 第二 chunk上所存储的数据恢复可用。
根据本实用新型实施例的第三方面, 提供一种控制器, 包括 CPU和存储 器, 所述 CPU通过通信接口与存储介质通信, 并通过运行存储在所述存储器 内的软件程序以及调用存储在所述存储器内的数据, 执行如下步骤:
当有存储介质退出时, 针对退出的存储介质进行全存储介质重构; 在进行全存储介质重构时, 检测是否有新的存储介质接入; 当有新的存储介质接入时, 检测新接入的存储介质与正在执行的全存储 介质重构所针对的存储介质是否为同一个, 得出检测结果;
当检测结果为是时, 停止所述全存储介质重构;
校验所述新接入的存储介质中未被重构的数据的有效性;
对所述未被重构的数据中通过有效性校验的数据恢复可用;
对所述未被重构的数据中未通过有效性校验的数据进行重构。
在第三方面的第一种可能的实现方式中, 所述检测新接入的存储介质与 正在执行的全存储介质重构所针对的存储介质是否为同一个具体包括: 对的存储介质的序列号是否相同, 如果相同, 检测结果为是, 如果不相同, 检测结果为否。
结合第三方面, 或第三方面的第一种可能的实现方式, 在第三方面的第 二种可能的实现方式中, 所述未被重构的数据占用至少一个 chunk; 所述校验 所述新接入的存储介质中未被重构的数据具体包括: 逐 chunk检验所述未被 重构的数据所占用的每一 chunk。
在第三方面的第三种可能的实现方式中, 每个所述 chunk 包括至少一个 分块; 所述检验所述未被重构的数据所占用的每一 chunk具体包括: 按分块 校验所述未被重构的数据所占用的每一 chunk。
在第三方面的第四种可能的实现方式中, 所述按分块校验所述未被重构 的数据所占用的每一 chunk具体包括: 逐分块校验所述未被重构的数据所占 用的每一 chunk; 或者, 校验所述未被重构的数据所占用的每一 chunk中的选 定分块。
结合第三方面, 或第三方面的第一种可能的实现方式, 或第三方面的第 二种可能的实现方式, 或第三方面的第三种可能的实现方式, 或第三方面的 第四种可能的实现方式, 在第三方面的第五种可能的实现方式中, 所述未被 重构的数据是根据已存储的元数据确定出的。
结合第三方面的第二种可能的实现方式, 或第三方面的第三种可能的实 现方式, 或第三方面的第四种可能的实现方式, 或第三方面的第五种可能的 实现方式, 在第三方面的第六种可能的实现方式中, 所述未通过有效性校验 的数据占用至少一个第一 chunk;所述对所述未被重构的数据中未通过有效性 校验的数据进行重构具体包括: 每检测出一个第一 chunk, 即针对检测出的第 一 chunk所存储的数据进行重构; 或者, 在所述未被重构的数据所占用的全 部 chunk均校验完成后,针对检测出的所有第一 chunk所存储的数据分别进行 重构。
结合第三方面的第二种可能的实现方式, 或第三方面的第三种可能的实 现方式, 或第三方面的第四种可能的实现方式, 或第三方面的第五种可能的 实现方式, 或第三方面的第六种可能的实现方式, 在第三方面的第七种可能 的实现方式中, 所述通过有效性校验的数据占用至少一个第二 chunk; 所述对 所述未被重构的数据中通过有效性校验的数据恢复可用具体包括: 每检测出 一个第二 chunk,即对检测出的该第二 chunk上所存储的数据恢复可用;或者, 在所述未被重构的数据所占用的全部 chunk 均校验完成后, 对检测出的所有 第二 chunk上所存储的数据恢复可用。
根据本实用新型实施例的第四方面, 结合上述第二方面或第二方面的任 一种可能的实现方式, 提供一种存储系统, 包括至少两个存储介质和上述数 据恢复装置。
根据本实用新型实施例的第五方面, 结合上述第三方面或第三方面的任 一种可能的实现方式, 提供一种存储系统, 包括至少两个存储介质和上述控 制器。
可见, 在本发明实施例中, 当新接入的存储介质与正在执行的全存储介 质重构所针对的退出的存储介质为同一个时, 将停止全存储介质重构, 对新 接入的存储介质中未被重构的数据的有效性进行校验, 并对通过有效性校验 的数据恢复可用, 从而避免了通过有效性校验的数据重构至其他存储介质上, 与现有技术相比, 节省了通过有效性校验的数据的重构时间, 从而减少了数 据恢复所需时间, 同时, 也减少了对其他存储介质存储空间的占用。
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 la为本发明实施例提供的硬件 RAID示意图;
图 lb为本发明实施例提供的 RAID组组成示意图;
图 2为本发明实施例提供的数据恢复方法流程图;
图 3为本发明实施例提供的分条组成示意图;
图 4为本发明实施例提供的 Diskl未被拔出前的情况示意图;
图 5为本发明实施例提供的按照现有处理方式最终结果示意图; 图 6 为本发明实施例提供的按照本发明实施例所提供的数据恢复方法进 行处理的最终结果示意图;
图 7为本发明实施例提供的数据恢复装置结构示意图;
图 8a和图 8b为本发明实施例提供的控制器结构示意图;
图 9为本发明实施例提供的存储系统结构示意图;
图 10为本发明实施例提供的存储系统另一结构示意图。 具体实施方式 为了引用和清楚起见, 下文中使用的技术名词、 简写或缩写总结解释如 下:
RAID: Redundant Arrays of Inexpensive Disks, 独立磁盘冗余阵列; chunk: 缩写为 CK, 是存储介质按照指定粒度分割成的小段连续空间; SCSI: Small Computer System Interface, 小型计算机系统接口。 一种用于 计算机和智能设备(硬盘、 软驱、 光驱、 打印机、 扫描仪等)之间系统级接 口的独立处理器标准。 SCSI是一种智能的通用接口标准。它是各种计算机与 外部设备之间的接口标准;
iSCSI: Internet Small Computer System Interface , 互联网小型计算机系统 接口;
FC, Fiber Channel, 光乡千信道;
SSD: solid state disk, 固态硬盘;
IDE: Integrated-Drive-Electronics , 电子集成驱动器。 IDE是现在普遍使 用的外部接口, 主要接硬盘和光驱;
ID: IDentity, 身份标识号码; PCI: Peripheral Component Interconnect , 夕卜设组件互连标准;
SATA: Serial Advanced Technology Attachment, 串行高级技术附件, 一种 基于行业标准的串行硬件驱动器接口, 是由 Intel、 IBM, Dell、 APT, Maxtor 和 Seagate公司共同提出的硬盘接口规范。
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
需要特别说明的是, 本发明实施例中, 存储介质可包括逻辑硬盘(例如 将一台存储设备上的卷虚拟为逻辑硬盘)、 物理硬盘、 SSD和光盘中的至少一 种。
当存储系统中有存储介质退出时, 可针对退出的存储介质进行全存储介 质重构。 进行全存储介质重构的时机, 可以是有存储介质退出时立即进行全 存储介质重构,也可以设定一时间阈值(也即前述延迟时间),如果到了阈值, 退出的存储介质还没有重新接入, 则进行全存储介质重构。 显然, 全存储介 质重构可以使用存储系统中余下的所有存储介质所存储的数据, 也可以使用 存储系统中余下的存储介质中的一部分存储介质所存储的数据, 只要能恢复 出退出的存储介质的数据即可。 本发明实施例中全存储介质重构所针对的存 储介质就是退出的存储介质, 其数量可以是一个也可以是多个。
本发明实施例中, 存储介质的退出是指存储介质无法被正常使用, 例如 由多块硬盘组成的存储系统中, 某一块硬盘被拔出存储系统或者断电。 此外, 本发明实施例可以应用于基于 RAID进行数据保护的存储系统, 也可以应用 于基于其他数据保护的存储系统, 只要能够利用存储系统中余下的全部或部 分存储介质, 对退出的存储介质进行数据恢复即可, 为了更易于理解, 后文 将以 RAID为例进行介绍。
为便于理解本发明所提供的技术方案, 先对 RAID进行简单介绍。
RAID分为软件 RAID和硬件 RAID两大类。
其中, 软件 RAID是通过计算机的操作系统(如 Windows, Netware及 Linux ) 自身提供的磁盘管理功能, 将与计算机连接的多块存储介质配置成 RAID组。 软件 RAID中的所有操作皆由计算机的中央处理器负责。 而硬件 RAID主要包括存储控制器方式: 参见图 la, 存储控制器 101通 过接口卡(SCSI、 iSCSK FC )与计算机 102相连接, 同时, 存储控制器 101 与多个存储介质 103相连接。
计算机 +存储介质 (软件 RAID )或者存储控制器 +存储介质 (硬件 RAID ) 可以配置出 RAID组, 其实现方式是: 计算机处理器或存储控制器将各存储 介质的存储空间按照指定粒度分割成小段连续空间 -chunk (也可叫做分区), 然后按照 raid级别的要求, 从存储介质中随机选出一定数量的存储介质, 并 在选出的每个存储介质上随机各选取一个 chunk组成 RAID组。
例如, 参见图 lb, 物理硬盘 Diskl- Disk5为选出的存储介质, 其中每一 物理硬盘被划分为 4个 chunk ( chunk l-chunk4 ), 这 4个 chunk被分配到 4个 RAID组 ( RAIDGroupl至 RAIDGroup 4 ) 中。
在现有的 RAID组中, 当某一存储介质因故障或被拔出等原因而退出时, 常见的处理方式是延迟一段时间 (具体的延迟时间可为数十秒到数分钟不 等), 如果在延迟时间内该退出的存储介质又重新接入, 则不会启动全存储介 质重构, 而是根据日志或者其他方式的记录, 对存储介质中被改写过的数据 进行恢复;
而如果超过延迟时间, 则针对退出的存储介质启动全存储介质重构, 也 即, 依据 RAID组其他存储介质所存储的数据计算出退出的存储介质上所存 储的全部或部分数据,并写入到 RAID组其他存储介质上的 chunk上, 以达到 恢复该退出的存储介质上的数据的目的。
然而, 在实施本发明创造的过程中, 发明人发现, 在进行全存储介质重 构过程中, 如退出的存储介质再重新接入 RAID组, 该存储介质将被识别为 新存储介质, 其上的数据也将被认为不可用。 也即, 即使退出的存储介质再 重新接入, 全存储介质重构仍将继续进行。 而全存储介质重构又需要占用较 长的时间, 进而造成数据恢复所需时间较长。 以典型的 2TB容量 SATA盘为 例, 其进行全存储介质重构所需要时间约为 2小时。
为解决上述问题, 本发明实施例提供一种数据恢复方法, 参见图 2, 其至 少包括如下步骤:
Sl、 当有存储介质退出时, 针对退出的存储介质进行全存储介质重构; 在本发明其他实施例中, 步骤 S1可具体包括: 当存储介质退出时立即针 对退出的存储介质进行全存储介质重构;
而在本发明另一实施例中, 步骤 S1则可具体包括: 设定一时间阈值, 如 果到了阈值, 退出的存储介质还没有重新接入, 则进行全存储介质重构。
52、 在进行全存储介质重构时, 检测是否有新的存储介质接入;
53、 当有新的存储介质接入时, 检测新接入的存储介质与正在执行的全 存储介质重构所针对的存储介质是否为同一个, 得出检测结果;
54、 当检测结果为是时, 停止正在执行的全存储介质重构;
55、 校验新接入的存储介质中未被重构的数据的有效性;
校验的目的是为了确定未被重构的数据中是否有数据被改写, 被改写的 数据不具有有效性将无法通过有效性校验, 而未被改写的数据则具有有效性 可通过有效性校验。
需要说明的是, 在本发明中, 上述新接入 (并被识别出与正在执行的全存 储介质重构所针对的存储介质为同一个)的存储介质所存储的数据中, 已经被 重构至其他存储介质上的数据为 "已被重构的数据", 而未被重构至其他存储 介质上的数据为 "未被重构的数据"。
56、 对未被重构的数据中通过有效性校验的数据恢复可用 (通过有效性 校验的数据是未被改写的, 是直接可用的, 因此对其采用了 "恢复可用" 的 方式);
57、 对未被重构的数据中未通过有效性校验的数据进行重构。
可见, 在本实施例中, 当新接入的存储介质与正在执行的全存储介质重 构所针对的存储介质为同一个时, 将停止全存储介质重构, 对未被重构的数 据进行校验, 并对通过有效性校验的数据恢复可用, 从而避免了通过有效性 校验的数据重构至其他存储介质上。 由于数据校验操作只有读请求而没有写 请求, 所以其执行速度远高于重构速度, 因此, 与现有技术相比, 通过有效 性校验的数据在未被重构的数据中所占的比例越大, 本实施例所提供的方法 在数据恢复上的时间优势也就越大。
同时, 由于重构需要计算出退出的存储介质上所存储的数据并写入到其 他存储介质上, 而在本实施例中, "通过有效性校验的数据" 可直接恢复可用 而不必写入到其他存储介质上, 从而也减少了对其他存储介质存储空间的占 用。 下面, 将进行更为详细的介绍。
在本发明其他实施例中, 上述实施例中的每个存储介质都有唯一的标识, 称为 WWN。 标识可为序列号。 因而, 上述步骤 S3中 "检测新接入的存储介 质与正在执行的全存储介质重构所针对的存储介质是否为同一个, 得出检测 结果" 可通过如下方式实现: 存储介质的序列号是否相同, 如果相同, 检测结果为是, 如果不相同, 检测 结果为否。
更具体的, 至少在退出的存储介质上的数据未全部恢复之前, 保留 (记 录)正在执行的全存储介质重构所针对的存储介质的序列号, 该序列号可记 录在计算机 /存储控制器的緩存上, 或者记录在某一 /某些存储介质上, 这样, 当新存储介质接入时, 比较新接入的存储介质的序列号与所记录的序列号是 否相同, 即可得到检测结果。 而在退出的存储介质上的数据全部恢复后, 可 删除所记录的序列号, 也可不删除。
在本发明其他实施例中, 上述所有实施例中每一存储介质的已分配空间 信息 (可称为元数据)可记录在计算机 /存储控制器的緩存上, 或者记录在某 一 /些存储介质上。 本领域技术人员可以理解的是, 存储介质上的未分配空间 所存储的数据无需要被重构或恢复可用。 这样, 当新接入的存储介质与正在 执行的全存储介质重构所针对的存储介质为同一个时, 控制器可根据已存储 的元数据来确定出新接入的存储介质中未执行重构的区域, 从而确定出未被 重构的数据, 本文下述将对其进行详细描述。
前已述及, 存储介质的存储空间被按照指定粒度分割成 chunk, 因此, 存 储介质的已分配空间也至少包括一个 chunk, 相应的, 上述存储介质的已分配 空间信息 (即元数据)也与 chunk有关。
更具体的, 上述元数据与存储介质的序列号以及 chunk ID有关。
仍以前述物理硬盘 Diskl- Disk5为例。 假定, Diskl- Disk5中的每一物理 硬盘被划分为 4个 chunk ( chunkl -chunk4 )。在配置 RAID组时,可根据 RAID 级别决定构成一个 RAID组所需要的 chunk的个数。 在这里, 假设构成一个 RAID组需要 4个 chunk。 那么, 可配置由 Diskl- Disk4中的 4个 chunkl构成 RAIDGroupl , 由 Diskl - Disk4中的 4个 chunk2构成 RAIDGroup2, 由 Diskl- Disk4中的 4个 chunk3构成 RAIDGroup3,以及由 Diskl - Disk4中的 4个 chunk4 构成 RAIDGroup4。 例如, 在上述元数据中, 就记载了 RAIDGroupl由 Diskl的 chunkl、 Disk2的 chunk 1、 Disk3的 chunk 1以及 Disk4的 chunk 1构成。
全存储介质重构可根据元数据的记载执行: 在存储介质退出后, 通过查 找元数据, 可找出记载元数据中的、 属于退出的存储介质的 chunk ID, 从而 可依据 RAID 组其他存储介质所存储的数据计算出上述 chunk ID 所对应 的 chunk所存储的数据。
而在退出的存储介质重新接入后, 通过查找元数据, 可找出记载在元数 据中的、 属于新接入的存储介质的 chunk ID。 这些属于新接入存储介质的 chunk ID所标识的 chunk即为上述未执行重构的区域, 未执行重构的区域上 所存储的数据未被重构至其他存储介质, 也即, 元数据中属于新接入的存储 介质的 chunk ID所标识的 chunk上所存储的数据, 即为未被重构的数据。
现举例说明, 假定 Diskl退出后, 启动针对 Diskl的全存储介质重构。 再 假定在全存储介质重构的过程中,已计算出退出的 Diskl的 chunkl上的数据, 并将其写入到 Disk5的 chunkl上。 此时, Diskl又重新接入。
那么, 在 Diskl未退出前, 在元数据中, 记载了 RAIDGroupl由 Diskl的 chunkl、 Disk2的 chunkl、 Disk3的 chunkl 以及 Disk4的 chunkl构成, 而在 Diskl重新接入时,在元数据的记载中, RAIDGroupl就变成由 Disk2的 chunkl、 Disk3 的 chunkl、 Disk4 的 chunkl 以及 Disk5 的 chunkl 构成了。 但除 RAIDGroupl夕卜的其他 RAID组, 比如 RAIDGroup2, 仍由 Diskl的 chimk2、 Disk2的 chimk2、 Disk3的 chimk2以及 Disk4的 chimk2构成, RAIDGroup3 仍由 Diskl的 chimk3、 Disk2的 chimk3、 Disk3的 chunk3以及 Disk4的 chunk3 构成, RAIDGroup4仍由 Diskl的 chimk4、 Disk2的 chimk4、 Disk3的 chimk4 以及 Disk4的 chunk4构成。通过查找元数据,可找出 Diskl的 chunk2的 chunk ID、 Diskl的 chimk3的 chunk ID以及 Diskl的 chimk4的 chunk ID仍"^己载在 元数据中,从而可确定出, Diskl上的 chunk2-chunk4所存储的数据为未被重 构的数据。
未被重构的数据占用至少一个 chunk。 相应的, 上述步骤 S5中 "校验新 接入的存储介质中未被重构的数据" 亦可具体包括: 逐 chunk校验未被重构 的数据所占用的每一 chunk。 也即, 对新接入的存储介质中的未被重构的数据 逐 chunk进行校验。
在本发明其他实施例中, 每一 chunk又可被划分为至少一个分块。 例如, 参见图 3 ,物理硬盘 Diskl- Disk5中的 chimkl均被划分为 4个分块( A1-A4 ), 各 Chunkl相同位置上的分块构成分条( stripe )。 由图 3可见: 五个分块 A1 共同构成分条 1 ( stripel ), 五个分块 A2共同构成分条 2 ( stripe2 ), 等等。 结 合图 lb, 可知每一 RAID组包括一个或多个分条。
以五个分块 A1共同构成分条 1为例, 在五个分块 A1中, 其中一个分块 A1可作为校验块存储校验数据, 而其他四个分块 A1可作为四个数据块存储 数据。 通过对四个数据块上的数据进行异或运算可生成校验数据, 当然, 也 可通过其他运算生成校验数据。 这样, 当某一数据块退出分条 1 时, 可通过 校验块所存储的校验数据, 以及分条 1 中其他数据块所存储的数据计算获得 退出的数据块上的数据,并将计算结果写入到 RAID组其他存储介质的 chunk 上。 或者, 当校验块退出分条 1 时, 也可根据数据块所存储的数据重新生成 退出的校验块上所存储的校验数据, 并将计算结果写入到 RAID组其他存储 介质的 chunk上。
基于分条 /分块, 在本发明其他实施例中, 上述全存储介质重构可根据元 数据的记载逐 chunk逐分条(分块)执行, 也即, 假定 diskl退出, 根据元数 据, 可按从 chunkl- chunk4的顺序, 按分条计算出 diskl每一 chunk上每一分 块所存储的数据, 并将计算结果写入到 RAID组其他存储介质的 chunk上。
需要注意的是, 当退出的存储介质重新接入后, 可能存在下述情况: 退 出又重新接入的存储介质的某一 chunk上的一部分分块所存储的数据已通过 计算被重构至其他存储介质上, 但还剩余一部分分块所存储的数据未被重构 至其他存储介质上。 举例来讲, 假设 Diskl退出又再重新接入后, 已计算出 Diskl的 chunkl上的 A1和 A2所存储的数据, 并将计算结果保存在 Disk5的 chunkl上, 但还未计算 Diskl的 chunkl上的 A3和 A4所存储的数据。
在上述情况下, 会将全存储介质重构当前所针对的 chunk上的数据重构 完毕后, 再根据元数据确定未被重构的数据。 也即, 会将 Diskl的 chunkl上 的 A3和 A4重构至 Disk5的 chunkl上后再根据元数据确定未被重构的数据。 因此, 在本发明某些实施例中, 上述 "停止全存储介质重构" 可具体包 括: 将全存储介质重构当前所针对的 chunk上的数据重构完毕后, 停止全存 储介质重构。
基于分块, 前述的 "检验未被重构的数据所占用的每一 chunk" 可进一步 细化包括: 按分块校验未被重构的数据所占用的每一 chunk。
一般情况下, 一个 chunk可包括不止一个分块, 因此, 在按分块进行校 验时, 至少可按照下述两种方式进行:
第一种方式是: 逐分块校验未被重构的数据所占用的每一 chunk。 也即, 如果一个 chuck中包括 8个分块,在校验时,将依次对这 8个分块所存储的数 据进行校验。 在第一种方式下, 必须 8 个分块所存储的数据均通过校验, 整 个 chunk所存储的数据才通过有效性校验。 如 8个分块中有任意一个分块所 存储的数据未通过校验, 则整个 chunk所存储的数据均未通过有效性校验。
第二种方式是: 校验未被重构的数据所占用的每一 chunk中的选定分块。 仍假设一个 chuck中包括 8个分块,可选择校验这 8个分块中的任意一个或几 个分块。 在第二种方式下, 选定的分块所存储的数据必须均通过校验, 整个 chunk所存储的数据才通过有效性校验。如选定的分块中有任意一个分块所存 储的数据未通过校验, 则整个 chunk所存储的数据均未通过有效性校验。 与 第一种方式相比, 第二种方式因为读取和校验的数据量更少, 从而可以达到 更快恢复数据的目的。
需要说明的是, 无论是哪种方式, 针对某一分块所进行的校验可参照现 有的分条校验技术, 在此不作贅述。 分条校验可验证分条中的数据块所存储 的数据是否被改写。 如未被改写, 则数据块所存储的数据有效, 否则, 数据 块所存储的数据无效。
为称呼方便, 可将未通过有效性校验的数据所占用的每一 chunk称为第 一 chunk, 也即, 未通过有效性校验的数据占用至少一个 "第一 chunk" ; 并将 通过有效性校验的数据占用的每一 chunk称为第二 chunk, 也即, 通过有效性 校验的数据占用至少一个 "第二 chunk"。
相应的, 在本发明其他实施例中, 上述步骤 S7可具体包括:
每检测出一个 "第一 chunk" , 即针对检测出的 "第一 chunk" 所存储的 数据进行重构, 也即, 根据元数据确定检测出的 "第一 chunk" 所属的 RAID 组以及该 RAID组所包括的其他 chunk,根据其他 chunk上存储的数据计算检 测出的 "第一 chunk" 上的数据, 从而得到计算结果, 并将计算结果写入到其 他存储介质的 chunk上;
或者,
在未被重构的数据所占用的全部 chunk均校验完成后, 针对检测出的所 有 "第一 chunk" 分别进行重构。
针对每一 "第一 chunk" 所进行的重构, 是根据元数据确定每一 "第一 chunk" 所属的 RAID组以及该 RAID组所包括的其他 chunk, 根据每一 "第 一 chunk" 所属 RAID组中其他 chunk上存储的数据计算每一 "第一 chunk" 上的数据, 并将计算结果写入到其他存储介质的 chunk上。
与之相对应, 上述步骤 S6也可具体包括:
每检测出一个 "第二 chunk" , 即对检测出的 "第二 chunk"上所存储的数 据恢复可用;
或者,
在未被重构的数据所占用的全部 chunk均校验完成后, 对检测出的所有 "第二 chunk" 上所存储的数据恢复可用。
在具体实施时, 本领域技术人员可进行灵活组合, 例如, 可每检测出一 个 "第二 chunk" , 即对检测出的 "第二 chunk"上的数据恢复可用, 但是在未 被重构的数据所占用的全部 chunk均校验完成后, 再对检测出的所有 "第一 chunk" 进行重构; 也可以在未被重构的数据所占用的全部 chunk均校验完成 后, 对检测出的所有 "第二 chunk" 所存储的数据恢复可用, 而对检测出的所 有 "第一 chunk" 进行重构; 也可每检测出一个 "第二 chunk" , 即对检测出的 "第二 chunk"所存储的数据恢复可用, 而每检测出一个 "第一 chunk" , 即对 其进行重构, 等等, 在此不作贅述。
无论哪种组合, 参见图 4-6, 以每一物理硬盘分为 4个 chunk为例, 假设 Diskl的 4个 chunk ( chunkl-4 )分属于 4个 RAID组, 在 Diskl被拔出后(图 4示出的是 Diskl未被拔出前的情况), 按照现有的处理的方式, 通过全存储 介质重构, Diskl 上的所有 chunk ( chunkl-4 ) 均会被重构到其他硬盘上, 最 终结果可参见图 5。
而按照本发明实施例所提供的技术方案, 当 Diskl在被拔出后又插入时, 全存储介质重构停止。假设此时已对 Diskl中的 chunkl和 chunk2进行了重构 , 则对 Diskl上剩余的 Chunk3和 chunk4进行分条校验, 如 Diskl上的 Chunk3 和 chunk4均通过有效性校 3全,则对 Diskl上的 Chunk3和 chunk4恢复可用(参 见图 6 ), 通过对比图 5和 6可看出, 依照本发明实施例所提供的技术方案, 最终被重构的数据大大少于现有技术方案, 从而快速实现了全部数据的恢复。
并且,如在对 Diskl进行全存储介质重构的期间,上述 RAID组中的其他 存储介质因故障或被拔出而退出, 则可能造成双盘失效、 用户数据丟失, 其 风险比较大; 并且随着存储介质技术的发展, 存储介质的容量会越来越大, 而容量越大, 全存储介质重构所占用的时间也就越长, 从而造成数据丟失的 风险也随之增大。
而采用本发明实施例所提供的技术方案, 如在全存储介质重构过程中, Diskl再次接入, 可对未被重构的数据采用校验的方式, 通过有效性校验的数 据可避免写操作, 从而可以节约未被重构的数据中通过有效性校验的数据的 重构时间。 由于重构时间的缩短, 全存储介质重构过程中双盘失效的风险也 随之大大降低,并可避免相关存储介质的重构写操作对主机 10 ( Input/Output ) 的影响, 保证了性能。
此外, 按照现有的处理方式, 退出再重新接入的存储介质将被识别为新 存储介质, 因此会为该重新接入的存储介质分配新的逻辑信息。 如果某一存 储介质频繁退出和接入, 可造成针对同一存储介质的逻辑信息记录频繁重复, 甚至可能耗尽相关资源 (例如运行过程中占用的内存空间, 及持久化保存占 用的其它存储空间)。 而本发明实施例所提供的技术方案, 会去检测新接入的 存储介质与正在执行的全存储介质重构所针对的存储介质是否为同一个, 当 二者为同一个时, 则不会为重新新入的存储介质分配新的逻辑信息, 从而可 避免针对同一存储介质的逻辑信息记录频繁重复, 甚至相关资源耗尽相关资 源的问题的出现。
需要说明的是, 假设在完成上述步骤 S1-S7后, 退出又重新接入的存储 介质 (Diskl ) 中所存储的一部分数据被重构至 RAID组的其他存储介质上, 另一部分数据被恢复可用,比如 Diskl的 chunk3和 chunk4上所存储的数据被 恢复可用。 此时, 如果 Diskl 又再次退出, 只需要根据元数据针对 Diskl 的 chunk3和 chunk4执行全存储介质重构。 也即, 依据 RAID组其他存储介质所 存储的数据计算出退出的存储介质上所存储的部分数据, 并写入到 RAID组 其他存储介质上的 chunk上。 如果在执行全存储介质重构时, Diskl又再次接 入, 可执行上述步骤 S3至 S7, 以此类推, 在此不作贅述。
如果存储介质频繁退出、 接入达到预设条件, 可对该存储介质进行屏蔽, 被屏蔽后的存储介质无论实际上处于退出的状态还是处于接入的状态, 均被 当作退出。 本领域技术人员可根据实际情况设置上述预设条件, 比如, 可将 预设条件设置为 1 小时内的退出次数大于等于阈值, 阈值的取值可为任意自 然数。
需要注意的是, 上述所有实施例中要求保护的数据恢复方法的执行主体 可为前述的计算机处理器或存储控制器, 计算机处理器或存储控制器可作为 数据恢复装置, 参见图 7, 该数据恢复装置可包括:
全存储介质重构单元 700, 用于当有存储介质退出时,针对退出的存储介 质进行全存储介质重构;
检测单元 701 , 用于在进行全存储介质重构时,检测是否有新的存储介质 接入;
识别单元 702, 用于当有新的存储介质接入时,检测新接入的存储介质与 正在执行的全存储介质重构所针对的存储介质是否为同一个, 得出检测结果; 全存储介质重构控制单元 703 , 用于当所述检测结果为是时,停止全存储 介质重构 (也即, 当所述检测结果为是时, 全存储介质重构控制单元 703控 制全存储介质重构单元 700停止全存储介质重构操作 );
校验单元 704, 用于校验上述接入的存储介质中未被重构的数据的有效 性;
第一数据恢复单元 705,用于对未被重构的数据中通过有效性校验的数据 恢复可用;
第二数据恢复单元 706,用于对未被重构的数据中未通过有效性校验的数 据进行重构。
上述各单元所执行的功能分别与前述方法中的步骤 S1-S7相对应, 具体 细节可参见本文前述记载, 在此不作贅述。
另外, 前述的计算机处理器或存储控制器也可统称为控制器, 参见图 8a 和图 8b, 控制器 800在硬件上可包括 CPU81和存储器 82, 其中, CPU81通过 通信接口 811与存储介质 83通信, 并通过运行存储在存储器 82内的软件程 序 821以及调用存储在存储器 82内的数据, 可执行如下步骤:
当有存储介质退出时, 针对退出的存储介质进行全存储介质重构; 在进行全存储介质重构时, 检测是否有新的存储介质接入;
当有新的存储介质接入时, 检测新接入的存储介质与正在执行的全存储 介质重构所针对的存储介质是否为同一个, 得出检测结果;
当检测结果为是时, 停止全存储介质重构;
校验所述存储介质中未被重构的数据的有效性;
对上述未被重构的数据中通过有效性校验的数据恢复可用;
对上述未被重构的数据中未通过有效性校验的数据进行重构。
如上步骤的具体细节可参见本文前述记载, 在此不作贅述。
针对计算机处理器, 上述存储器 82具体可为 SSD, SSD可主要包括程序 存储区和数据存储区, 其中, 程序存储区可存储操作系统, 以及至少一个功 能所需的应用程序 (例如上述软件程序 821 )等; 数据存储区可存储根据 CPU 的执行情况而最终产生的数据,至于 CPU在执行上述步骤所产生的中间数据, 则存储在内存中。
而上述存储控制器可具体包括 CPU、 主板、 内存、 存储器、 电源、 电池、 风扇, 其中, 存储器可以包括高速随机存取存储器, 还可以包括非易失性存 储器, 例如至少一个磁盘存储器件、 闪存器件、 或其他易失性固态存储器件。
类似于上述 SSD, 存储控制器中的存储器也可包括程序存储区和数据存 储区, 其中, 程序存储区可存储操作系统、 至少一个功能所需的应用程序等 等,而数据存储区可存储根据 CPU的执行情况而最终产生的数据。并且, CPU 在执行上述步骤时所产生的中间数据, 也可存储在存储控制器的内存中。
在本发明其他实施例中还要求保护存储系统。
图 9示出了本发明实施例欲保护的存储系统的一种结构: 包括数据恢复 装置 91和至少两个存储介质 92。 数据恢复装置 91通过通信接口与存储介质 92通信。 数据恢复装置的结构请参见图 7所示, 在此不作贅述。
图 10示出了本发明欲保护的存储系统的另一种结构: 包括控制器 800和 至少两个存储介质 83 ; 控制器 800的具体结构可参见图 8a和图 8b: 其可包 括 CPU81和存储器 82, CPU81通过通信接口 811与存储介质 83通信, 并通 过运行存储在所述存储器内的软件程序以及调用存储在所述存储器内的数 据, 执行如下步骤:
当有存储介质退出时, 针对退出的存储介质进行全存储介质重构; 在进行全存储介质重构时, 检测是否有新的存储介质接入;
当有新的存储介质接入时, 检测新接入的存储介质与正在执行的全存储 介质重构所针对的存储介质是否为同一个, 得出检测结果;
当检测结果为是时, 停止全存储介质重构;
校验新接入的存储介质中未被重构的数据的有效性;
对未被重构的数据中通过有效性校验的数据恢复可用;
对未被重构的数据中未通过有效性校验的数据进行重构。
如上步骤的具体细节可参见本文前述记载, 在此不作贅述。
本说明书中各个实施例采用递进的方式描述, 每个实施例重点说明的都 是与其他实施例的不同之处, 各个实施例之间相同相似部分互相参见即可。 对于实施例提供的装置而言, 由于其与实施例提供的方法相对应, 所以描述 的比较简单, 相关之处参见方法部分说明即可。
还需要说明的是, 在本文中, 诸如第一和第二等之类的关系术语仅仅用 来将一个实体或者操作与另一个实体或操作区分开来, 而不一定要求或者暗 示这些实体或操作之间存在任何这种实际的关系或者顺序。 而且, 术语 "包 括"、 "包含" 或者其任何其他变体意在涵盖非排他性的包含, 从而使得包括 一系列要素的过程、 方法、 物品或者设备不仅包括那些要素, 而且还包括没 有明确列出的其他要素, 或者是还包括为这种过程、 方法、 物品或者设备所 固有的要素。 在没有更多限制的情况下, 由语句 "包括一个 ... ... " 限定的要 素, 并不排除在包括所述要素的过程、 方法、 物品或者设备中还存在另外的 相同要素。
通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本 发明可借助软件加必需的通用硬件的方式来实现, 通用硬件包括通用集成电 路、 通用 CPU、 通用存储器、 通用元器件等, 当然也可以通过专用硬件包括 专用集成电路、 专用 CPU、 专用存储器、 专用元器件等来实现, 但艮多情况 下前者是更佳的实施方式。 基于这样的理解, 本发明的技术方案本质上或者 说对现有技术做出贡献的部分可以以软件产品的形式体现出来, 该计算机软 件产品可以存储在可读取的存储介质中, 如 u盘、 移动存储介质、 只读存储 器(ROM, Read-Only Memory ), 随机存取存储器(RAM, Random Access Memory ), 磁碟或者光盘等各种可以存储软件程序代码的介质, 包括若干指 令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等) 执行本发明各个实施例的方法。
对所提供的实施例的上述说明, 使本领域专业技术人员能够实现或使用 本发明。 对这些实施例的多种修改对本领域的专业技术人员来说将是显而易 见的, 本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下, 在其它实施例中实现。 因此, 本发明将不会被限制于本文所示的这些实施例, 而是要符合与本文所提供的原理和新颖特点相一致的最宽的范围。

Claims

权利要求 书
1、 一种数据恢复方法, 其特征在于, 包括:
当有存储介质退出时, 针对退出的存储介质进行全存储介质重构; 在进行全存储介质重构时, 检测是否有新的存储介质接入;
当有新的存储介质接入时, 检测新接入的存储介质与正在执行的全存储 介质重构所针对的存储介质是否为同一个, 得出检测结果;
当检测结果为是时, 停止所述全存储介质重构;
校验所述新接入的存储介质中未被重构的数据的有效性;
对所述未被重构的数据中通过有效性校验的数据恢复可用;
对所述未被重构的数据中未通过有效性校验的数据进行重构。
2、 如权利要求 1所述的方法, 其特征在于, 所述检测新接入的存储介质 与正在执行的全存储介质重构所针对的存储介质是否为同一个具体包括: 对的存储介质的序列号是否相同, 如果相同, 检测结果为是, 如果不相同, 检测结果为否。
3、 如权利要求 1或 2所述的方法, 其特征在于:
所述未被重构的数据占用至少一个 chunk;
所述校验所述新接入的存储介质中未被重构的数据具体包括: 逐 chunk 检验所述未被重构的数据所占用的每一 chunk。
4、 如权利要求 3所述的方法, 其特征在于:
每个所述 chunk包括至少一个分块;
所述检验所述未被重构的数据所占用的每一 chunk具体包括: 按分块校 验所述未被重构的数据所占用的每一 chunk。
5、 如权利要求 4所述的方法, 其特征在于:
所述按分块校验所述未被重构的数据所占用的每一 chunk具体包括: 逐分块校验所述未被重构的数据所占用的每一 chunk; 或者,
校验所述未被重构的数据所占用的每一 chunk中的选定分块。
6、 如权利要求 1 - 5任一项所述的方法, 其特征在于, 所述未被重构的 数据是根据已存储的元数据确定出的。
7、 如权利要求 3 - 6任一项所述的方法, 其特征在于:
所述未通过有效性校验的数据占用至少一个第一 chunk;
所述对所述未被重构的数据中未通过有效性校验的数据进行重构具体包 括:
每检测出一个第一 chunk, 即针对检测出的第一 chunk所存储的数据进行 重构; 或者,
在所述未被重构的数据所占用的全部 chunk均校验完成后, 针对检测出 的所有第一 chunk所存储的数据分别进行重构。
8、 如权利要求 3 - 7任一项所述的方法, 其特征在于:
所述通过有效性校验的数据占用至少一个第二 chunk;
所述对所述未被重构的数据中通过有效性校验的数据恢复可用具体包 括:
每检测出一个第二 chunk, 即对检测出的第二 chunk上所存储的数据恢复 可用;
或者,
在所述未被重构的数据所占用的全部 chunk均校验完成后, 对检测出的 所有第二 chunk上所存储的数据恢复可用。
9、 一种数据恢复装置, 其特征在于, 包括:
全存储介质重构单元, 用于当有存储介质退出时, 针对退出的存储介质 进行全存储介质重构;
检测单元, 用于在进行全存储介质重构时, 检测是否有新的存储介质接 入; 识别单元, 用于当有新的存储介质接入时, 检测新接入的存储介质与正 在执行的全存储介质重构所针对的存储介质是否为同一个, 得出检测结果; 全存储介质重构控制单元, 用于当所述检测结果为是时, 停止所述全存 储介质重构;
校验单元, 用于校验所述新接入的存储介质中未被重构的数据的有效性; 第一数据恢复单元, 用于对所述未被重构的数据中通过有效性校验的数 据恢复可用;
第二数据恢复单元, 用于对所述未被重构的数据中未通过有效性校验的 数据进行重构。
10、 如权利要求 9所述的装置, 其特征在于, 所述检测新接入的存储介 质与正在执行的全存储介质重构所针对的存储介质是否为同一个具体包括: 对的存储介质的序列号是否相同, 如果相同, 检测结果为是, 如果不相同, 检测结果为否。
11、 如权利要求 9或 10所述的装置, 其特征在于:
所述未被重构的数据占用至少一个 chunk;
所述校验所述新接入的存储介质中未被重构的数据具体包括: 逐 chunk 检验所述未被重构的数据所占用的每一 chunk。
12、 如权利要求 11所述的装置, 其特征在于:
每个所述 chunk包括至少一个分块;
所述检验所述未被重构的数据所占用的每一 chunk具体包括: 按分块校 验所述未被重构的数据所占用的每一 chunk。
13、 如权利要求 12所述的装置, 其特征在于:
所述按分块校验所述未被重构的数据所占用的每一 chunk具体包括: 逐分块校验所述未被重构的数据所占用的每一 chunk;
或者, 校验所述未被重构的数据所占用的每一 chunk中的选定分块。
14、 如权利要求 9 - 13任一项所述的装置, 其特征在于, 所述未被重构 的数据是根据已存储的元数据确定出的。
15、 如权利要求 11 - 14任一项所述的装置, 其特征在于:
所述未通过有效性校验的数据占用至少一个第一 chunk;
所述对所述未被重构的数据中未通过有效性校验的数据进行重构具体包 括:
每检测出一个第一 chunk, 即针对检测出的第一 chunk所存储的数据进行 重构; 或者,
在所述未被重构的数据所占用的全部 chunk均校验完成后, 针对检测出 的所有第一 chunk所存储的数据分别进行重构。
16、 如权利要求 11 - 15任一项所述的装置, 其特征在于:
所述通过有效性校验的数据占用至少一个第二 chunk;
所述对所述未被重构的数据中通过有效性校验的数据恢复可用具体包 括:
每检测出一个第二 chunk, 即对检测出的第二 chunk上所存储的数据恢复 可用;
或者,
在所述未被重构的数据所占用的全部 chunk均校验完成后, 对检测出的 所有第二 chunk上所存储的数据恢复可用。
17、 一种控制器, 其特征在于, 包括 CPU和存储器, 所述 CPU通过通信 接口与存储介质通信, 并通过运行存储在所述存储器内的软件程序以及调用 存储在所述存储器内的数据, 执行如下步骤:
当有存储介质退出时, 针对退出的存储介质进行全存储介质重构; 在进行全存储介质重构时, 检测是否有新的存储介质接入;
当有新的存储介质接入时, 检测新接入的存储介质与正在执行的全存储 介质重构所针对的存储介质是否为同一个, 得出检测结果;
当检测结果为是时, 停止所述全存储介质重构;
校验所述新接入的存储介质中未被重构的数据的有效性;
对所述未被重构的数据中通过有效性校验的数据恢复可用;
对所述未被重构的数据中未通过有效性校验的数据进行重构。
18、 如权利要求 17所述的控制器, 其特征在于, 所述检测新接入的存储 介质与正在执行的全存储介质重构所针对的存储介质是否为同一个具体包 括: 对的存储介质的序列号是否相同, 如果相同, 检测结果为是, 如果不相同, 检测结果为否。
19、 如权利要求 17或 18所述的控制器, 其特征在于:
所述未被重构的数据占用至少一个 chunk;
所述校验所述新接入的存储介质中未被重构的数据具体包括: 逐 chunk 检验所述未被重构的数据所占用的每一 chunk。
20、 如权利要求 19所述的控制器, 其特征在于:
每个所述 chunk包括至少一个分块;
所述检验所述未被重构的数据所占用的每一 chunk具体包括: 按分块校 验所述未被重构的数据所占用的每一 chunk。
21、 如权利要求 20所述的控制器, 其特征在于:
所述按分块校验所述未被重构的数据所占用的每一 chunk具体包括: 逐分块校验所述未被重构的数据所占用的每一 chunk;
或者,
校验所述未被重构的数据所占用的每一 chunk中的选定分块。
22、 如权利要求 17 - 21任一项所述的控制器, 其特征在于, 所述未被重 构的数据是根据已存储的元数据确定出的
23、 如权利要求 19 - 22任一项所述的控制器, 其特征在于, 所述未通过 有效性校验的数据占用至少一个第一 chunk;
所述对所述未被重构的数据中未通过有效性校验的数据进行重构具体包 括:
每检测出一个第一 chunk, 即针对检测出的第一 chunk所存储的数据进行 重构; 或者,
在所述未被重构的数据所占用的全部 chunk均校验完成后, 针对检测出 的所有第一 chunk所存储的数据分别进行重构。
24、 如权利要求 19 - 23任一项所述的控制器, 其特征在于, 所述通过有 效性校验的数据占用至少一个第二 chunk;
所述对所述未被重构的数据中通过有效性校验的数据恢复可用具体包 括:
每检测出一个第二 chunk, 即对检测出的该第二 chunk上所存储的数据恢 复可用;
或者,
在所述未被重构的数据所占用的全部 chunk均校验完成后, 对检测出的 所有第二 chunk上所存储的数据恢复可用。
25、 一种存储系统, 其特征在于, 包括至少两个存储介质和如权利要求 9-16任一项所述的数据恢复装置。
26、 一种存储系统, 其特征在于, 包括至少两个存储介质和如权利要求 17-24任一项所述的控制器。
PCT/CN2012/085419 2012-11-28 2012-11-28 数据恢复方法、数据恢复装置、存储器及存储系统 WO2014082216A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/085419 WO2014082216A1 (zh) 2012-11-28 2012-11-28 数据恢复方法、数据恢复装置、存储器及存储系统
CN201280003016.7A CN103975309B (zh) 2012-11-28 2012-11-28 数据恢复方法、数据恢复装置、存储器及存储系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/085419 WO2014082216A1 (zh) 2012-11-28 2012-11-28 数据恢复方法、数据恢复装置、存储器及存储系统

Publications (1)

Publication Number Publication Date
WO2014082216A1 true WO2014082216A1 (zh) 2014-06-05

Family

ID=50827027

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/085419 WO2014082216A1 (zh) 2012-11-28 2012-11-28 数据恢复方法、数据恢复装置、存储器及存储系统

Country Status (2)

Country Link
CN (1) CN103975309B (zh)
WO (1) WO2014082216A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126378A (zh) * 2016-06-29 2016-11-16 华为技术有限公司 一种触发磁盘阵列进行重构的方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108572887A (zh) * 2017-03-14 2018-09-25 上海骐宏电驱动科技有限公司 数据检验校正方法
WO2021012164A1 (zh) * 2019-07-22 2021-01-28 华为技术有限公司 数据重构的方法、装置、计算机设备、存储介质及系统

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848070A (zh) * 2005-04-04 2006-10-18 索尼株式会社 数据存储设备、重构控制设备、重构控制方法与存储介质
CN101599032A (zh) * 2009-05-31 2009-12-09 成都市华为赛门铁克科技有限公司 存储节点管理方法、控制子系统和存储系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7383483B2 (en) * 2003-12-11 2008-06-03 International Business Machines Corporation Data transfer error checking

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848070A (zh) * 2005-04-04 2006-10-18 索尼株式会社 数据存储设备、重构控制设备、重构控制方法与存储介质
CN101599032A (zh) * 2009-05-31 2009-12-09 成都市华为赛门铁克科技有限公司 存储节点管理方法、控制子系统和存储系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126378A (zh) * 2016-06-29 2016-11-16 华为技术有限公司 一种触发磁盘阵列进行重构的方法及装置
US10732870B2 (en) 2016-06-29 2020-08-04 Huawei Technologies Co., Ltd. Method and apparatus for triggering raid reconstruction

Also Published As

Publication number Publication date
CN103975309A (zh) 2014-08-06
CN103975309B (zh) 2017-08-25

Similar Documents

Publication Publication Date Title
US10152254B1 (en) Distributing mapped raid disk extents when proactively copying from an EOL disk
JP5147979B2 (ja) データ記憶ライブラリのための重複排除プロトコルを選択する装置および方法
US9389975B2 (en) Method and apparatus to utilize large capacity disk drives
US8719619B2 (en) Performance enhancement technique for raids under rebuild
US10467044B2 (en) Transaction processing method and apparatus, and computer system
CN107250975B (zh) 数据存储系统和数据存储方法
US8812902B2 (en) Methods and systems for two device failure tolerance in a RAID 5 storage system
US8725945B2 (en) Method and system for governing an enterprise level green storage system drive technique
KR20130100722A (ko) Smr raid용의 대블록 무작위 쓰기 핫 스페어 ssd 구현
KR20130097995A (ko) 비휘발성 메모리 장치의 제어 방법 및 비휘발성 메모리 시스템
WO2014190501A1 (zh) 数据恢复方法、存储设备和存储系统
US10733051B2 (en) Redistributing data across drives of a storage array based on drive health metrics
TW201115326A (en) Data verification using checksum sidefile
US8762771B2 (en) Method for completing write operations to a RAID drive pool with an abnormally slow drive in a timely fashion
WO2012089152A1 (zh) 一种文件系统内实现独立磁盘冗余阵列保护的方法及装置
US20160170841A1 (en) Non-Disruptive Online Storage Device Firmware Updating
US8539156B2 (en) Storage subsystem and its logical unit processing method
US11625193B2 (en) RAID storage device, host, and RAID system
US8055835B2 (en) Apparatus, system, and method for migrating wear spots
WO2014082216A1 (zh) 数据恢复方法、数据恢复装置、存储器及存储系统
US11150991B2 (en) Dynamically adjusting redundancy levels of storage stripes
US11080136B2 (en) Dropped write error detection
US11853163B2 (en) Selective rebuild of interrupted devices in data storage device arrays
US11853561B2 (en) Backup integrity validation
US9311304B2 (en) Storage subsystem data duplication policy

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12889217

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12889217

Country of ref document: EP

Kind code of ref document: A1