WO2019037587A1 - 一种数据恢复方法及装置 - Google Patents
一种数据恢复方法及装置 Download PDFInfo
- Publication number
- WO2019037587A1 WO2019037587A1 PCT/CN2018/098648 CN2018098648W WO2019037587A1 WO 2019037587 A1 WO2019037587 A1 WO 2019037587A1 CN 2018098648 W CN2018098648 W CN 2018098648W WO 2019037587 A1 WO2019037587 A1 WO 2019037587A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- index information
- target
- stripe
- identifier
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1471—Saving, restoring, recovering or retrying involving logging of persistent data for recovery
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
Definitions
- the present application relates to the field of data processing technologies, and in particular, to a data recovery method and apparatus.
- Erasure coding is a data protection method.
- the number of copies of the data segment may be divided into k original segments, and the k original segments are expanded and coded to obtain m redundant segments; the k original segments and m redundant segments are separately stored to the respective storages. In the unit; thus, if a storage unit fails and data is lost, the lost data fragments can be recovered according to the original fragments and redundant fragments that are not lost.
- Metadata which is data about data, is mainly related information describing data attributes, and is used to support functions such as indicating storage location, historical data, resource search, and file recording.
- each piece of data can be combined into the data using metadata.
- the purpose of the embodiment of the present application is to provide a data recovery method and apparatus, so as to recover metadata after losing metadata.
- the embodiment of the present application discloses a data recovery method, which is applied to a management server in a distributed system, and the method includes:
- the storage unit included in the storage space Determining, by the pre-acquired data structure information, the storage unit included in the storage space; wherein the data structure information includes: a correspondence between the storage space and each storage unit included therein; the storage unit is a minimum unit that stores the data segment a plurality of storage units constituting a storage space, wherein metadata of the one storage space includes index information of the plurality of storage units;
- Reading the index information of the determined storage unit wherein the read index information includes a first identifier of a storage space where the corresponding storage unit is located, and a first attribute of the data segment stored by the corresponding storage unit;
- the embodiment of the present application further discloses a data recovery apparatus, which is applied to a management server in a distributed system, where the apparatus includes:
- a first determining module configured to determine a storage space pointed to by the metadata to be restored, where the storage space is located in a storage server of the distributed system
- a second determining module configured to determine, according to pre-acquired data structure information, a storage unit included in the storage space, where the data structure information includes: a correspondence between a storage space and each storage unit included therein; and a storage unit To store a minimum unit of a data segment, the plurality of storage units constitute a storage space, and the metadata of the one storage space includes index information of the plurality of storage units;
- a first reading module configured to read index information of the determined storage unit, where the read index information includes a first identifier of a storage space where the corresponding storage unit is located, and a data fragment stored by the corresponding storage unit First attribute
- a third determining module configured to determine the first identifier as a storage space identifier in each piece of index information included in the to-be-recovered metadata
- a fourth determining module configured to determine, according to the first attribute and a preset data storage policy, a data segment attribute in each piece of index information included in the to-be-recovered metadata
- the first recovery module is configured to recover the metadata to be restored based on the storage space identifier and the data segment attribute in each piece of index information included in the to-be-recovered metadata.
- the embodiment of the present application further discloses a management server, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;
- a memory for storing a computer program
- the processor when used to execute a program stored on the memory, implements any of the above data recovery methods.
- the embodiment of the present application further discloses a distributed system, including: a storage server and a management server, where the storage server includes at least one storage space, each storage space includes multiple storage units, and is stored.
- the unit is the smallest unit that stores the data segment;
- the storage server is configured to store index information of each storage unit in the storage server
- the management server is configured to determine a storage space pointed to by the metadata to be restored, where the storage space is located in a storage server of the distributed system; and determining, according to pre-acquired data structure information, a storage unit included in the storage space;
- the data structure information includes: a correspondence between the storage space and each storage unit included therein; the metadata of one storage space includes index information of the plurality of storage units in the one storage space; and the determined storage is read The index information of the unit, wherein the read index information includes a first identifier of a storage space in which the corresponding storage unit is located, and a first attribute of a data segment stored in the corresponding storage unit; determining the first identifier as a Determining a storage space identifier in each piece of index information included in the recovery metadata; determining, according to the first attribute, and a preset data storage policy, a data segment attribute in each piece of index information included in the to-be-recovered metadata; a storage space identifier and a piece of data in each piece
- an embodiment of the present application further discloses a computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, implement any one of the foregoing data recovery methods. .
- an embodiment of the present application further discloses an executable program code for being executed to execute any of the above data recovery methods.
- a storage space is divided into a plurality of storage units, and the metadata of the one storage space includes index information of the plurality of storage units; when the metadata is restored, the storage pointed to by the metadata to be restored is read.
- the index information of the storage unit included in the space is recovered by using the read index information, and the metadata can be read later by using the metadata.
- FIG. 1 is a schematic structural diagram of a distributed system according to an embodiment of the present application.
- FIG. 2 is a schematic diagram of a first process of a data recovery method according to an embodiment of the present application
- FIG. 3 is a schematic structural diagram of an index information according to an embodiment of the present disclosure.
- FIG. 4 is a schematic diagram of a second process of a data recovery method according to an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of a data recovery apparatus according to an embodiment of the present application.
- FIG. 6 is a schematic structural diagram of a management server according to an embodiment of the present disclosure.
- the embodiment of the present application provides a data recovery method and apparatus, which can be applied to a management server in a distributed system.
- the distributed system can be as shown in FIG. 1 , including a storage server and a management server, the storage server stores data, and the management server stores metadata.
- Metadata which is data about data, is mainly used to describe attribute information of data in the storage server.
- the data in the storage server can be read by managing the metadata in the server. If the management server fails and the metadata is lost, the data stored in the storage server cannot be read. With the embodiment of the present application, metadata lost in the management server can be recovered.
- a data recovery method provided by the embodiment of the present application is described in detail below.
- FIG. 2 is a schematic flowchart of a data recovery method according to an embodiment of the present disclosure, including:
- S201 Determine a storage space pointed to by the metadata to be restored, where the storage space is located in a storage server of the distributed system.
- the storage space in this embodiment is a Buket in the storage server, and one Buket may correspond to only one erasure code policy.
- a storage server may include multiple Bukets: Buket1 and Buket2; data stored using the erasure code policy 4+1 may be written into Buket1, and data stored using the erasure code strategy 4+2 may be stored. Write to Buket2.
- the storage server includes Buket1, Buket2, Buket3, and Buket4; data stored by the erasure code strategy 4+1 may be written into Buket1 or Buket2, and data stored using the erasure code strategy 4+2 may be written into Buket3. Or Buket4.
- the specific storage method is not limited.
- the metadata has a corresponding relationship with the Buket, and the metadata may describe the data stored in the Buket corresponding thereto, and the metadata may also be referred to as the metadata of the Buket, or the metadata points to the Buket.
- metadata 1 has a correspondence relationship with Buket1
- metadata 1 describes data stored in Buket1
- metadata 1 points to Buket1
- metadata 2 has a correspondence relationship with Buket2
- metadata 2 describes storage in Buket2.
- the data, the metadata 2 points to the Buket1.
- only the metadata of one Buket is restored as an example for description.
- the user may send a metadata recovery instruction to the management server, and the management server determines, according to the received instruction, the storage space pointed to by the metadata to be restored; or the management server may automatically detect whether the metadata is lost. If yes, determine the storage space pointed to by the metadata to be restored; or, other devices may detect whether there is metadata loss in the management server, and if so, send a metadata recovery instruction to the management server, and the management server according to the received instruction , determine the storage space pointed to by the metadata to be restored.
- the data structure information includes: a correspondence between the storage space and each storage unit included therein; the storage unit is a minimum unit that stores the data segments, and the plurality of storage units constitute a storage space, and the metadata of the one storage space includes the Index information for multiple storage units.
- each Buket in the storage server is divided into a plurality of storage units.
- the storage unit is Unit, which is the smallest unit that stores data fragments.
- the division can be recorded as data structure information, and the data structure information includes the correspondence between the Buket and each Unit included therein.
- the management server may acquire the data structure information in advance, and determine, according to the data structure information, a Unit included in the Buket pointed to by the metadata to be restored.
- Each storage unit corresponds to an index information
- the index information is called a key or a unit key
- the key may include an identifier of the Buket, an attribute of the data fragment, and the like.
- the identifier of the Buket may be the name of the Buket or other, and is not limited.
- the attributes of the data segment may include the identifier of the corresponding target data, the data volume of the target data, and the corresponding erasure code strategy.
- the target data refers to the complete data corresponding to the data segment stored in the Unit, that is, the data before the segmentation, or the combined data.
- the metadata of a Buket contains the keys of multiple Units divided by the Buket. For example, as shown in FIG. 1, metadata 1 describes the data stored in Buket1, and assuming that Buket1 is divided into 6 units, metadata 1 contains the keys of the 6 units.
- the read index information includes a first identifier of a storage space where the corresponding storage unit is located, and a first attribute of the data segment stored by the corresponding storage unit.
- the index information of the storage unit may be stored in the storage server, so that even if the management server fails, the index information in the storage server can be read, and the metadata in the management server is restored.
- the index information of the storage unit may also be stored in the management server, and the metadata and index information in the management server may be stored in different areas, which is also reasonable.
- the index information and the metadata may also be stored in the same location.
- the metadata may be restored only by using the partial index information.
- the specific storage location of the index information is not limited.
- a key can be read in S203, and multiple keys can be read.
- the metadata can be read to point to the key of each unit included in the Buket. Since the metadata includes the key of each unit, each key can be directly copied, and the result is obtained. Metadata to be restored.
- the metadata may also be read to the key of the part included in the Buket.
- the "key of the partial unit" may be one or more keys.
- the metadata to be recovered can be recovered based on the read key.
- the Buket identifier included in the key read in S203 is referred to as a first identifier
- the attribute of the data segment included in the key read in S203 is referred to as a first attribute.
- S204 Determine the first identifier as a storage space identifier in each piece of index information included in the metadata to be restored.
- a plurality of keys included in a piece of metadata belong to the same Buket. Therefore, the Buket identifiers included in the multiple keys are the same, and both are the first identifier.
- S205 Determine, according to the first attribute and the preset data storage policy, a data segment attribute in each piece of index information included in the metadata to be restored.
- the attributes of the data segment may include an identifier of the corresponding target data, a data amount of the target data, a corresponding erasure code policy, and the like.
- the data of the target data in the key of the unit in which the target data is segmented is the same as the data of the target data, and the erasure code strategy corresponding to the same Buket is the same. Therefore, the attributes of the data segments in the plurality of keys can be restored based on the attributes of the data segments in a key.
- the metadata contains the key that points to each unit in the Buket, the information in each key is determined, and the metadata is restored.
- one Buket metadata may include one or more stripe data, and each strip data includes a plurality of Unit keys.
- the stripe data may be a stripe table, or may be in other forms, and is not limited.
- the data structure information in this embodiment includes the correspondence between the Buket and each stripe it contains, and the correspondence between each stripe and each unit included therein.
- the key includes not only the identifier of the Buket but also the attribute of the data segment, and the identifier of the corresponding stripe data.
- the identifier of the stripe data included in the key read in S203 is referred to as a second identifier.
- the method further includes: determining, according to the second identifier, or the second identifier and the preset stripe identifier rule, a stripe identifier in each piece of index information included in the metadata; S206 includes: recovering at least one piece of stripe data based on the storage space identifier, the data segment attribute, and the stripe identifier in each piece of index information included in the to-be-recovered metadata.
- the metadata contains one or more pieces of strip data, and the one or more strips of data are recovered, and the metadata is restored.
- the stripe identifier in each key included in the metadata is the same, and both are the second identifier. Based on the second identifier, the stripe identifier in each key included in the metadata can be determined.
- the Buket pointed to by the metadata to be restored includes multiple pieces of strip data, determining the stripe identifier in each key included in the metadata according to the second identifier and the preset stripe identification rule.
- X corresponds to strip data S1
- X2 corresponds to strip data S2, X3.
- the stripe identifiers S1 and S3 are read in S203, and the preset stripe labeling rules are identified according to the order of the numbers from small to large, then it can be determined that the stripe identifier in the key of the Unit storing X2 is S2. .
- the data segment attribute may include an intra-strip serial number and a data offset in addition to the identifier of the target data, the data amount of the target data, and the corresponding erasure code policy.
- the identifier of the target data included in the first attribute is referred to as a third identifier
- the data amount of the target data included in the first attribute is referred to as a first data amount
- the included in the first attribute The erasure code strategy is called the first erasure code strategy
- the intra-strip sequence number included in the first attribute is referred to as the first intra-band sequence number
- the data offset included in the first attribute is referred to as the first Data offset; in this case, S205 can include:
- a Buket corresponds to an erasure code strategy of 4+1
- each stripe in the Buket corresponds to 5 Units with a capacity of 1 MB.
- the data A is stored, and the data A to be stored is 11.5 MB, and the target data amount is 11.5 MB.
- the data A is divided into three pieces of data A1 (4 MB), A2 (4 MB), and A3 (3.5 MB), and each piece of data corresponds to one stripe; and the three pieces of data are separately stored by using the erasure code strategy 4+1.
- A1 Take A1 as an example:
- OSD is the storage server
- OSD_1, OSD_2, etc. are the storage server identifiers
- wwn can For disks, wwn_1, wwn_2, etc. can be disk identifiers.
- the data A1 is sliced and redundantly processed to obtain an original segment and a redundant segment.
- Each data segment in the strip corresponds to a quad [OSD, wwn, key, value>, where key represents the index information of the unit in which the data segment is located, and value represents the value or content of the data segment.
- the strip data corresponding to the record data A1 is:
- the same disk may belong to different storage servers at different times. Therefore, in this case, the storage stripe may not be included in the recorded stripe, that is, the recorded stripe data may also be for:
- Key_1, key_2 in the stripe data is the index information in this embodiment.
- the index information may be as shown in FIG. 3, including: a storage space identifier (Bucket), a stripe identifier (Stripe-id), and attributes of the data segment.
- the data offset may indicate the corresponding position of the stripe in the target data.
- the stripe data offset corresponding to A1 may be 0 MB
- the stripe data offset corresponding to A2 may be 4 MB
- the offset can be 8MB, which means that when the data A is divided into three pieces of data, the order of the three data is A1, A2, A3.
- the sequence may be indicated by a stripe identifier, which is reasonable.
- the metadata of the Buket may include the three pieces of stripe data: stripe data corresponding to A1, stripe data corresponding to A2, and stripe data corresponding to A3.
- the key includes: a storage space name (Bucket), a data identifier (Object-id), a stripe identifier (Stripe-id), a corresponding erasure code strategy (EC-type), a stripe serial number (EC-seq), Data offset (Offset, the offset of the stripe in data A) and the size of the target data amount (Object_len, the amount of data of the complete data corresponding to the stripe data).
- a key read in S203 includes: Bucket: 1, Object-id: A, Stripe-id: S1, EC-type: 4+1, EC-seq: 1, Offset: 0MB, Object_len: 11.5 MB.
- the first identifier of the bucket in the key is 1, so the bucket identifier in each key contained in the metadata is 1.
- the third identifier of the target data in the key is A. Therefore, the target data identifier in each key included in the metadata is A.
- the first erasure code strategy in the key is 4+1. Therefore, the erasure code policy in each key included in the metadata is 4+1.
- the first amount of data in the key is 11.5 MB, so the amount of data of the target data in each key included in the metadata is 11.5 MB.
- the erasure code strategy 4+1 indicates that one stripe data corresponds to 5 units, wherein 4 units store original data fragments, 1 unit stores redundant data fragments, and assuming a Unit capacity of 1 MB, the management server A stripe of data points to a maximum of 4MB of data in the storage server. Therefore, it is determined that the target data A storing 11.5 MB needs to be allocated three pieces of strip data, and when the metadata is restored, three pieces of strip data are also recovered.
- the second identifier of the stripe data in the key is S1. If the preset stripe identification rule is that the sequence number is +1 from 1 to 1, the identifiers of the three stripe data are determined as: S1, S2, and S3.
- the offset rule in the preset data storage policy is : "According to the stripe identifier from small to large, the data offset gradually increases", it is determined that the data offset of the three stripe data is: S1 data offset is 0MB, S2 data offset The amount is 4MB, and the data offset of S3 is 8MB.
- the first band in the key has a sequence number of 1. If the ordering rule in the preset data storage policy is +1, the number of the key in each strip data is determined as follows: 1, 2, 3, 4, 5.
- key_1 includes: Bucket: 1, Object-id: A, Stripe-id :S1, EC-type: 4+1, EC-seq: 1, Offset: 0MB, Object_len: 11.5MB
- key_2 includes: Bucket: 1, Object-id: A, Stripe-id: S1, EC-type: 4 +1, EC-seq: 2, Offset: 0MB, Object_len: 11.5MB
- key_3 includes: Bucket: 1, Object-id: A, Stripe-id: S1, EC-type: 4+1, EC-seq: 3 , Offset: 0MB, Object_len: 11.5MB
- key_4 includes: Bucket: 1, Object-id: 1, Object-id:
- key_1 includes: Bucket: 1, Object-id: A, Stripe-id :S2, EC-type: 4+1, EC-seq: 1, Offset: 4MB, Object_len: 11.5MB
- key_2 includes: Bucket: 1, Object-id: A, Stripe-id: S2, EC-type: 4 +1, EC-seq: 2, Offset: 4MB, Object_len: 11.5MB
- key_3 includes: Bucket: 1, Object-id: A, Stripe-id: S2, EC-type: 4+1, EC-seq: 3 , Offset: 4MB, Object_len: 11.5MB
- key_4 includes: Bucket: 1, Object-id: A, Stripe-id: S2, EC-type: 4+1, EC-seq: 3 , Offset: 4MB, Object_len: 11.5MB
- key_4 includes: Bucket: 1, Object
- key_1 includes: Bucket: 1, Object-id: A, Stripe-id :S3, EC-type: 4+1, EC-seq: 1, Offset: 8MB, Object_len: 11.5MB
- key_2 includes: Bucket: 1, Object-id: A, Stripe-id: S3, EC-type: 4 +1, EC-seq: 2, Offset: 8MB, Object_len: 11.5MB
- key_3 includes: Bucket: 1, Object-id: A, Stripe-id: S3, EC-type: 4+1, EC-seq: 3 , Offset: 8MB, Object_len: 11.5MB
- key_4 includes: Bucket: 1, Object-id: A, Stripe-id: S3, EC-type: 4+1, EC-seq: 3 , Offset: 8MB, Object_len: 11.5MB
- key_4 includes: Bucket: 1, Object
- the metadata may include target data information in addition to the stripe data.
- the data A is divided into three pieces of data A1, A2, and A3, and each piece of data corresponds to one piece of strip data; in this case, one piece of target data information can be saved for the data A, and the target data information indicates one The complete data corresponds to which strip data.
- the The target stripe data in the metadata identifies the same stripe data to form a target data information.
- the target stripe data has the same strip data corresponding to the same complete data, and the stripe data with the same target data identifier is composed of one target data information, and when the data is subsequently read, only the target data information needs to be found.
- the strip data constituting the data can be known, and the reading efficiency is improved.
- a storage space is divided into a plurality of storage units, and metadata of the one storage space includes index information of the plurality of storage units; when the metadata is restored, the to-be-recovered element is read.
- the index information of the storage unit included in the storage space pointed by the data is recovered by using the read index information, and the metadata can be read later by using the metadata.
- the metadata includes a plurality of pieces of stripe data, each stripe of data comprising index information of a plurality of storage locations. If a system abnormality or hardware damage occurs, the index information in the stripe data may be lost.
- the embodiment of the present application further provides a stripe data recovery method, as shown in FIG. 4, including:
- the target stripe data of the missing index information may be first determined; determining whether the target stripe data is filled: if the full stripe data is filled, the target stripe data is directly determined. If the data is not complete, if it is not full, it is further determined whether the storage unit corresponding to the missing index information in the target strip data is an empty storage unit, and if not, the target strip data is determined as an incomplete strip. data.
- the target stripe data is not full stripe data, and the index information lost in the uncompleted stripe data is the index information of the empty storage unit, in this case, there is no data loss, and the user can read the data normally, It is not necessary to perform the scheme for data recovery, and therefore, the uncompleted stripe data is not determined as incomplete stripe data.
- S402 Determine, according to the data structure information, a storage unit pointed to by the incomplete stripe data as a target storage unit.
- the data structure information includes a correspondence relationship between the stripe data and each unit included therein. Therefore, based on the data structure information, the unit pointed to by the incomplete stripe data can be determined as the target unit.
- the target unit corresponds to the same strip data as the unit with the missing key, that is, the incomplete strip data.
- the number of index information lost in the incomplete stripe data may be first counted; whether the quantity is greater than m, and the m is corresponding to the incomplete stripe data.
- the number of redundant segments in the erasure code strategy if not, executing S402; if yes, reconstructing the target data corresponding to the incomplete strip data; using the preset erasure code strategy k+m,
- the target data is stored; the new strip data corresponding to the target data is obtained.
- k the original fragment number
- m the redundant segment number
- n the total number of data segment shares.
- the number of missing index information 2 is greater than m(1).
- other pieces of information existing in the strip data are used to read the undiscovered data segments, and the data segments reconstructed are used to reconstruct the data to obtain the target.
- Data the target data is the reconstructed data A.
- the data A can then be re-stored using the erasure code strategy 4+1, similar to the above process, and the new stripe data of the data A is regenerated.
- the new stripe data may be generated by a storage server that obtains the new stripe data from the storage server, or the new stripe data may also be generated by the management server.
- the number of missing index information 1 is not greater than m(1). In this case, S402 and subsequent steps are performed.
- S403 Read index information of the target storage unit, and obtain a target storage space identifier, a target strip identifier, and a target attribute of the data segment.
- the index information may include a storage space identifier (Bucket), a stripe identifier (Stripe-id), an attribute of the data segment, an identifier of the target data (Object-id), and an erasure code.
- Policy EC-type
- intra-strip serial number EC-seq
- data offset Offset, the offset of the stripe in data A
- the amount of data of the target data Object_len, corresponding to the stripe data
- the amount of data of the complete data is not limited.
- the storage space identifier read in S403 is referred to as a target storage space identifier
- the stripe identifier read in 303 is referred to as a target strip identifier
- the attribute of the data segment read in S403 is called For the target attribute.
- S404 Determine the target storage space identifier as the storage space identifier in the lost index information.
- the lost key belongs to the same strip data as the key read in S403. Therefore, the lost key is the same as the storage space identifier in the key read in S403, and is the target storage space identifier.
- S405 Determine the target stripe identifier as a stripe identifier in the missing index information.
- the lost key and the key read in S403 also belong to the same strip data. Therefore, the lost key is the same as the stripe identifier in the key read in S403, and is the target stripe identifier.
- S406 Determine a data segment attribute in the lost index information according to the target attribute.
- the data segment attribute includes: the corresponding erasure code strategy, the intra-strip sequence number, the data amount of the corresponding target data, and the data offset.
- the erasure code policy read in S403 is referred to as a target erasure code strategy
- the intra-strip sequence number read in S403 is referred to as a target sequence number
- the amount of data read in S403 is referred to as a target number.
- the target data amount is referred to as the target data offset by the data offset read in S402.
- S406 can include: determining, by the target erasure code policy, an erasure code policy in the lost index information;
- the target erasure code strategy read in S403 is 4+1, the target sequence number includes 1, 3, 4, and 5, and the target data amount is 4 MB.
- the ordering rule in the preset data storage policy can be understood as 1-5 sequential arrangement. After reading 1, 3, 4, and 5, it can be determined that the serial number in the strip corresponding to the missing index information is 2. (3) The data amount of the target data corresponding to the same strip data is the same. Therefore, the read target data amount of 4 MB can be directly used as the data amount in the missing index information.
- the offset rule in the preset data storage strategy may be: each strip is offset by 4 MB more than the previous strip. In this example, the data A only corresponds to one strip, this one strip The data offset for the band is 0MB.
- S407 Restore the incomplete stripe data based on the storage space identifier, the stripe identifier, and the data fragment attribute in the lost index information.
- the missing index information includes: an erasure code strategy 4+1, a stripe number 2, a data amount 4MB, and a data offset of 0MB; and the determined content is added to the incomplete strip. With the data, the recovery of the incomplete strip data is completed.
- the incomplete stripe data is determined, that is, the stripe data of the index information is lost, and the index information existing in the incomplete stripe data is used to recover the lost index.
- Information thus, if there is a system abnormality, or hardware damage, etc., the index information is lost in the stripe data, and the lost index information can be restored by applying the scheme.
- the stored data corresponding to the lost index information may be reconstructed.
- the data length corresponding to the lost index information may be determined; and the stored data corresponding to the lost index information is reconstructed according to the data length and the lost index information.
- the data length corresponding to the index information may include: pre-acquiring the storage unit capacity, according to the storage unit capacity and the target data. The amount of data stored in each lost storage unit is determined, and the lost storage unit is the storage unit corresponding to the lost index information.
- the data when the data is stored by using the erasure code strategy, the data is generally equally divided. If the average is not averaged, the last bit is complemented by 0 and then divided; therefore, other storage except the tail storage unit
- the data lengths in the cells are equal, both equal to the memory cell capacity, and since the tail memory cells may contain "0" data, the data length of the tail memory cells may be equal to, and may be less than, the memory cell capacity.
- the storage unit corresponding to the strip data is divided into a tail storage unit and a non-tail storage unit: for the non-tail storage unit, the corresponding data length is equal to the storage unit capacity, and the tail storage unit is In other words, its corresponding data length may be equal to, and may be smaller than, the above storage unit capacity.
- the data length corresponding to the tail storage unit can be calculated by the following formula: Object_len-4*X*Y+X, where Object_len is the target data amount, X is the storage unit capacity, and Y is the stored complete data. The number of stripes.
- the tail storage unit in this embodiment refers to a storage unit in which a data segment that may eventually be "0" is added when the data is segmented.
- the data stored in the lost storage unit may be reconstructed by using the lost index information and the determined data length.
- the original strip data corresponding to the data B is:
- the lost index information includes: an erasure code strategy 4+1, a stripe number 2, and a data volume of 4 MB. It can be seen from the serial number 2 in the strip that the lost storage unit is unit2, unit2 is a non-tail storage unit, and the data length corresponding to unit2 is 1 MB (storage unit capacity).
- the lost index information and the determined data length corresponding to unit2 (1 MB) reconstruct the stored data in unit 2, that is, reconstruct the data corresponding to the lost index information.
- the present embodiment is used to determine the incomplete stripe data, that is, the stripe data in which the index information is lost, and use the index information existing in the incomplete stripe data to recover the lost index information, and reconstruct the lost index information.
- Corresponding storage data thus, if a system abnormality or hardware damage occurs, the index information is lost in the strip data, and the application first restores the lost index information, and then performs data corresponding to the index information. Refactoring, data recovery is achieved, so that the data corresponding to the stripe data can be read.
- the data B corresponds to one strip, and if the data B is large, a plurality of strips may be corresponding.
- one strip corresponds to five storage units with a capacity of 1 MB, and the data B to be stored is 11.5 MB (target data amount), and the data B can be divided into three data B1 (4 MB), B2 (4 MB), and B3. (3.5MB), using the erasure code strategy 4+1, the three data are stored separately.
- B1 is divided into 4 original segments (1 MB per segment), and the 4 original segments are expanded and coded to obtain 1 redundant segment; the 5 data segments (4 original segments and One redundant segment is stored to the above five memory cells having a capacity of 1 MB, and the five data segments correspond to one strip.
- Object_len is 11.5MB
- X is 1MB
- Y is 3
- the data length is 1MB; store the 5 data segments (4 original segments and 1 redundant segment) to 5 storage units with a capacity of 1MB, and the 5 data segments correspond to one strip. With data.
- the index information and the determined data length corresponding to the unit 4 (0.5 MB) reconstruct the stored data in the unit 4, that is, the data corresponding to the lost index information.
- the embodiment of the present application further provides a data recovery device, as shown in FIG. 5, including:
- a first determining module 501 configured to determine a storage space pointed to by the metadata to be restored, where the storage space is located in a storage server of the distributed system;
- a second determining module 502 configured to determine, according to pre-acquired data structure information, a storage unit included in the storage space, where the data structure information includes: a correspondence between a storage space and each storage unit included therein;
- the unit is a minimum unit for storing data segments, and the plurality of storage units constitute a storage space, and the metadata of the one storage space includes index information of the plurality of storage units;
- the first reading module 503 is configured to read the index information of the determined storage unit, where the read index information includes the first identifier of the storage space where the corresponding storage unit is located, and the data stored by the corresponding storage unit.
- a third determining module 504 configured to determine the first identifier as a storage space identifier in each piece of index information included in the to-be-recovered metadata;
- the fourth determining module 505 is configured to determine, according to the first attribute and the preset data storage policy, a data segment attribute in each piece of index information included in the to-be-recovered metadata;
- the first recovery module 506 is configured to recover the to-be-recovered metadata based on the storage space identifier and the data fragment attribute in each piece of index information included in the to-be-recovered metadata.
- the data structure information may include: a correspondence between a storage space and each stripe data included therein, and a correspondence between each stripe data and each storage unit included therein; and one storage
- the metadata of the space includes at least one piece of stripe data, and each piece of stripe data includes index information of a plurality of storage units; the read index information further includes a second identifier of the corresponding stripe data;
- the device may further include:
- a fifth determining module (not shown), configured to determine, according to the second identifier, or the second identifier and a preset stripe identification rule, a stripe in each index information included in the metadata Identification
- the first recovery module 506 can be specifically configured to:
- the data segment attribute includes an identifier of the corresponding target data, a data amount of the target data, a corresponding erasure code policy, a serial number in the strip, and a data offset; the first attribute a third identifier including the corresponding target data, a first data amount of the corresponding target data, a first erasure code strategy, a first intra-band sequence number, and a first data offset;
- the fourth determining module 505 is specifically configured to:
- the metadata further includes at least one piece of target data information
- the device may further include:
- the combination module (not shown) is configured to group the stripe data with the same target data identifier in the metadata into one piece of target data information.
- the data structure information may include: a correspondence between a storage space and each stripe data included therein, and a correspondence between each stripe data and each storage unit included therein; and one storage
- the metadata of the space includes at least one piece of stripe data, and each piece of stripe data includes index information of a plurality of storage units;
- the device may further include: a sixth determining module, a seventh determining module, a second reading module, an eighth determining module, a ninth determining module, a tenth determining module, and a second restoring module (not shown), among them,
- a sixth determining module configured to determine incomplete stripe data, where the incomplete stripe data is stripe data that loses index information
- a seventh determining module configured to determine, according to the data structure information, a storage unit pointed to by the incomplete stripe data as a target storage unit;
- a second reading module configured to read index information of the target storage unit, to obtain a target storage space identifier, a target strip identifier, and a target attribute of the data segment;
- An eighth determining module configured to determine the target storage space identifier as a storage space identifier in the lost index information
- a ninth determining module configured to determine the target stripe identifier as a stripe identifier in the lost index information
- a tenth determining module configured to determine, according to the target attribute, a data segment attribute in the lost index information
- a second recovery module configured to recover the incomplete stripe data based on the storage space identifier, the stripe identifier, and the data fragment attribute in the lost index information.
- the data segment attribute includes a corresponding erasure code policy, a sequence number in a stripe, a data amount of the corresponding target data, and a data offset;
- the target attribute includes a target erasure code strategy, a target sequence number. , target data amount, target data offset;
- the tenth determining module may be specifically configured to:
- the device may further include: a statistics module and a determining module (not shown), where
- a statistics module configured to count the number of index information lost in the incomplete stripe data
- the determining module is configured to determine whether the quantity is greater than m, where m is a number of redundant segment numbers in the erasure code policy corresponding to the incomplete stripe data; if not, triggering the seventh determining module.
- the device may further include: a first reconstruction module, a storage module, and an obtaining module (not shown), where
- a first reconstruction module configured to: when the determining module determines that the quantity is greater than m, reconstruct target data corresponding to the incomplete strip data;
- a storage module configured to store the target data by using a preset erasure code strategy k+m;
- Obtaining a module configured to obtain new strip data corresponding to the target data.
- the sixth determining module may be specifically configured to:
- the target strip data is determined as incomplete strip data
- the target strip data is determined as incomplete strip data.
- the device may further include:
- a second reconstruction module (not shown), configured to determine a data length corresponding to the lost index information, and reconstructing, according to the data length and the lost index information, the lost index information corresponding to Store data.
- a storage space is divided into a plurality of storage units, and metadata of the one storage space includes index information of the plurality of storage units; when the metadata is restored, the to-be-recovered element is read.
- the index information of the storage unit included in the storage space pointed by the data is recovered by using the read index information, and the metadata can be read later by using the metadata.
- the embodiment of the present application further provides a management server, as shown in FIG. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604.
- the processor 601, the communication interface 602, and the memory 603 are completed through the communication bus 604. Communication with each other,
- the processor 601 is configured to implement any of the above data recovery methods when executing the program stored on the memory 603.
- the communication bus mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus.
- PCI Peripheral Component Interconnect
- EISA Extended Industry Standard Architecture
- the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
- the communication interface is used for communication between the above management server and other devices.
- the memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
- RAM random access memory
- NVM non-volatile memory
- the memory may also be at least one storage device located away from the aforementioned processor.
- the above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processing (DSP), dedicated integration.
- CPU central processing unit
- NP network processor
- DSP digital signal processing
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by the processor, implements any one of the foregoing data recovery methods.
- the embodiment of the present application also provides an executable program code for being executed to execute any of the above data recovery methods.
- the embodiment of the present application further provides a distributed system, as shown in FIG. 1 , including: a storage server and a management server, where the storage server includes at least one storage space, each storage space includes multiple storage units, and is stored.
- the unit is the smallest unit that stores the data segment;
- the storage server is configured to store index information of each storage unit in the storage server
- the management server is configured to determine a storage space pointed to by the metadata to be restored, where the storage space is located in a storage server of the distributed system; and determining, according to pre-acquired data structure information, a storage unit included in the storage space;
- the data structure information includes: a correspondence between the storage space and each storage unit included therein; the metadata of one storage space includes index information of the plurality of storage units in the one storage space; and the determined storage is read The index information of the unit, wherein the read index information includes a first identifier of a storage space in which the corresponding storage unit is located, and a first attribute of a data segment stored in the corresponding storage unit; determining the first identifier as a Determining a storage space identifier in each piece of index information included in the recovery metadata; determining, according to the first attribute, and a preset data storage policy, a data segment attribute in each piece of index information included in the to-be-recovered metadata; a storage space identifier and a piece of data in each piece
- the data structure information includes: a correspondence between a storage space and each stripe data included therein, and a correspondence between each stripe data and each storage unit included therein; and a storage space Metadata includes at least one stripe data, and each stripe data includes index information of a plurality of storage units;
- the management server can also be used to:
- the incomplete stripe data being stripe data of missing index information
- the management server in the distributed system can also be used to perform any of the above data recovery methods.
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
本申请要求于2017年8月25日提交中国专利局、申请号为201710742705.4、发明名称为“一种数据恢复方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及数据处理技术领域,特别涉及一种数据恢复方法及装置。
纠删码(erasure coding,EC)是一种数据保护方法,纠删码策略可以用n=k+m来表示,其中,k表示原始片段份数,m表示冗余片段份数,n表示总的数据片段份数。具体的,可以将待存储数据分割成k个原始片段,基于这k个原始片段进行扩展、编码,得到m个冗余片段;将这k个原始片段和m个冗余片段分别存储至各个存储单元中;这样,如果某个存储单元出现故障导致数据丢失,则可以根据未丢失的原始片段及冗余片段对丢失的数据片段进行恢复。
上述方案中,利用纠删码策略将待存储数据进行存储后,通常记录该数据对应的元数据。元数据,即为描述数据的数据(data about data),主要是描述数据属性的相关信息,用来支持如指示存储位置、历史数据、资源查找、文件记录等功能。后续读取该数据时,可以利用元数据将各个数据片段组合成该数据。
如果出现***异常、或者硬件损坏等情况,导致元数据丢失,便无法读取到丢失元数据对应的数据。
发明内容
本申请实施例的目的在于提供一种数据恢复方法及装置,以实现在丢失元数据后,对元数据进行恢复。
为达到上述目的,本申请实施例公开了一种数据恢复方法,应用于分布式***中的管理服务器,所述方法包括:
确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;
基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关 系;存储单元为存储数据片段的最小单元,多个存储单元构成一个存储空间,所述一个存储空间的元数据包含所述多个存储单元的索引信息;
读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;
将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;
根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据片段属性;
基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据。
为达到上述目的,本申请实施例还公开了一种数据恢复装置,应用于分布式***中的管理服务器,所述装置包括:
第一确定模块,用于确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;
第二确定模块,用于基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;存储单元为存储数据片段的最小单元,多个存储单元构成一个存储空间,所述一个存储空间的元数据包含所述多个存储单元的索引信息;
第一读取模块,用于读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;
第三确定模块,用于将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;
第四确定模块,用于根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据片段属性;
第一恢复模块,用于基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据。
为达到上述目的,本申请实施例还公开了一种管理服务器,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信 总线完成相互间的通信;
存储器,用于存放计算机程序;
处理器,用于执行存储器上所存放的程序时,实现上述任一种数据恢复方法。
为达到上述目的,本申请实施例还公开了一种分布式***,包括:存储服务器和管理服务器,其中,所述存储服务器中包含至少一个存储空间,每个存储空间包含多个存储单元,存储单元为存储数据片段的最小单元;
所述存储服务器,用于存储所述存储服务器中的每个存储单元的索引信息;
所述管理服务器,用于确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;一个存储空间的元数据包含所述一个存储空间中多个存储单元的索引信息;读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据片段属性;基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据。
为达到上述目的,本申请实施例还公开了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种数据恢复方法。
为达到上述目的,本申请实施例还公开了一种可执行程序代码,所述可执行程序代码用于被运行以执行上述任一种数据恢复方法。
应用本申请实施例,将一个存储空间划分为多个存储单元,该一个存储空间的元数据包含该多个存储单元的索引信息;对元数据进行恢复时,读取待恢复元数据指向的存储空间所包含的存储单元的索引信息,利用所读取的索引信息,恢复得到元数据,后续便可以利用元数据进行数据的读取。
当然,实施本申请的任一产品或方法并不一定需要同时达到以上所述的所有优点。
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种分布式***的结构示意图;
图2为本申请实施例提供的数据恢复方法的第一种流程示意图;
图3为本申请实施例提供的一种索引信息的结构示意图;
图4为本申请实施例提供的数据恢复方法的第二种流程示意图;
图5为本申请实施例提供的一种数据恢复装置的结构示意图;
图6为本申请实施例提供的一种管理服务器的结构示意图。
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为了解决上述技术问题,本申请实施例提供了一种数据恢复方法及装置,该方法可以应用于分布式***中的管理服务器。分布式***可以如图1所示,包括存储服务器和管理服务器,存储服务器存储数据,管理服务器存储元数据。元数据,即为描述数据的数据(data about data),这里主要是描述存储服务器中数据的属性信息。通过管理服务器中的元数据,才能读取到存储服务器中的数据。如果管理服务器出现故障,导致元数据丢失,则无法读取到存储服务器中存储的数据。利用本申请实施例,可以恢复管理服务器中丢失的元数据。
下面首先对本申请实施例提供的一种数据恢复方法进行详细说明。
图2为本申请实施例提供的一种数据恢复方法的流程示意图,包括:
S201:确定待恢复元数据指向的存储空间,该存储空间位于分布式***的存储服务器中。
本实施例中的存储空间为存储服务器中的Buket,一个Buket可以仅对应一种纠删码策略。举例来说,一台存储服务器中可以包含多个Buket:Buket1和Buket2;可以将利用纠删码策略4+1进行存储的数据写入Buket1,将利用纠删码策略4+2进行存储的数据写入Buket2。或者,存储服务器中包含Buket1、Buket2、Buket3和Buket4;可以将利用纠删码策略4+1进行存储的数据写入Buket1或Buket2,将利用纠删码策略4+2进行存储的数据写入Buket3或Buket4。具体存储方式不做限定。
在本申请实施例中,元数据与Buket存在对应关系,元数据可以描述其所对应的Buket中存储的数据,该元数据也可以称为该Buket的元数据,或者说该元数据指向该Buket。例如图1中所示,元数据1与Buket1存在对应关系,则元数据1描述Buket1中存储的数据,元数据1指向Buket1;元数据2与Buket2存在对应关系,则元数据2描述Buket2中存储的数据,元数据2指向Buket1……本申请实施例中,仅以恢复一个Buket的元数据为例进行说明。
用户在检测到元数据丢失后,可以向管理服务器发送元数据恢复指令,管理服务器根据接收到的指令,确定待恢复元数据指向的存储空间;或者,管理服务器也可以自动检测是否有元数据丢失,如果有,确定待恢复元数据指向的存储空间;或者,其他设备也可以检测管理服务器中是否有元数据丢失,如果有,则向管理服务器发送元数据恢复指令,管理服务器根据接收到的指令,确定待恢复元数据指向的存储空间。
S202:基于预先获取的数据结构信息,确定该存储空间包含的存储单元。其中,该数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;存储单元为存储数据片段的最小单元,多个存储单元构成一个存储空间,该一个存储空间的元数据包含该多个存储单元的索引信息。
在本申请实施例中,将存储服务器中的每个Buket划分为多个存储单元。存储单元为Unit,Unit为存储数据片段的最小单元。将Buket划分为多个Unit后,可以将该划分情况记录为数据结构信息,该数据结构信息中包括Buket与其包含的每个Unit的对应关系。管理服务器可以预先获取该数据结构信息,基于该数据结构信息,确定待恢复元数据指向的Buket包含的Unit。
每个存储单元对应一个索引信息,索引信息称为key、或Unit key,key中可以包含所在Buket的标识、数据片段的属性等。Buket的标识可以为Buket的名称或其他,具体不做限定;数据片段的属性可以包含所对应目标数据的标识、目标数据的数据量、所对应纠删码策略等,具体不做限定。该目标数据是指Unit中存储的数据片段对应的完整数据,也就是切分前的数据,或者组合后的数据。
一个Buket的元数据中,包含该Buket所划分的多个Unit的key。例如图1中所示,元数据1描述Buket1中存储的数据,假设Buket1被划分为6个Unit,则元数据1包含该6个Unit的key。
S203:读取所确定的存储单元的索引信息。其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性。
在本申请实施例中,存储单元的索引信息可以存储在存储服务器中,这样,即使管理服务器出现故障,仍可以读取存储服务器中的索引信息,对管理服务器中的元数据进行恢复。或者,存储单元的索引信息也可以存储在管理服务器中,管理服务器中的元数据与索引信息可以存储在不同的区域中,也是合理的。或者,索引信息与元数据也可以存储在相同位置,应用本申请实施例,仅利用部分索引信息便可以恢复元数据。索引信息的具体存储位置不做限定。
S203中可以读取一条key,也可以读取多条key。作为一种实施方式,可以读取元数据指向Buket中包含的每个Unit的key,由于元数据中包含该每个Unit的key,因此可以直接对读取的每个key进行复制,便得到了待恢复的元数据。
作为另一种实施方式,也可以读取元数据指向Buket中包含的部分Unit的key,这里所说的“部分Unit的key”可以为一条或多条key。这种情况下,可以基于读取到的key,恢复得到待恢复的元数据。
为了方便描述,将S203中读取到的key里包含的Buket标识称为第一标识,将S203中读取到的key里包含的数据片段的属性称为第一属性。
S204:将第一标识确定为待恢复元数据包含的每条索引信息中的存储空间标识。
根据前面内容描述,一份元数据中包含的多条key属于同一Buket,因此, 这多条key中包含的Buket标识相同,都为第一标识。
S205:根据第一属性、以及预设数据存储策略,确定待恢复元数据包含的每条索引信息中的数据片段属性。
如上所述,数据片段的属性可以包含所对应目标数据的标识、目标数据的数据量、所对应纠删码策略等。一份目标数据切分得到的多个数据片段所在Unit的key中目标数据的标识、目标数据的数据量相同,而且,同一Buket所对应的纠删码策略相同。因此,可以基于一条key中的数据片段的属性,恢复得到多条key中的数据片段的属性。
S206:基于待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到待恢复元数据。
如上所述,由于元数据中包含其指向Buket中每个Unit的key,因此,确定出该每个key中的信息,也就恢复得到了元数据。
作为一种实施方式,一个Buket的元数据中可以包含一份或多份条带数据(Stripe),每份条带数据中包含多个Unit的key。该条带数据可以为Stripe表,或者,也可以为其他形式,具体不做限定。
本实施方式中的数据结构信息中包括Buket与其包含的每份Stripe的对应关系、以及每份Stripe与其包含的每个Unit的对应关系。
本实施方式中,key中不仅包含所在Buket的标识、数据片段的属性,还包含所对应条带数据的标识。为了方便描述,将S203中读取的key中包含的条带数据的标识称为第二标识。
本实施方式中,在S206之前还可以包括:根据所述第二标识、或者所述第二标识及预设条带标识规则,确定所述元数据包含的每条索引信息中的条带标识;S206包括:基于所述待恢复元数据包含的每条索引信息中的存储空间标识、数据片段属性及条带标识,恢复得到至少一份条带数据。
元数据中包含一份或多份条带数据,恢复得到这一份或多份条带数据,便恢复得到了元数据。
如果待恢复元数据指向的Buket中仅包含一份条带数据,则元数据包含的每条key中的条带标识都相同,都为该第二标识。则仅根据该第二标识,便可以确定元数据包含的每条key中的条带标识。
如果待恢复元数据指向的Buket中包含多份条带数据,则根据该第二标识 及预设条带标识规则,确定元数据包含的每条key中的条带标识。
例如,目标数据X较大,将X切分为多份条带进行存储,假设将X切分为三份数据X1、X2和X3,X1对应条带数据S1,X2对应条带数据S2,X3对应条带数据S3。假设S203中仅读取到条带标识S1和S3,且预设条带标识规则为根据数字由小到大的顺序进行标识,则可以确定出存储X2的Unit的key中的条带标识为S2。
在本实施方式中,上述数据片段属性除目标数据的标识、目标数据的数据量、所对应纠删码策略之外,还可以包含条带内序号、数据偏移量。为了方便描述,将第一属性中的包含的目标数据的标识称为第三标识,将第一属性中的包含的目标数据的数据量称为第一数据量,将第一属性中的包含的纠删码策略称为第一纠删码策略,将第一属性中的包含的条带内序号称为第一条带内序号,将第一属性中的包含的数据偏移量称为第一数据偏移量;这种情况下,S205可以包括:
根据所述第三标识,确定所述元数据包含的每条索引信息中的目标数据标识;
根据所述第一数据量,确定所述元数据包含的每条索引信息中的目标数据的数据量;
将所述第一纠删码策略确定为所述元数据包含的每条索引信息中的纠删码策略;
根据所述第一条带内序号及预设数据存储策略中的排序规则,确定所述元数据包含的每条索引信息中的条带内序号;
根据所述第一数据偏移量及预设数据存储策略中的偏移规则,确定所述元数据包含的每条索引信息中的数据偏移量。
举例来说,假设一Buket对应的纠删码策略为4+1,该Buket中每份Stripe对应5个容量为1MB的Unit。对数据A进行存储,待存储数据A为11.5MB,则目标数据量为11.5MB。将数据A分成三份数据A1(4MB)、A2(4MB)和A3(3.5MB),每份数据对应一份Stripe;利用纠删码策略4+1,分别对这三份数据进行存储。以A1为例进行说明:
先分配条带:
{<OSD_1,wwn_1>,<OSD_2,wwn_2>,<OSD_3,wwn_3>,<OSD_4,wwn_4>,<OSD_5,wwn_5>},其中,OSD为存储服务器,OSD_1、OSD_2等为存储服务器标识,wwn可以为磁盘,wwn_1、wwn_2等可以为磁盘标识。
根据该纠删码策略4+1,对该数据A1进行切片及冗余处理,得到原始片段及冗余片段。条带中的每个数据片段对应一个四元组<OSD,wwn,key,value>,其中,key表示数据片段所在的Unit的索引信息,value表示数据片段的值或内容。
记录数据A1对应的条带数据为:
{<OSD_1,wwn_1,key_1,value_1>,<OSD_2,wwn_2,key_2,value_2>,<OSD_3,wwn_3,key_3,value_3>,<OSD_4,wwn_4,key_4,value_4>,<OSD_5,wwn_5,key_5,value_5>}。
在一些实施方式中,同一个磁盘在不同时刻可以属于不同的存储服务器,因此,在这种情况下,记录的条带中可以不包括存储服务器标识,也就是说,记录的条带数据也可以为:
{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn_5,key_5>}。
条带数据中的key_1,key_2即为本实施例中的索引信息,该索引信息可以如图3所示,包含:存储空间标识(Bucket)、条带标识(Stripe-id)、数据片段的属性{所对应目标数据的标识(Object-id)、纠删码策略(EC-type)、条带内序号(EC-seq)、数据偏移量(Offset,条带在数据A中的偏移量)、目标数据的数据量大小(Object_len,条带数据对应的完整数据的数据量)},等等,具体不做限定。
数据偏移量可以表示条带在目标数据中对应的位置,比如,A1对应的条带数据偏移量可以为0MB,A2对应的条带数据偏移量可以为4MB,A3对应的条带数据偏移量可以为8MB,这表示将数据A分成三份数据时,这三份数据的先后顺序为A1、A2、A3。或者,也可以通过条带标识表示该先后顺序,这都是合理的。
A2、A3的存储过程类似,不再赘述。该Buket的元数据可以包含这三份条带数据:A1对应的条带数据、A2对应的条带数据和A3对应的条带数据。
下面介绍利用key对元数据进行恢复的过程:
假设key包括:存储空间名称(Bucket)、数据标识(Object-id)、条带标 识(Stripe-id)、对应的纠删码策略(EC-type)、条带内序号(EC-seq)、数据偏移量(Offset,条带在数据A中的偏移量)和目标数据量的大小(Object_len,条带数据对应的完整数据的数据量)。
延续上述例子,假设上述生成的元数据,即三份条带数据丢失。假设S203中读取的一条key中包括:Bucket:1,Object-id:A,Stripe-id:S1,EC-type:4+1,EC-seq:1,Offset:0MB,Object_len:11.5MB。
该key中的Bucket的第一标识为1,因此,元数据包含的每条key中的Bucket标识为1。该key中的目标数据的第三标识为A,因此,元数据包含的每条key中的目标数据标识为A。该key中的第一纠删码策略为4+1,因此,元数据包含的每条key中的纠删码策略为4+1。该key中的第一数据量为11.5MB,因此,元数据包含的每条key中的目标数据的数据量为11.5MB。
纠删码策略4+1,表示一份条带数据对应5个Unit,其中,4个Unit存储原始数据片段,1个Unit存储冗余数据片段,假设一个Unit容量为1MB,则管理服务器中的一份条带数据指向存储服务器中数据的数据量最大为4MB。因此,确定出存储11.5MB的目标数据A需要分配三份条带数据,对元数据进行恢复时,也要恢复出三份条带数据。
该key中的条带数据的第二标识为S1,假设预设条带标识规则为序号由1开始依次+1,则确定该三份条带数据的标识分别为:S1、S2、S3。
由于管理服务器中的一份条带数据指向存储服务器中的存储数据的数据量最大为4MB,且该key中的第一数据偏移量为0MB,假设预设数据存储策略中的偏移规则为:“按照条带标识由小到大,数据偏移量逐渐增大”,则确定该三份条带数据的数据偏移量分别为:S1的数据偏移量为0MB,S2的数据偏移量为4MB,S3的数据偏移量为8MB。
该key中的第一条带内序号为1,假设预设数据存储策略中的排序规则为序号依次+1,则确定每份条带数据中key的条带内序号分别为:1、2、3、4、5。
假设所要恢复的元数据对应的存储空间位于磁盘wwn_1中,则确定出三份条带数据具体为:
第一份:
{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn_5,key_5>},其中,key_1包括:Bucket:1,Object-id:A,Stripe-id:S1,EC-type: 4+1,EC-seq:1,Offset:0MB,Object_len:11.5MB;key_2包括:Bucket:1,Object-id:A,Stripe-id:S1,EC-type:4+1,EC-seq:2,Offset:0MB,Object_len:11.5MB;key_3包括:Bucket:1,Object-id:A,Stripe-id:S1,EC-type:4+1,EC-seq:3,Offset:0MB,Object_len:11.5MB;key_4包括:Bucket:1,Object-id:A,Stripe-id:S1,EC-type:4+1,EC-seq:4,Offset:0MB,Object_len:11.5MB;key_5包括:Bucket:1,Object-id:A,Stripe-id:S1,EC-type:4+1,EC-seq:5,Offset:0MB,Object_len:11.5MB。
第二份:
{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn_5,key_5>},其中,key_1包括:Bucket:1,Object-id:A,Stripe-id:S2,EC-type:4+1,EC-seq:1,Offset:4MB,Object_len:11.5MB;key_2包括:Bucket:1,Object-id:A,Stripe-id:S2,EC-type:4+1,EC-seq:2,Offset:4MB,Object_len:11.5MB;key_3包括:Bucket:1,Object-id:A,Stripe-id:S2,EC-type:4+1,EC-seq:3,Offset:4MB,Object_len:11.5MB;key_4包括:Bucket:1,Object-id:A,Stripe-id:S2,EC-type:4+1,EC-seq:4,Offset:4MB,Object_len:11.5MB;key_5包括:Bucket:1,Object-id:A,Stripe-id:S2,EC-type:4+1,EC-seq:5,Offset:4MB,Object_len:11.5MB。
第三份:
{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn_5,key_5>},其中,key_1包括:Bucket:1,Object-id:A,Stripe-id:S3,EC-type:4+1,EC-seq:1,Offset:8MB,Object_len:11.5MB;key_2包括:Bucket:1,Object-id:A,Stripe-id:S3,EC-type:4+1,EC-seq:2,Offset:8MB,Object_len:11.5MB;key_3包括:Bucket:1,Object-id:A,Stripe-id:S3,EC-type:4+1,EC-seq:3,Offset:8MB,Object_len:11.5MB;key_4包括:Bucket:1,Object-id:A,Stripe-id:S3,EC-type:4+1,EC-seq:4,Offset:8MB,Object_len:11.5MB;key_5包括:Bucket:1,Object-id:A,Stripe-id:S3,EC-type:4+1,EC-seq:5,Offset:8MB,Object_len:11.5MB。
这三份条带数据即为Bucket1的元数据。
作为本申请的一种实施方式,元数据中除包含条带数据外,还可以包含目标数据信息。在上述例子中,将数据A分成了三份数据A1、A2和A3,每份 数据对应一份条带数据;这种情况下,可以针对数据A保存一份目标数据信息,目标数据信息表示一份完整的数据对应了哪几份条带数据。
在这种实施方式下,在基于所述待恢复元数据包含的每条索引信息中的存储空间标识、数据片段属性及条带标识,恢复得到至少一份条带数据之后,还可以将所述元数据中目标数据标识相同的条带数据组成一条目标数据信息。
可以理解,目标数据标识相同的条带数据对应同一份完整的数据,将目标数据标识相同的条带数据组成一条目标数据信息,后续读取该数据时,只需要查找到这一条目标数据信息,便可以获知组成该数据的各份条带数据,提高了读取效率。
应用本申请图2所示实施例,将一个存储空间划分为多个存储单元,该一个存储空间的元数据包含该多个存储单元的索引信息;对元数据进行恢复时,读取待恢复元数据指向的存储空间所包含的存储单元的索引信息,利用所读取的索引信息,恢复得到元数据,后续便可以利用元数据进行数据的读取。
在一种实施方式中,元数据包含多份条带数据,每份条带数据包含多个存储存储单元的索引信息。如果出现***异常、或者硬件损坏等情况,可能导致条带数据中的索引信息丢失。
本申请实施例还提供一种条带数据恢复方法,如图4所示,包括:
S401:确定不完整条带数据。
在图4所示实施例中,“不完整条带数据”即为丢失索引信息的条带数据。
作为一种实施方式,确定不完整条带数据时,可以先确定出丢失索引信息的目标条带数据;判断目标条带数据是否被写满:如果被写满,直接将该目标条带数据确定为不完整条带数据;如果未被写满,进一步判断目标条带数据中的丢失索引信息对应的存储单元是否为空存储单元,如果否,将所述目标条带数据确定为不完整条带数据。
本领域技术人员可以理解,如果一份条带数据对应的存储单元全部被写满,则表示该条带数据被写满,该条带数据即为满条带数据;相反,如果一份条带数据对应的存储单元没有全部被写满,则表示该条带数据未被写满,该条带数据即为未满条带数据,将未满条带数据中未写入数据的存储单元称为空存储单元。
如果目标条带数据为未满条带数据,而且该未满条带数据中丢失的索引 信息为空存储单元的索引信息,这种情况下,不存在数据丢失,用户可以正常读取数据,也就不需要执行本方案进行数据恢复,因此,也就不将该未满条带数据确定为不完整条带数据。
S402:基于该数据结构信息,确定该不完整条带数据指向的存储单元,作为目标存储单元。
数据结构信息中包含条带数据与其包含的每个Unit的对应关系,因此,可以基于该数据结构信息,确定该不完整条带数据指向的Unit,作为目标Unit。目标Unit与丢失key的Unit对应同一条带数据,也就是该不完整条带数据。
作为一种实施方式,在执行S402之前,可以先统计所述不完整条带数据中丢失的索引信息的数量;判断所述数量是否大于m,所述m为所述不完整条带数据对应的纠删码策略中的冗余片段份数;如果否,再执行S402;如果是,重构所述不完整条带数据对应的目标数据;利用预设的纠删码策略k+m,对所述目标数据进行存储;获得所述目标数据对应的新的条带数据。
一般来说,纠删码策略可以用n=k+m来表示,其中,k表示原始片段份数,m表示冗余片段份数,n表示总的数据片段份数。本领域技术人员可以理解,如果一份条带数据中丢失的索引信息的数量大于m,一般不能恢复出这些丢失的索引信息,这种情况下,可以利用条带数据中存在的其他信息进行数据重构。
假设数据A对应的纠删码策略为4+1,原条带数据为:
{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn_5,key_5>},其中key_2、key_3丢失,不完整条带数据为:
{<wwn_1,key_1>,<wwn_2,>,<wwn_3,>,<wwn_4,key_4>,<wwn_5,key_5>}。
丢失的索引信息的数量2大于m(1),这种情况下,利用该条带数据中存在的其他信息读取未丢失的数据片段,利用读取到的数据片段进行数据重构,得到目标数据,该目标数据即为重构出的数据A。然后可以利用纠删码策略4+1重新对数据A进行存储,与上述过程类似,又重新生成了数据A的新的条带数据。该新的条带数据可以由存储服务器生成,管理服务器从存储服务器中获得该新的条带数据,或者,该新的条带数据也可以由管理服务器生成。
另一种假设,数据A对应的纠删码策略为4+1,原条带数据为:{<stripe_id,wwn_1,key_1>,<stripe_id,wwn_2,key_2>,<stripe_id,wwn_3,key_3>,<stripe_id,wwn_4,key_4>,<stripe_id,wwn_5,key_5>},其中key_2丢失,不完整条 带数据为:
{<stripe_id,wwn_1,key_1>,<stripe_id,wwn_2,>,<stripe_id,wwn_3,key_3>,<s tripe_id,wwn_4,key_4>,<stripe_id,wwn_5,key_5>}。
丢失的索引信息的数量1不大于m(1),这种情况下,执行S402及后续步骤。
S403:读取该目标存储单元的索引信息,得到目标存储空间标识、目标条带标识、数据片段的目标属性。
如图3所示,索引信息(key)中可以包含存储空间标识(Bucket)、条带标识(Stripe-id)、数据片段的属性{所对应目标数据的标识(Object-id)、纠删码策略(EC-type)、条带内序号(EC-seq)、数据偏移量(Offset,条带在数据A中的偏移量)、目标数据的数据量大小(Object_len,条带数据对应的完整数据的数据量)},等等,具体不做限定。
为了方便描述,将S403中读取到的存储空间标识称为目标存储空间标识,将303中读取到的条带标识称为目标条带标识,将S403中读取到的数据片段的属性称为目标属性。
S404:将目标存储空间标识确定为丢失的索引信息中的存储空间标识。
可以理解,丢失的key与S403中读取的key属于同一条带数据,因此,丢失的key与S403中读取的key中存储空间标识相同,都为该目标存储空间标识。
S405:将目标条带标识确定为丢失的索引信息中的条带标识。
可以理解,丢失的key与S403中读取的key也属于同一条带数据,因此,丢失的key与S403中读取的key中条带标识相同,都为该目标条带标识。
S406:根据目标属性,确定丢失的索引信息中的数据片段属性。
作为一种实施方式,数据片段属性中包含:所对应纠删码策略、条带内序号、所对应目标数据的数据量、数据偏移量。
为了方便描述,将S403中读取到的纠删码策略称为目标纠删码策略,将S403中读取到的条带内序号称为目标序号,将S403中读取到的数据量称为目标数据量,将S402中读取到的数据偏移量称为目标数据偏移量。
S406可以包括:将所述目标纠删码策略确定为所述丢失的索引信息中的纠删码策略;
根据所述目标序号及预设排序规则,确定所述丢失的索引信息中的条带内序号;
将所述目标数据量确定为所述丢失的索引信息中的目标数据量;
根据所述目标数据偏移量及预设偏移规则,确定所述丢失的索引信息中的数据偏移量。
假设S403中读取到的目标纠删码策略为4+1,目标序号包括:1、3、4、5,目标数据量为4MB。
可以理解,(1)、同一份条带数据对应的纠删码策略相同,因此,可以直接将读取到的目标纠删码策略4+1作为丢失的索引信息中的纠删码策略。(2)、预设数据存储策略中的排序规则可以理解为1-5顺序排列,读取到1、3、4、5,可以确定丢失的索引信息对应的条带内序号为2。(3)、同一份条带数据对应的目标数据的数据量相同,因此,可以直接将读取到的目标数据量4MB作为丢失的索引信息中的数据量。(4)、预设数据存储策略中的偏移规则可以为:每份条带比上一份条带多偏移4MB,这个例子中,数据A只对应了一份条带,这一份条带的数据偏移量都为0MB。
S407:基于丢失的索引信息中的存储空间标识、条带标识及数据片段属性,对该不完整条带数据进行恢复。
延续上述例子,已经确定出丢失的索引信息中包含:纠删码策略4+1、条带内序号2、数据量4MB及数据偏移量0MB;将确定出的这些内容补充到该不完整条带数据中,便完成了对该不完整条带数据的恢复。
由此可见,应用本申请图4所示实施例,确定不完整条带数据,也就是丢失了索引信息的条带数据,利用该不完整条带数据中存在的索引信息,恢复得到丢失的索引信息;由此可见,如果出现***异常、或者硬件损坏等情况,导致条带数据中丢失了索引信息,应用本方案可以对丢失的索引信息进行恢复。
作为一种实施方式,在恢复得到丢失的索引信息后,可以重构该丢失的索引信息对应的存储数据。
在本实施方式中,可以确定所述丢失的索引信息对应的数据长度;根据所述数据长度、以及所述丢失的索引信息,重构所述丢失的索引信息对应的存储数据。
索引信息对应的数据长度,也就是其对应存储单元中存储数据的数据长度;确定所述丢失的索引信息对应的数据长度,可以包括:预先获取存储单 元容量,根据该存储单元容量及上述目标数据量,确定出每个丢失存储单元存储数据的数据长度,丢失存储单元即为上述丢失的索引信息对应的存储单元。
本领域技术人员可以理解,利用纠删码策略存储数据时,通常都是对数据进行平均切分,如果不能平均,则末位补0后再切分;因此,除尾部存储单元外,其他存储单元中的数据长度是相等的,都等于存储单元容量,而由于尾部存储单元中可能包含“0”数据,尾部存储单元的数据长度可能等于、可能小于该存储单元容量。
基于此,本实施例中,将条带数据对应的存储单元分为尾部存储单元和非尾部存储单元:对于非尾部存储单元来说,其对应的数据长度等于上述存储单元容量,对于尾部存储单元来说,其对应的数据长度可能等于、可能小于上述存储单元容量。
具体的,可以通过下式计算得到尾部存储单元对应的数据长度:Object_len-4*X*Y+X,其中,Object_len为上述目标数据量,X为存储单元容量,Y为存储的完整数据对应的条带数量。
本实施例中的尾部存储单元是指:在对数据进行切分时,最后可能补“0”的数据片段所在的存储单元。
确定出每个丢失存储单元存储数据的数据长度后,可以利用上述丢失的索引信息及所确定的数据长度,重构丢失存储单元中存储的数据,也就是该丢失的索引信息对应的存储数据。
可以理解,如果条带数据中丢失了索引信息,该丢失索引信息对应的数据也就无法读取。因此,在恢复得到丢失的索引信息后,重构该丢失的索引信息对应的存储数据。
假设数据B数据量为4MB,每个存储单元容量为1MB,数据B对应的原条带数据为:
{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn_5,key_5>},其中key_2丢失,丢失存储单元为unit2,不完整条带数据为:{<wwn_1,key_1>,<wwn_2,>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn_5,key_5>}。
应用图4所示实施例,恢复得到丢失的索引信息中包含:纠删码策略4+1、条带内序号2及数据量4MB。由条带内序号2可知,丢失存储单元为unit2,unit2为非尾部存储单元,unit2对应的数据长度为1MB(存储单元容量)。
读取该条带数据中除丢失存储单元之外的存储单元(unit1、unit3、unit4、unit5、)对应的索引信息,进而得到索引信息对应的数据;根据所读取到的数据、恢复得到的丢失的索引信息、以及确定出的unit2对应的数据长度(1MB),重构出unit2中的存储数据,也就是对该丢失索引信息对应的数据进行重构。
应用本实施方式,确定不完整条带数据,也就是丢失了索引信息的条带数据,利用该不完整条带数据中存在的索引信息,恢复得到丢失的索引信息,重构该丢失的索引信息对应的存储数据;由此可见,如果出现***异常、或者硬件损坏等情况,导致条带数据中丢失了索引信息,应用本方案先对丢失的索引信息进行恢复,再对索引信息对应的数据进行重构,实现了数据的恢复,这样,便可以读取到该条带数据对应的数据。
需要说明的是,在上述实施方式中,为了简化说明,数据B对应了一份条带,而如果数据B较大时,可以对应多份条带。例如,一份条带对应5个容量为1MB的存储单元,而待存储数据B为11.5MB(目标数据量),则可以将数据B分成三份数据B1(4MB)、B2(4MB)和B3(3.5MB),利用纠删码策略4+1,分别对这三份数据进行存储。以B1为例,将B1分割成4个原始片段(每个片段1MB),基于这4个原始片段进行扩展、编码,得到1个冗余片段;将这5个数据片段(4个原始片段和1个冗余片段)分别存储至上述5个容量为1MB的存储单元,这5个数据片段对应一份条带。
Object_len为11.5MB,X为1MB,Y为3,尾部存储单元对应的数据长度=11.5-4*1*3+1=0.5MB。可以理解,对B3进行存储时,将B3分割成4个原始片段,这4个原始片段数据长度大小分别为1MB、1MB、1MB和0.5MB,基于这4个原始片段进行扩展、编码,得到1个冗余片段,数据长度大小为1MB;将这5个数据片段(4个原始片段和1个冗余片段)分别存储至5个容量为1MB的存储单元,这5个数据片段对应一份条带数据。
在本申请实施例中,确定每个丢失存储单元对应的数据长度:若丢失存储单元为非尾部存储单元,该非尾部存储单元对应的数据长度为1MB(存储单元容量),若丢失存储单元为尾部存储单元,该尾部存储单元对应的数据长度为Object_len-4*X*Y+X=0.5MB。
假设B3对应的原条带数据为:
{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,key_4>,<wwn _5,key_5>},其中key_4丢失,丢失存储单元为unit4,B3对应的不完整条带数据为:{<wwn_1,key_1>,<wwn_2,key_2>,<wwn_3,key_3>,<wwn_4,>,<wwn_5,key_5>}。
应用图4所示实施例,恢复得到丢失的索引信息中包含:纠删码策略4+1、条带内序号4及数据量4MB。由条带内序号4可知,丢失存储单元为unit4,unit4为尾部存储单元,unit4对应的数据长度为Object_len-4*X*Y+X=0.5MB。
读取该条带数据中除丢失存储单元之外的存储单元(unit1、unit2、unit3、unit5、)的索引信息,进而得到索引信息对应的数据;根据所读取到的数据、恢复得到丢失的索引信息、以及确定出的unit4对应的数据长度(0.5MB),重构出unit4中的存储数据,也就是对该丢失索引信息对应的数据进行重构。
与上述方法实施例相对应,本申请实施例还提供一种数据恢复装置,如图5所示,包括:
第一确定模块501,用于确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;
第二确定模块502,用于基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;存储单元为存储数据片段的最小单元,多个存储单元构成一个存储空间,所述一个存储空间的元数据包含所述多个存储单元的索引信息;
第一读取模块503,用于读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;
第三确定模块504,用于将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;
第四确定模块505,用于根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据片段属性;
第一恢复模块506,用于基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据。
作为一种实施方式,所述数据结构信息中可以包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数 据中包含多个存储单元的索引信息;所读取的索引信息还包含所对应条带数据的第二标识;
所述装置还可以包括:
第五确定模块(图中未示出),用于根据所述第二标识、或者所述第二标识及预设条带标识规则,确定所述元数据包含的每条索引信息中的条带标识;
第一恢复模块506,具体可以用于:
基于所述待恢复元数据包含的每条索引信息中的存储空间标识、数据片段属性及条带标识,恢复得到至少一份条带数据。
作为一种实施方式,所述数据片段属性包含所对应目标数据的标识、所述目标数据的数据量、所对应纠删码策略、条带内序号、数据偏移量;所述第一属性中包含所对应目标数据的第三标识、所对应目标数据的第一数据量、第一纠删码策略、第一条带内序号、第一数据偏移量;
第四确定模块505,具体可以用于:
根据所述第三标识,确定所述元数据包含的每条索引信息中的目标数据标识;
根据所述第一数据量,确定所述元数据包含的每条索引信息中的目标数据的数据量;
将所述第一纠删码策略确定为所述元数据包含的每条索引信息中的纠删码策略;
根据所述第一条带内序号及预设数据存储策略中的排序规则,确定所述元数据包含的每条索引信息中的条带内序号;
根据所述第一数据偏移量及预设数据存储策略中的偏移规则,确定所述元数据包含的每条索引信息中的数据偏移量。
作为一种实施方式,所述元数据中还包含至少一份目标数据信息,所述装置还可以包括:
组合模块(图中未示出),用于将所述元数据中目标数据标识相同的条带数据组成一条目标数据信息。
作为一种实施方式,所述数据结构信息中可以包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数据中包含多个存储单元的索引信息;
所述装置还可以包括:第六确定模块、第七确定模块、第二读取模块、第八确定模块、第九确定模块、第十确定模块和第二恢复模块(图中未示出),其中,
第六确定模块,用于确定不完整条带数据,所述不完整条带数据为丢失索引信息的条带数据;
第七确定模块,用于基于所述数据结构信息,确定所述不完整条带数据指向的存储单元,作为目标存储单元;
第二读取模块,用于读取所述目标存储单元的索引信息,得到目标存储空间标识、目标条带标识、数据片段的目标属性;
第八确定模块,用于将所述目标存储空间标识确定为丢失的索引信息中的存储空间标识;
第九确定模块,用于将所述目标条带标识确定为所述丢失的索引信息中的条带标识;
第十确定模块,用于根据所述目标属性,确定所述丢失的索引信息中的数据片段属性;
第二恢复模块,用于基于所述丢失的索引信息中的存储空间标识、条带标识及数据片段属性,恢复得到所述不完整条带数据。
作为一种实施方式,所述数据片段属性包含所对应纠删码策略、条带内序号、所对应目标数据的数据量、数据偏移量;所述目标属性包含目标纠删码策略、目标序号、目标数据量、目标数据偏移量;
所述第十确定模块,具体可以用于:
将所述目标纠删码策略确定为所述丢失的索引信息中的纠删码策略;
根据所述目标序号及预设排序规则,确定所述丢失的索引信息中的条带内序号;
将所述目标数据量确定为所述丢失的索引信息中的数据量;
根据所述目标数据偏移量及预设偏移规则,确定所述丢失的索引信息中的数据偏移量。
作为一种实施方式,所述装置还可以包括:统计模块和判断模块(图中未示出),其中,
统计模块,用于统计所述不完整条带数据中丢失的索引信息的数量;
判断模块,用于判断所述数量是否大于m,所述m为所述不完整条带数据 对应的纠删码策略中的冗余片段份数;如果否,触发所述第七确定模块。
作为一种实施方式,所述装置还可以包括:第一重构模块、存储模块和获得模块(图中未示出),其中,
第一重构模块,用于在所述判断模块判断所述数量大于m的情况下,重构所述不完整条带数据对应的目标数据;
存储模块,用于利用预设的纠删码策略k+m,对所述目标数据进行存储;
获得模块,用于获得所述目标数据对应的新的条带数据。
作为一种实施方式,所述第六确定模块,具体可以用于:
确定丢失索引信息的目标条带数据;
判断所述目标条带数据是否被写满;
如果被写满,将所述目标条带数据确定为不完整条带数据;
如果未被写满,判断所述目标条带数据中的丢失索引信息对应的存储单元是否为空存储单元,如果否,将所述目标条带数据确定为不完整条带数据。
作为一种实施方式,所述装置还可以包括:
第二重构模块(图中未示出),用于确定所述丢失的索引信息对应的数据长度;根据所述数据长度、以及所述丢失的索引信息,重构所述丢失的索引信息对应的存储数据。
应用本申请图5所示实施例,将一个存储空间划分为多个存储单元,该一个存储空间的元数据包含该多个存储单元的索引信息;对元数据进行恢复时,读取待恢复元数据指向的存储空间所包含的存储单元的索引信息,利用所读取的索引信息,恢复得到元数据,后续便可以利用元数据进行数据的读取。
本申请实施例还提供一种管理服务器,如图6所示,包括处理器601、通信接口602、存储器603和通信总线604,其中,处理器601,通信接口602,存储器603通过通信总线604完成相互间的通信,
存储器603,用于存放计算机程序;
处理器601,用于执行存储器603上所存放的程序时,实现上述任一种数据恢复方法。
上述提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线 或一种类型的总线。
通信接口用于上述管理服务器与其他设备之间的通信。
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种数据恢复方法。
本申请实施例还提供一种可执行程序代码,所述可执行程序代码用于被运行以执行上述任一种数据恢复方法。
本申请实施例还提供一种分布式***,如图1所示,包括:存储服务器和管理服务器,其中,所述存储服务器中包含至少一个存储空间,每个存储空间包含多个存储单元,存储单元为存储数据片段的最小单元;
所述存储服务器,用于存储所述存储服务器中的每个存储单元的索引信息;
所述管理服务器,用于确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;一个存储空间的元数据包含所述一个存储空间中多个存储单元的索引信息;读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据片段属性;基于所述待恢复元数据包含的每条索引信息中的存储空间标识及 数据片段属性,恢复得到所述待恢复元数据。
作为一种实施方式,所述数据结构信息中包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数据中包含多个存储单元的索引信息;
所述管理服务器,还可以用于:
确定不完整条带数据,所述不完整条带数据为丢失索引信息的条带数据;
基于所述数据结构信息,确定所述不完整条带数据指向的存储单元,作为目标存储单元;
读取所述目标存储单元的索引信息,得到目标存储空间标识、目标条带标识、数据片段的目标属性;
将所述目标存储空间标识确定为丢失的索引信息中的存储空间标识;
将所述目标条带标识确定为所述丢失的索引信息中的条带标识;
根据所述目标属性,确定所述丢失的索引信息中的数据片段属性;
基于所述丢失的索引信息中的存储空间标识、条带标识及数据片段属性,恢复得到所述不完整条带数据。
该分布式***中的管理服务器还可以用于执行上述任一种数据恢复方法。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于图1所示的分布式***实施例、图5所示的数据恢复装置实施例、图6所示的管理服务器实施例、上述计算机可读存储介质实施例、以及上述可执行程序代码实施例而言,由于其基本相似于图2-4所示的数据恢复方法实施例,所以描述的比较简单,相关之处参见图2-4所示的数据恢复方 法实施例的部分说明即可。
本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中,这里所称得的存储介质,如:ROM/RAM、磁碟、光盘等。
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。
Claims (25)
- 一种数据恢复方法,其特征在于,应用于分布式***中的管理服务器,所述方法包括:确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;存储单元为存储数据片段的最小单元,多个存储单元构成一个存储空间,所述一个存储空间的元数据包含所述多个存储单元的索引信息;读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据片段属性;基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据。
- 根据权利要求1所述的方法,其特征在于,所述数据结构信息中包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数据中包含多个存储单元的索引信息;所读取的索引信息还包含所对应条带数据的第二标识;在所述基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据之前,还包括:根据所述第二标识、或者所述第二标识及预设条带标识规则,确定所述元数据包含的每条索引信息中的条带标识;所述基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据,包括:基于所述待恢复元数据包含的每条索引信息中的存储空间标识、数据片段属性及条带标识,恢复得到至少一份条带数据。
- 根据权利要求2所述的方法,其特征在于,所述数据片段属性包含所对应目标数据的标识、所述目标数据的数据量、所对应纠删码策略、条带内序号、数据偏移量;所述第一属性中包含所对应目标数据的第三标识、所对应目标数据的第一数据量、第一纠删码策略、第一条带内序号、第一数据偏移量;所述根据所述第一属性、以及预设数据存储策略,确定所述元数据包含的每条索引信息中的数据片段属性,包括:根据所述第三标识,确定所述元数据包含的每条索引信息中的目标数据标识;根据所述第一数据量,确定所述元数据包含的每条索引信息中的目标数据的数据量;将所述第一纠删码策略确定为所述元数据包含的每条索引信息中的纠删码策略;根据所述第一条带内序号及预设数据存储策略中的排序规则,确定所述元数据包含的每条索引信息中的条带内序号;根据所述第一数据偏移量及预设数据存储策略中的偏移规则,确定所述元数据包含的每条索引信息中的数据偏移量。
- 根据权利要求3所述的方法,其特征在于,所述元数据中还包含至少一份目标数据信息,在所述基于所述待恢复元数据包含的每条索引信息中的存储空间标识、数据片段属性及条带标识,恢复得到至少一份条带数据之后,还包括:将所述元数据中目标数据标识相同的条带数据组成一条目标数据信息。
- 根据权利要求1所述的方法,其特征在于,所述数据结构信息中包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数据中包含多个存储单元的索引信息;所述方法还包括:确定不完整条带数据,所述不完整条带数据为丢失索引信息的条带数据;基于所述数据结构信息,确定所述不完整条带数据指向的存储单元,作为目标存储单元;读取所述目标存储单元的索引信息,得到目标存储空间标识、目标条带 标识、数据片段的目标属性;将所述目标存储空间标识确定为丢失的索引信息中的存储空间标识;将所述目标条带标识确定为所述丢失的索引信息中的条带标识;根据所述目标属性,确定所述丢失的索引信息中的数据片段属性;基于所述丢失的索引信息中的存储空间标识、条带标识及数据片段属性,对所述不完整条带数据进行恢复。
- 根据权利要求5所述的方法,其特征在于,所述数据片段属性包含所对应纠删码策略、条带内序号、所对应目标数据的数据量、数据偏移量;所述目标属性包含目标纠删码策略、目标序号、目标数据量、目标数据偏移量;所述根据所述目标属性,确定所述丢失的索引信息中的数据片段属性,包括:将所述目标纠删码策略确定为所述丢失的索引信息中的纠删码策略;根据所述目标序号及预设排序规则,确定所述丢失的索引信息中的条带内序号;将所述目标数据量确定为所述丢失的索引信息中的数据量;根据所述目标数据偏移量及预设偏移规则,确定所述丢失的索引信息中的数据偏移量。
- 根据权利要求5所述的方法,其特征在于,在确定不完整条带数据之后,所述方法还包括:统计所述不完整条带数据中丢失的索引信息的数量;判断所述数量是否大于m,所述m为所述不完整条带数据对应的纠删码策略中的冗余片段份数;如果否,执行所述基于所述数据结构信息,确定所述不完整条带数据指向的存储单元,作为目标存储单元的步骤。
- 根据权利要求7所述的方法,其特征在于,在判断所述数量大于m的情况下,所述方法还包括:重构所述不完整条带数据对应的目标数据;利用预设的纠删码策略k+m,对所述目标数据进行存储;获得所述目标数据对应的新的条带数据。
- 根据权利要求5所述的方法,其特征在于,所述确定不完整条带数据,包括:确定丢失索引信息的目标条带数据;判断所述目标条带数据是否被写满;如果被写满,将所述目标条带数据确定为不完整条带数据;如果未被写满,判断所述目标条带数据中的丢失索引信息对应的存储单元是否为空存储单元,如果否,将所述目标条带数据确定为不完整条带数据。
- 根据权利要求6所述的方法,其特征在于,在所述基于所述丢失的索引信息中的存储空间标识、条带标识及数据片段属性,恢复得到所述不完整条带数据之后,还包括:确定所述丢失的索引信息对应的数据长度;根据所述数据长度、以及所述丢失的索引信息,重构所述丢失的索引信息对应的存储数据。
- 一种数据恢复装置,其特征在于,应用于分布式***中的管理服务器,所述装置包括:第一确定模块,用于确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;第二确定模块,用于基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;存储单元为存储数据片段的最小单元,多个存储单元构成一个存储空间,所述一个存储空间的元数据包含所述多个存储单元的索引信息;第一读取模块,用于读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;第三确定模块,用于将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;第四确定模块,用于根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据片段属性;第一恢复模块,用于基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据。
- 根据权利要求11所述的装置,其特征在于,所述数据结构信息中包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据 与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数据中包含多个存储单元的索引信息;所读取的索引信息还包含所对应条带数据的第二标识;所述装置还包括:第五确定模块,用于根据所述第二标识、或者所述第二标识及预设条带标识规则,确定所述元数据包含的每条索引信息中的条带标识;所述第一恢复模块,具体用于:基于所述待恢复元数据包含的每条索引信息中的存储空间标识、数据片段属性及条带标识,恢复得到至少一份条带数据。
- 根据权利要求12所述的装置,其特征在于,所述数据片段属性包含所对应目标数据的标识、所述目标数据的数据量、所对应纠删码策略、条带内序号、数据偏移量;所述第一属性中包含所对应目标数据的第三标识、所对应目标数据的第一数据量、第一纠删码策略、第一条带内序号、第一数据偏移量;所述第四确定模块,具体用于:根据所述第三标识,确定所述元数据包含的每条索引信息中的目标数据标识;根据所述第一数据量,确定所述元数据包含的每条索引信息中的目标数据的数据量;将所述第一纠删码策略确定为所述元数据包含的每条索引信息中的纠删码策略;根据所述第一条带内序号及预设数据存储策略中的排序规则,确定所述元数据包含的每条索引信息中的条带内序号;根据所述第一数据偏移量及预设数据存储策略中的偏移规则,确定所述元数据包含的每条索引信息中的数据偏移量。
- 根据权利要求13所述的装置,其特征在于,所述元数据中还包含至少一份目标数据信息,所述装置还包括:组合模块,用于将所述元数据中目标数据标识相同的条带数据组成一条目标数据信息。
- 根据权利要求11所述的装置,其特征在于,所述数据结构信息中包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据 与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数据中包含多个存储单元的索引信息;所述装置还包括:第六确定模块,用于确定不完整条带数据,所述不完整条带数据为丢失索引信息的条带数据;第七确定模块,用于基于所述数据结构信息,确定所述不完整条带数据指向的存储单元,作为目标存储单元;第二读取模块,用于读取所述目标存储单元的索引信息,得到目标存储空间标识、目标条带标识、数据片段的目标属性;第八确定模块,用于将所述目标存储空间标识确定为丢失的索引信息中的存储空间标识;第九确定模块,用于将所述目标条带标识确定为所述丢失的索引信息中的条带标识;第十确定模块,用于根据所述目标属性,确定所述丢失的索引信息中的数据片段属性;第二恢复模块,用于基于所述丢失的索引信息中的存储空间标识、条带标识及数据片段属性,恢复得到所述不完整条带数据。
- 根据权利要求15所述的装置,其特征在于,所述数据片段属性包含所对应纠删码策略、条带内序号、所对应目标数据的数据量、数据偏移量;所述目标属性包含目标纠删码策略、目标序号、目标数据量、目标数据偏移量;所述第十确定模块,具体用于:将所述目标纠删码策略确定为所述丢失的索引信息中的纠删码策略;根据所述目标序号及预设排序规则,确定所述丢失的索引信息中的条带内序号;将所述目标数据量确定为所述丢失的索引信息中的数据量;根据所述目标数据偏移量及预设偏移规则,确定所述丢失的索引信息中的数据偏移量。
- 根据权利要求15所述的装置,其特征在于,所述装置还包括:统计模块,用于统计所述不完整条带数据中丢失的索引信息的数量;判断模块,用于判断所述数量是否大于m,所述m为所述不完整条带数据 对应的纠删码策略中的冗余片段份数;如果否,触发所述第七确定模块。
- 根据权利要求17所述的装置,其特征在于,所述装置还包括:第一重构模块,用于在所述判断模块判断所述数量大于m的情况下,重构所述不完整条带数据对应的目标数据;存储模块,用于利用预设的纠删码策略k+m,对所述目标数据进行存储;获得模块,用于获得所述目标数据对应的新的条带数据。
- 根据权利要求15所述的装置,其特征在于,所述第六确定模块,具体用于:确定丢失索引信息的目标条带数据;判断所述目标条带数据是否被写满;如果被写满,将所述目标条带数据确定为不完整条带数据;如果未被写满,判断所述目标条带数据中的丢失索引信息对应的存储单元是否为空存储单元,如果否,将所述目标条带数据确定为不完整条带数据。
- 根据权利要求16所述的装置,其特征在于,所述装置还包括:第二重构模块,用于确定所述丢失的索引信息对应的数据长度;根据所述数据长度、以及所述丢失的索引信息,重构所述丢失的索引信息对应的存储数据。
- 一种分布式***,其特征在于,包括:存储服务器和管理服务器,其中,所述存储服务器中包含至少一个存储空间,每个存储空间包含多个存储单元,存储单元为存储数据片段的最小单元;所述存储服务器,用于存储所述存储服务器中的每个存储单元的索引信息;所述管理服务器,用于确定待恢复元数据指向的存储空间,所述存储空间位于所述分布式***的存储服务器中;基于预先获取的数据结构信息,确定所述存储空间包含的存储单元;其中,所述数据结构信息中包括:存储空间与其包含的每个存储单元的对应关系;一个存储空间的元数据包含所述一个存储空间中多个存储单元的索引信息;读取所确定的存储单元的索引信息;其中,所读取的索引信息中包含所对应存储单元所在的存储空间的第一标识、所对应存储单元存储的数据片段的第一属性;将所述第一标识确定为所述待恢复元数据包含的每条索引信息中的存储空间标识;根据所述第一属性、以及预设数据存储策略,确定所述待恢复元数据包含的每条索引信息中的数据 片段属性;基于所述待恢复元数据包含的每条索引信息中的存储空间标识及数据片段属性,恢复得到所述待恢复元数据。
- 根据权利要求21所述的***,其特征在于,所述数据结构信息中包括:存储空间与其包含的每份条带数据的对应关系、以及所述每份条带数据与其包含的每个存储单元的对应关系;一个存储空间的元数据包含至少一份条带数据,每份条带数据中包含多个存储单元的索引信息;所述管理服务器,还用于:确定不完整条带数据,所述不完整条带数据为丢失索引信息的条带数据;基于所述数据结构信息,确定所述不完整条带数据指向的存储单元,作为目标存储单元;读取所述目标存储单元的索引信息,得到目标存储空间标识、目标条带标识、数据片段的目标属性;将所述目标存储空间标识确定为丢失的索引信息中的存储空间标识;将所述目标条带标识确定为所述丢失的索引信息中的条带标识;根据所述目标属性,确定所述丢失的索引信息中的数据片段属性;基于所述丢失的索引信息中的存储空间标识、条带标识及数据片段属性,恢复得到所述不完整条带数据。
- 一种管理服务器,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;存储器,用于存放计算机程序;处理器,用于执行存储器上所存放的程序时,实现权利要求1-10任一所述的方法步骤。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-10任一所述的方法步骤。
- 一种可执行程序代码,其特征在于,所述可执行程序代码用于被运行以执行权利要求1-10任一所述的方法步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710742705.4 | 2017-08-25 | ||
CN201710742705.4A CN109426587B (zh) | 2017-08-25 | 2017-08-25 | 一种数据恢复方法及装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019037587A1 true WO2019037587A1 (zh) | 2019-02-28 |
Family
ID=65439340
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/098648 WO2019037587A1 (zh) | 2017-08-25 | 2018-08-03 | 一种数据恢复方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109426587B (zh) |
WO (1) | WO2019037587A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111400248B (zh) * | 2019-11-19 | 2023-06-30 | 杭州海康威视***技术有限公司 | 写数据、恢复数据的方法及文件*** |
CN111611258B (zh) * | 2020-05-27 | 2023-09-19 | 杭州海康威视***技术有限公司 | 流数据的恢复方法和存储设备 |
CN112019788B (zh) * | 2020-08-27 | 2023-04-11 | 杭州海康威视***技术有限公司 | 数据存储方法、装置、***及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6480849B1 (en) * | 1998-10-27 | 2002-11-12 | Electronics And Telecommunications Research Institute | Efficient concurrency control method for high dimensional index structures |
CN101937377A (zh) * | 2009-06-29 | 2011-01-05 | 百度在线网络技术(北京)有限公司 | 数据恢复方法和装置 |
CN102024016A (zh) * | 2010-11-04 | 2011-04-20 | 天津曙光计算机产业有限公司 | 一种分布式文件***快速数据恢复的方法 |
CN105830041A (zh) * | 2014-11-27 | 2016-08-03 | 华为技术有限公司 | 元数据的恢复方法及装置 |
Family Cites Families (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2003291014A1 (en) * | 2002-11-14 | 2004-06-15 | Isilon Systems, Inc. | Systems and methods for restriping files in a distributed file system |
US7296180B1 (en) * | 2004-06-30 | 2007-11-13 | Sun Microsystems, Inc. | Method for recovery of data |
US10282440B2 (en) * | 2015-03-31 | 2019-05-07 | International Business Machines Corporation | Prioritizing rebuilding of encoded data slices |
CN103019626B (zh) * | 2012-12-17 | 2016-04-13 | 华为技术有限公司 | 存储***、控制集群元数据的方法及装置 |
CN103106124B (zh) * | 2012-12-29 | 2015-06-17 | 华中科技大学 | 一种基于纠删码集群存储***的交叉重构方法 |
US9720787B2 (en) * | 2013-01-11 | 2017-08-01 | Commvault Systems, Inc. | Table level database restore in a data storage system |
EP2953026B1 (en) * | 2013-10-18 | 2016-12-14 | Hitachi, Ltd. | Target-driven independent data integrity and redundancy recovery in a shared-nothing distributed storage system |
CN103699585B (zh) * | 2013-12-06 | 2017-04-19 | 华为技术有限公司 | 文件的元数据存储以及文件恢复的方法、装置和*** |
CN104202387B (zh) * | 2014-08-27 | 2017-11-24 | 华为技术有限公司 | 一种元数据恢复方法及相关装置 |
CN104156283B (zh) * | 2014-08-27 | 2017-08-25 | 华为技术有限公司 | 数据恢复方法、装置及存储*** |
CN106294193B (zh) * | 2015-06-03 | 2019-10-15 | 杭州海康威视***技术有限公司 | 存储设备及基于该存储设备的分块存储方法 |
CN104994168B (zh) * | 2015-07-14 | 2018-05-01 | 苏州科达科技股份有限公司 | 分布式存储方法及分布式存储*** |
US20170060700A1 (en) * | 2015-08-28 | 2017-03-02 | Qualcomm Incorporated | Systems and methods for verification of code resiliency for data storage |
CN106662983B (zh) * | 2015-12-31 | 2019-04-12 | 华为技术有限公司 | 分布式存储***中的数据重建的方法、装置和*** |
JP6671708B2 (ja) * | 2016-02-09 | 2020-03-25 | 株式会社日立製作所 | バックアップリストアシステム及びバックアップリストア方法 |
-
2017
- 2017-08-25 CN CN201710742705.4A patent/CN109426587B/zh active Active
-
2018
- 2018-08-03 WO PCT/CN2018/098648 patent/WO2019037587A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6480849B1 (en) * | 1998-10-27 | 2002-11-12 | Electronics And Telecommunications Research Institute | Efficient concurrency control method for high dimensional index structures |
CN101937377A (zh) * | 2009-06-29 | 2011-01-05 | 百度在线网络技术(北京)有限公司 | 数据恢复方法和装置 |
CN102024016A (zh) * | 2010-11-04 | 2011-04-20 | 天津曙光计算机产业有限公司 | 一种分布式文件***快速数据恢复的方法 |
CN105830041A (zh) * | 2014-11-27 | 2016-08-03 | 华为技术有限公司 | 元数据的恢复方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN109426587B (zh) | 2020-08-28 |
CN109426587A (zh) | 2019-03-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101813786B1 (ko) | Ssd 상의 기록-시-복사를 위한 시스템 및 방법 | |
US10127166B2 (en) | Data storage controller with multiple pipelines | |
US10649897B2 (en) | Access request processing method and apparatus, and computer device | |
US10936228B2 (en) | Providing data deduplication in a data storage system with parallelized computation of crypto-digests for blocks of host I/O data | |
US10303374B2 (en) | Data check method and storage system | |
WO2016086819A1 (zh) | 将数据写入叠瓦状磁记录smr硬盘的方法及装置 | |
EP3316150B1 (en) | Method and apparatus for file compaction in key-value storage system | |
CN108170555A (zh) | 一种数据恢复方法及设备 | |
EP3404527B1 (en) | Data updating technique | |
CN109522154B (zh) | 数据恢复方法及相关设备与*** | |
US10572335B2 (en) | Metadata recovery method and apparatus | |
WO2019037587A1 (zh) | 一种数据恢复方法及装置 | |
US20170083244A1 (en) | Mitigating the impact of a single point of failure in an object store | |
CN111459399A (zh) | 一种数据写入方法、数据读取方法及装置 | |
CN109407985B (zh) | 一种数据管理的方法以及相关装置 | |
CN109144766B (zh) | 一种数据存储、重构方法和装置、及电子设备 | |
CN107704208B (zh) | 一种元数据的修复方法、装置及介质 | |
US9286936B1 (en) | Zone based band mapping | |
CN112394873B (zh) | 一种数据管理方法、***及电子设备和存储介质 | |
CN111444114B (zh) | 一种非易失性内存中数据的处理方法、装置及*** | |
CN111026720A (zh) | 一种文件处理方法、***及相关设备 | |
CN105573862A (zh) | 一种恢复文件***的方法和设备 | |
US20240176489A1 (en) | Priority based raid (redundant array of independent disks) rebuild for a data storage system | |
CN113568584B (zh) | 重删数据保护方法及装置 | |
CN117539690B (zh) | 多磁盘数据的合并恢复方法、装置、设备、介质和产品 |
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: 18848383 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: 18848383 Country of ref document: EP Kind code of ref document: A1 |