A method and device for optimizing erasure code data recovery based on environmental information
By using environmental information to establish acting_map in erasure coding technology, and judging and processing all-zero fragments, the problem of wasted storage space and bandwidth during the data recovery process in erasure coding technology is solved, and the performance of the storage system is improved.
Patent Information
- Application Number
- CN202110712439.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-25
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-06-25
AI Technical Summary
Existing erasure coding technology causes waste of storage space and bandwidth due to the writing of all zero fragments during the data recovery process. An optimization method based on environmental information is needed to solve this problem.
By reading the fragment number attribute and environment information of the object to be restored, an acting_map is established to determine whether the data block to be restored is an all-zero fragment. If so, create an empty file and modify its attributes to replace the writing of zeros. Otherwise, use erasure coding algorithm for data recovery.
It saves the storage space and write bandwidth of the storage system, improves the overall performance, and avoids the waste of storage space in the write phase of all-zero shards.
Smart Images

Figure CN113553215B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage system data recovery, and in particular to an environmental information-based erasure code data recovery optimization method and device. Background Art
[0002] With the rapid development of information technology, the role of data as a carrier of information has become increasingly prominent. Collecting, organizing, refining and summarizing data in social life and production can obtain important information from a large amount of data and create huge economic benefits. With the explosive growth of data, server performance has become a bottleneck that constrains data processing capabilities. Distributed storage uses a decentralized storage method to effectively solve the constraints of server performance on data processing capabilities. Therefore, distributed storage is more widely used in the field of data processing.
[0003] For distributed storage systems, since data is stored in a dispersed manner, there is a problem of data inconsistency caused by a failure of a storage node causing a part of the data to go wrong. Therefore, the emergence of scattered coding technology effectively increases the data redundancy capability of distributed storage systems. The basic unit of data operation of erasure coding technology is an erasure stripe, which includes K copies of original data and M copies of verification data. The M copies of verification data are obtained by performing matrix multiplication calculations on the K copies of original data and the encoding matrix. When saving data, K+M copies of data are saved in different storage locations (different storage nodes or different OSDs on the same storage node). When reading data, it is only necessary to select K copies of normal data from the total number of K+M copies of data, and then the missing data can be restored through the erasure algorithm.
[0004] However, for the existing erasure coding technology, since the basic unit of data operation of the erasure coding technology is the erasure stripe, and the original data and verification data in the erasure stripe are set according to K+M, when encoding the data, it is necessary to fill the insufficient part with zero, and a piece of data is represented by a shard. The supplemented original data may contain all-zero data of one or several shards, which causes a waste of storage space. In the process of data writing, the all-zero shard is marked through the touch operation of the storage layer, and the all-zero shard information is recorded in the database. Compared with the write operation, it occupies the same size of database space, but reduces the loss of disk space; however, when the storage system fails, when performing data recovery, the recovery process will fill the all-zero shard with zero and write it into the storage space, which will cause the storage space saved in the writing stage to be wasted. Therefore, it is necessary to provide an erasure coding data recovery optimization method based on environmental information that can solve the problem of storage space waste and storage system bandwidth waste caused by writing zeros when restoring data. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, in a first aspect, the present application provides an erasure code data recovery optimization method based on environmental information, comprising:
[0006] Read the number of shards of the object to be restored from the recovery information.
[0007] Obtain the number of erasure correction units in the data stripe and the check stripe from the environment information of the storage system where the object is located;
[0008] Create an acting_map of objects encoded by erasure coding based on the number of shards, the number of erasure units in the data stripe, and the number of erasure units in the check stripe;
[0009] Calculate the position parameter cur_shard of the data block to be restored in the acting_map of the object to be restored;
[0010] Determine whether the current data block to be restored is an all-zero shard according to the position parameter cur_shard;
[0011] If yes, when recovering data from the all-zero shard, an empty file is created through the touch operation, and the attributes of the empty file are determined according to the information of the all-zero shard, so that the storage system can identify the attributes of the empty file and obtain the information of the all-zero shard it represents;
[0012] Otherwise, data recovery is performed using the erasure coding algorithm, and the recovered data is written to the storage space.
[0013] Furthermore, reading the shard number attribute of the object to be restored from the restoration information includes: in the object creation and change phase, calculating the shard number of the object and saving the shard number as a kind of object attribute in the database;
[0014] An object to be restored is determined from the restoration information, and the attribute of the number of shards is read from the database according to the object to be restored.
[0015] Furthermore, calculating the number of shards of an object includes dividing the object size by the capacity of an erasure unit to determine whether it is divisible. If it is divisible, the obtained value is used as the number of shards of the object; if it is not divisible, the obtained value is added by one, and the value after the addition is used as the number of shards of the object; the capacity of the erasure unit is obtained from environmental information.
[0016] Furthermore, the capacity of the erasure unit is obtained from the environment information.
[0017] Furthermore, the acting_map records the distribution of data shards and check shards after the object is encoded with the erasure code, and records the OSDs where the data shards and check shards are located.
[0018] Furthermore, the distribution of all-zero shards of all-zero shards in the acting_map is determined according to the number of shards of the object and the number of erasure correction units in the data stripe, and whether the data block to be recovered is an all-zero shard is determined according to the location parameter cur_shard of the data block to be recovered.
[0019] Furthermore, the information of the all-zero slices includes OSD information corresponding to the all-zero slices and size information of the all-zero slices. The index attribute of the empty file is configured according to the OSD information corresponding to the all-zero slices, and the size attribute of the empty file is configured according to the size information of the all-zero slices.
[0020] In a second aspect, the present application provides a management method for an empty file representing an all-zero slice, which is used to manage an empty file representing an all-zero slice, including: detecting whether an object is deleted, and when the object is deleted, querying an empty file index according to the deleted object, and deleting the empty file after indexing the empty file corresponding to the object;
[0021] Traverse the storage system object information, traverse the storage system empty file information representing all-zero slices, and delete the empty files representing all-zero slices that do not correspond to the object;
[0022] Detect object change information. When an object is changed, compare the two acting_maps before and after the object change to determine whether an all-zero slice is added or deleted. If a new all-zero slice is added, build a corresponding empty file. If an all-zero slice is deleted, delete the corresponding empty file.
[0023] In a third aspect, the present application also provides an erasure code data recovery optimization device based on environmental information, comprising:
[0024] An environment information collection module, the environment information collection module is used to collect erasure code technology information applied by the storage system;
[0025] An object attribute configuration module, wherein the object attribute configuration module calculates a shard quantity attribute of the object according to the collected erasure code technology information;
[0026] An acting_map construction module, wherein the acting_map construction module is used to construct an acting_map according to the erasure code technology information and the shard number attribute of the object;
[0027] A storage module, the storage module is used to store an acting_map formed according to erasure code technical information and object attributes;
[0028] A judgment module, the judgment module is used to judge whether the data block to be recovered is an all-zero shard according to the position parameter cur_shard of the data block to be recovered,
[0029] A recovery optimization module, when the recovery optimization module recovers the all-zero shard, creates an empty file and modifies the empty file attribute according to the information of the all-zero shard, and the recovery optimization module recovers the non-all-zero shard normally according to the erasure code recovery process.
[0030] Furthermore, the environmental information-based erasure code data recovery optimization device provided in the present application also includes an empty file identification module, which identifies the attributes of the empty file to obtain information about all-zero fragments.
[0031] Furthermore, the recovery optimization module includes an empty file creation unit and an empty file attribute modification unit.
[0032] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0033] The present application can obtain the number of erasure units in the data stripe and the number of erasure units in the check stripe of the erasure code encoding technology adopted by the storage system, and the capacity information of the erasure unit, and calculate the attribute of the number of shards of the object according to the capacity of the erasure unit and the size of the object; the object's acting_map is established based on the attribute of the number of shards and the number of erasure units in the data stripe and the number of erasure units in the check stripe in the erasure stripe; when performing data recovery, whether the data block to be recovered is an all-zero shard is determined according to the acting_map and the cur_shard of the data block to be recovered; if it is an all-zero shard, an empty file with corresponding attributes is established to replace the writing of data zeros during recovery, thereby saving the storage space of the storage system, reducing the write bandwidth occupied by the writing of zero data in the all-zero shards during conventional repair processes, and improving the overall performance of the storage system.
[0034] In summary, on the one hand, the present application can determine the distribution of all-zero shards generated during erasure coding according to environmental information and the attribute of the number of object shards, and judge whether the data to be recovered is an all-zero shard according to the distribution of the cur-shard and all-zero shards of the data block to be recovered; on the other hand, when performing data repair, the present application uses empty files instead of all-zero shards to save storage space, reduce write bandwidth during data recovery, and improve the overall performance of the storage system. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flowchart of an erasure code data recovery optimization method based on environmental information provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of a process of forming an acting_map for an object smaller than a data stripe provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of a process of forming an acting_map for an object larger than one data stripe provided in an embodiment of the present application;
[0040] Figure 4 A flowchart of calculating the number of object shards attributes provided in an embodiment of the present application;
[0041] Figure 5 A flowchart of creating an empty file and configuring empty file attributes provided in an embodiment of the present application;
[0042] Figure 6 A flowchart of deleting corresponding empty files according to the deletion of an object provided in an embodiment of the present application;
[0043] Figure 7 A flowchart of deleting the empty files representing all-zero slices existing for the corresponding objects by comparing all objects and all empty files in the storage system provided by this embodiment;
[0044] Figure 8 A flowchart of changing an empty file representing an all-zero slice according to a change of an object provided for this embodiment. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0046] The relevant concepts involved in this article are explained as follows: An erasure stripe is the basic unit of one-time reading or writing of error correction coding storage. An erasure stripe often contains K original data blocks and M check data blocks. In this application, the set of original data blocks in an erasure stripe is called a data stripe, and the set of check data blocks is called a check stripe. An erasure unit is the basic shard that constitutes an erasure stripe. OSD (Object Storage Device) object storage device. When the original data of an all-zero shard object is not enough to fill the data stripe of an erasure stripe, the remaining erasure units are supplemented with zeros to form a complete data stripe, resulting in an erasure unit filled with all zeros.
[0047] Erasure coding technology is a technology used in storage systems to achieve data storage redundancy in storage systems and ensure the reliability of storage systems. Objects are divided and allocated to data stripes containing K data slices in the erasure stripe. When the length of the object is not enough to fill a data stripe, the complete data stripe is obtained by padding with zeros. The K data slices are multiplied by the generation matrix to obtain M check slices, and the K data slices and the M check slices are stored in different locations. Only K pieces of data need to be obtained from the K data slices and the M check slices, and the erasure coding algorithm can restore all objects. Therefore, erasure coding technology can achieve storage redundancy in storage systems.
[0048] Example 1
[0049] See also Figure 1 As shown, the present application provides an erasure code data recovery optimization method based on environmental information, comprising:
[0050] S1, read the attribute of the number of shards of the object to be restored from the restoration information. In the specific implementation process, during the object creation and change phase (change phase: perform any operation that changes the size of the object), calculate the number of shards of the object and save the number of shards as an object attribute in the database; in particular, when the object is deleted, delete the object and the corresponding object attribute in the database; determine the object to be restored from the restoration information, and read the attribute of the number of shards from the database according to the object to be restored. Figure 4 As shown, calculating the number of shards of an object includes dividing the object size by the capacity of the erasure unit (obtaining the capacity of the erasure unit from the environmental information), and determining whether it is divisible. If it is divisible, the obtained value is used as the number of shards of the object. If it is not divisible, the obtained value is added by one, and the value after the addition is used as the number of shards of the object.
[0051] Obtaining the capacity of the erasure unit from the environmental information includes: if the environmental information contains the capacity of the erasure unit, directly obtaining the capacity of the erasure unit from the environmental information; if the environmental information does not contain the capacity of the erasure unit but contains the data capacity of the erasure stripe and the total number of erasure units contained in the erasure stripe, obtaining the data capacity of the erasure stripe and the total number of erasure units contained in the erasure stripe, and dividing the data capacity of the erasure stripe by the total number of erasure units to obtain the capacity of the erasure unit.
[0052] S2, obtain the number of erasure units in the data stripe and the number of erasure units in the check stripe from the environmental information of the storage system where the object is located. In the specific implementation process, different storage systems may adopt different erasure code schemes. Different erasure code schemes may have different numbers of erasure units in the data stripe and the check stripe, and the capacity of the erasure units may also be different. This leads to different all-zero shards generated by encoding the same object when the erasure code schemes are different. In order to adapt to storage systems that adopt different erasure code schemes, this application collects erasure code related information from the environmental information of the storage system.
[0053] S3, establishes an acting_map of the object encoded by erasure coding according to the attribute of the number of object shards and the erasure code related information obtained in the processes of S1 and S2. The acting_map records the ordered distribution of the data shards and the check shards after the object is encoded by the erasure code, and records the stored OSDs of the data shards and the check shards. In the specific implementation process, after the acting_map is established, the distribution of the object's all-zero shards in the acting_map can be determined according to the remainder obtained in the process by dividing the number of object shards by the number of erasure units in the data stripe.
[0054] For details, see Figure 2 As shown in the figure, in the following situation: the object's shard count attribute is 4, the erasure coding technology K (data stripe erasure unit quantity) of the storage system is 5, and the erasure coding technology M (parity stripe erasure unit quantity) is 3. When erasure coding is performed, the 4 shards of the object are filled into an erasure stripe in order, and the fourth and fifth erasure units of the data stripe need to be padded with zeros. Therefore, the fifth erasure unit is an all-zero shard. After the data stripe is insufficient, the parity shard is calculated through the erasure coding algorithm, and the data shards and parity shards are stored in different OSDs. See Figure 3As shown in the figure, in the following case, the shard attribute of the object is 7, the erasure coding technology K (data stripe erasure unit quantity) of the storage system is 5, and the erasure coding technology M (check stripe erasure unit quantity) is 3. When performing erasure coding, the 5 shards of the object are filled into one erasure stripe in order, and the remaining two shards of the object are filled into another erasure stripe in order, and the second to fifth erasure units of the data stripe of the other erasure stripe need to be filled with data zero, so the third to fifth erasure units of the other erasure stripe are all-zero shards.
[0055] S4, calculating the position parameter cur_shard of the current data block to be restored in the acting_map of the object to be restored; the position of the data block to be restored in the acting_map can be determined according to the position parameter cur_shard.
[0056] S5, judging whether the current data block to be recovered is an all-zero shard according to the position parameter cur_shard. In the specific implementation process, combining the position of the data block to be recovered obtained by the position parameter cur_shard in the acting_map and the distribution of all-zero shards in the acting_map, it can be known whether the current data block to be recovered is an all-zero shard. All-zero shards are only distributed in the data stripe, and the shards located in the check stripe are not all-zero shards even if their contents are all zero.
[0057] If the current data block to be restored is an all-zero fragment, execute S6; if the current data block to be restored is not an all-zero fragment, execute S7.
[0058] S6, see Figure 5 As shown, when data is recovered for a data block determined to be an all-zero shard, an empty file is created through a touch operation, and the attributes of the empty file are determined based on the information of the all-zero shard, so that the storage system can identify the attributes of the empty file and obtain the information of the all-zero shard it represents; specifically, the information of the all-zero shard includes the OSD information corresponding to the all-zero shard (different from the OSD of other shards in the erasure stripe) and the size information of the all-zero shard, and the index attribute of the empty file is configured according to the OSD information corresponding to the all-zero shard, and the size attribute of the empty file is configured according to the size information of the all-zero shard. When the storage device of other shards fails and the erasure code count needs to be used to recover data using the empty file, the index attribute of the empty file is identified to obtain the OSD information of the all-zero shard, and the size attribute of the empty file is identified to determine the size information of the all-zero shard, so as to construct an inverse operation matrix for recovering data.
[0059] S7, performing a normal erasure code data recovery process, obtaining the recovered data through inverse operations, and writing the recovered data into the storage space.
[0060] Example 2
[0061] Embodiment 2 provides a method for managing an empty file representing an all-zero slice, including:
[0062] See also Figure 6 As shown, the deleted information of the object is detected. When an object is deleted, the empty file corresponding to the object is found according to the object query empty file index, and the empty file is deleted.
[0063] See also Figure 7 As shown, the storage system object information is traversed, the index attributes of the empty files representing all-zero slices in the storage system are traversed, and the empty files representing all-zero slices that exist but have no corresponding objects are found according to the object information and the index attributes of the empty files, and the empty files representing all-zero slices that exist but have no corresponding objects are deleted.
[0064] The creation of empty files will inevitably occupy the index resources of the storage system. Therefore, it is necessary to clean up the empty files of deleted objects in a timely manner to avoid the index resources of the storage system being occupied by accumulated empty files. The management method for representing empty files of all-zero slices provided in the embodiment of the present application can clean up invalid empty files representing all-zero slices.
[0065] See also Figure 8 As shown, the change information of the object is detected. When a certain object is changed and the acting_map is changed as a whole, and the distribution of all-zero slices is changed, the two acting_maps before and after are obtained and compared to determine whether all-zero slices are added or deleted. If new all-zero slices are added, the corresponding empty files are constructed. If all-zero slices are deleted, the corresponding empty files are deleted. After the change of the empty files according to the corresponding object is completed, the old acting_map is deleted.
[0066] When an object changes, it is likely to cause a change in the all-zero shard. The corresponding empty files need to be changed according to the specific changes in the all-zero shard. Get the two acting_maps before and after the object change and compare them to get the changes in the all-zero shard. Add or delete the corresponding empty files according to the changes in the all-zero shard.
[0067] Example 3
[0068] The present application also provides an erasure code data recovery optimization device based on environmental information, comprising:
[0069] An environmental information collection module, wherein the environmental information collection module is used to collect information on the erasure code technology used by the storage system; the erasure code technology information includes the capacity of the adopted erasure unit, the data capacity of the erasure stripe, the number of erasure units in the erasure stripe, the number of erasure units in the data stripe in the erasure stripe, and the number of erasure units in the check stripe in the erasure stripe.
[0070] An object attribute configuration module, the object attribute configuration module calculates the object's shard number attribute based on the collected erasure code technology information; in the specific implementation process, during the object creation process, or when the size of the created object is changed by operations such as content addition, content deletion or content replacement, the object attribute configuration module obtains the object's size information as the first operand, and the object attribute configuration module uses the erasure unit capacity collected by the environmental information collection module as the second operand, and divides the first operand by the second operand to determine whether the first operand and the second operand are divisible. If they are divisible, the obtained value is used as the object's shard number. If they are not divisible, the obtained value is added by one, and the value after the addition is used as the object's shard number. The object attribute configuration module sends the object's shard number as the object's attribute to the database for storage.
[0071] An acting_map construction module is used to construct an acting_map according to the erasure code technical information and the object's shard number attribute; the object's shards are orderly allocated to the erasure stripes configured according to the erasure code technical information, a complete data stripe is obtained by padding with zeros, and a check stripe is obtained by multiplying the complete data stripe with the generator matrix according to the erasure code algorithm. The acting_map records the distribution of data shards and check shards, and obtains a remainder by dividing the object shard number attribute by the number of erasure units in the data stripe, and determines the shard to be padded with zeros according to the remainder, thereby determining the distribution of the all-zero shards in the acting_map.
[0072] A storage module is used to store an acting_map formed according to erasure code technical information and object attributes.
[0073] The judgment module is used to judge whether the data block to be recovered is an all-zero shard according to the position parameter cur_shard of the data block to be recovered. During the data recovery process, the position parameter cur_shard of the data block to be recovered is obtained. The judgment module combines the acting_map and the position parameter cur_shard to judge whether the data block to be recovered falls in the all-zero shard area, thereby realizing the judgment whether the data block to be recovered is an all-zero shard.
[0074] A recovery optimization module, when the recovery optimization module recovers the all-zero shard, creates an empty file and modifies the empty file attribute according to the information of the all-zero shard, and the recovery optimization module recovers the non-all-zero shard normally according to the erasure code recovery process.
[0075] The recovery optimization module includes an empty file creation unit and an empty file attribute modification unit. The empty file creation unit is used to create an empty file when performing recovery of an all-zero slice, and the control guard attribute modification unit is used to obtain information of the all-zero slice and modify the attribute of the empty file according to the information of the all-zero slice. Specifically, the index attribute of the empty file is configured according to the object information of the OSD information of the all-zero slice, and the size attribute of the empty file is configured according to the size of the all-zero slice.
[0076] When recovering a non-all-zero shard, the recovery optimization module calculates and obtains the data to be recovered according to the erasure code algorithm, and writes the data to be recovered into the storage space.
[0077] The erasure code data recovery optimization device based on environmental information of the present application also includes an empty file identification module, which identifies the attributes of the empty file to obtain the information of the all-zero shard. In the specific implementation process, when the OSD where the remaining shards are located fails and the all-zero shards are required to participate in the erasure code inverse operation to calculate and recover data, the attributes of the empty file are obtained through the empty file identification module, and the information of the all-zero shards is obtained according to the attributes of the empty file to construct a corresponding matrix to participate in the inverse operation process.
[0078] The erasure code data recovery optimization device based on environmental information of the present application also includes an empty file identification module, which identifies the attributes of the empty file to obtain the information of the all-zero shard. In the specific implementation process, when the OSD where the remaining shards are located fails and the all-zero shards are required to participate in the erasure code inverse operation to calculate and recover data, the attributes of the empty file are obtained through the empty file identification module, and the information of the all-zero shards is obtained according to the attributes of the empty file to construct a corresponding matrix to participate in the inverse operation process.
[0079] The erasure code data recovery optimization device based on environmental information of the present application also includes an empty file management module, which is used to manage empty files that exist independently from the storage space; specifically, the empty file management module detects object deletion information, and when the object is deleted, the empty file management module retrieves the index attributes of the empty file according to the object information to determine whether the deleted object contains an empty file representing an all-zero fragment. If it does, the empty file management module will delete the empty file representing the all-zero fragment contained in the deleted object.
[0080] The empty file management module detects the change information of the object. When a certain object is changed and the acting_map is changed as a whole, and the distribution of the all-zero slices is changed, the empty file management module obtains and compares the two acting_maps before and after to determine whether the all-zero slices are added or deleted. If a new all-zero slice is added, the corresponding empty file is constructed. If an all-zero slice is deleted, the corresponding empty file is deleted. After the change of the empty file according to the corresponding object change is completed, the empty file management module deletes the old acting_map.
[0081] In addition, the empty file management module can also traverse the information of all objects in the storage system, traverse all empty file information representing all-zero slices, establish a mapping through the object information and the index attributes of the empty files, and delete all empty files representing all-zero slices that are not mapped to the object information.
[0082] Example 4
[0083] An embodiment of the present application provides a storage medium, which stores at least one instruction, and executing the instruction implements the method for optimizing erasure code data recovery based on environmental information, and executing the instruction implements the method for managing empty files representing all-zero shards.
[0084] Example 5
[0085] An embodiment of the present application provides a storage system, which includes a memory and a processor, wherein the memory is used to store objects and programs, and the processor executes the program stored in the memory to implement a method for optimizing erasure code data recovery based on environmental information, and executes the program to implement a method for managing empty files representing all-zero shards.
[0086] The present application can obtain the number of erasure units of the data stripe, the number of erasure units of the check stripe, and the capacity of the erasure unit in the erasure stripe adopted by the erasure code encoding technology adopted by the storage system from environmental information, and calculate the object's shard number attribute according to the erasure unit capacity and the size of the object; the object's acting_map is established by the shard number attribute and the number of erasure units of the data stripe and the number of check stripe erasure units in the erasure stripe, and the distribution of all-zero shards in the acting_map is obtained by the remainder of the division of the object's shard number attribute and the erasure unit of the data stripe. When performing data recovery, it is determined whether the data block to be recovered is an all-zero shard based on the acting_map with the clear all-zero shard distribution and the cur_shard of the data block to be recovered. If it is an all-zero shard, an empty file with corresponding attributes is established to replace the writing of data zero during recovery, thereby saving the storage space of the storage system, reducing the write bandwidth occupied by the writing of zero data of all-zero shards in the conventional repair process, and improving the overall performance of the storage system.
[0087] In addition, the present application can manage the empty files corresponding to the objects according to the changes of the objects, specifically detect the deleted information of the objects, and delete the empty files corresponding to the objects representing the all-zero slices when the objects are deleted. Detect the change information of the objects, when a certain object is changed and the distribution of the all-zero slices is changed, compare the two acting_maps before and after to determine whether the all-zero slices are added or deleted, if the all-zero slices are added, then construct the corresponding empty files, if the all-zero slices are deleted, then delete the corresponding empty files.
[0088] The creation of empty files will inevitably occupy the index resources of the storage system, so it is necessary to clean up the empty files of deleted objects in time to avoid the index resources of the storage system being occupied by accumulated empty files. The management method for representing empty files of all-zero shards provided in the embodiment of the present application can clean up invalid empty files representing all-zero shards. During the object change process, the distribution of all-zero shards will also change. The change of all-zero shards is obtained by comparing the previous and subsequent acting_maps, and the corresponding empty files are added or deleted to ensure the normal encoding of the erasure code after the object changes.
[0089] In summary, on the one hand, the present application can determine the distribution of all-zero shards generated during erasure coding according to environmental information and the attribute of the number of object shards, and judge whether the data to be recovered is an all-zero shard according to the distribution of the cur-shard and all-zero shards of the data block to be recovered; on the other hand, when performing data repair, the present application uses empty files instead of all-zero shards to save storage space, reduce write bandwidth during data recovery, and improve the overall performance of the storage system.
[0090] In addition, the present application can manage empty files that are separated from the object storage space according to the change of the object, ensuring that the empty files always correspond to the all-zero fragments of the object that are erasure coded, thereby ensuring that the application of erasure coding technology will not be wrong due to empty files.
[0091] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0092] In the embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0093] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0094] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0095] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0096] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for optimizing erasure code data recovery based on environmental information, characterized in that: include: Read the shard count attribute of the object to be recovered from the recovery information, and obtain the number of erasure correction units in the data stripe and the check stripe from the environment information of the storage system where the object is located; An acting_map of an object encoded by erasure coding is established according to the attribute of the number of shards, the number of erasure units in the data stripe, and the number of erasure units in the check stripe. The acting_map records the distribution of data shards and check shards after the object is encoded by erasure coding, and records the OSDs where the data shards and check shards are located. Determine the all-zero shard distribution of all-zero shards in the acting_map according to the number of shards of the object and the number of erasure units in the data stripe, calculate the position parameter cur_shard of the current data block to be recovered in the acting_map of the object to be recovered, and determine whether the current data block to be recovered is an all-zero shard according to the position parameter cur_shard; wherein the all-zero shard is an erasure unit filled with all zeros when the original data of the object is insufficient to fill a data stripe of an erasure stripe and the remaining erasure units are supplemented with zeros to form a complete data stripe; If yes, when performing data recovery on the all-zero slice, an empty file is created through a touch operation, and the attributes of the empty file are determined according to the information of the all-zero slice, so that the storage system identifies the attributes of the empty file and obtains the information of the all-zero slice represented by it, wherein the information of the all-zero slice includes the OSD information corresponding to the all-zero slice and the size information of the all-zero slice, and the index attribute of the empty file is configured according to the OSD information corresponding to the all-zero slice, and the size attribute of the empty file is configured according to the size information of the all-zero slice; Otherwise, data recovery is performed using the erasure coding algorithm, and the recovered data is written to the storage space.
2. According to claim 1, the method for optimizing erasure code data recovery based on environmental information is characterized in that: The attributes of the number of shards of the object to be restored read from the recovery information include: During the object creation and change phase, the number of shards of the object is calculated and saved in the database as a property of the object; The object to be restored is determined from the restoration information, and the corresponding shard number attribute is read from the database according to the object to be restored.
3. The method for optimizing erasure code data recovery based on environmental information according to claim 2, characterized in that: Calculating the number of shards of an object includes dividing the object size by the capacity of an erasure unit to determine whether it is divisible. If it is divisible, the obtained value is used as the number of shards of the object. If it is not divisible, the obtained value is added by one, and the value after adding one is used as the number of shards of the object. The capacity of the erasure unit is obtained from environmental information.
4. A method for managing an empty file representing an all-zero slice, used for managing any empty file representing an all-zero slice in claims 1-3, characterized in that: include: Detect whether the object is deleted. If the object is deleted, query the empty file index based on the deleted object, and delete the empty file after the empty file corresponding to the object is found. Traverse the storage system object information, traverse the storage system empty file information representing the all-zero slices, and delete the empty files representing the all-zero slices that do not correspond to the objects; wherein the all-zero slices are erasure units filled with zeros generated when the original data of the object is insufficient to fill a data stripe of an erasure stripe and the remaining erasure units are supplemented with zeros to form a complete data stripe; the attributes of the empty files are determined according to the information of the all-zero slices, the information of the all-zero slices includes the OSD information corresponding to the all-zero slices and the size information of the all-zero slices, the index attributes of the empty files are configured according to the OSD information corresponding to the all-zero slices, and the size attributes of the empty files are configured according to the size information of the all-zero slices; Detect object change information. When an object is changed, compare the two acting_maps before and after the object is changed, where the acting_map records the distribution of data shards and check shards after the object is erasure coded, and records the OSDs where the data shards and check shards are located; determine whether all-zero shards are added or deleted. If new all-zero shards are added, construct corresponding empty files. If all-zero shards are deleted, delete the corresponding empty files.
5. A device for optimizing data recovery of erasure codes based on environmental information, characterized in that: include: An environment information collection module, the environment information collection module is used to collect erasure code technology information applied by the storage system; An object attribute configuration module, wherein the object attribute configuration module calculates a shard quantity attribute of the object according to the collected erasure code technology information; An acting_map construction module, wherein the acting_map construction module is used to construct an acting_map according to the erasure code technology information and the object's shard number attribute, wherein the acting_map records the distribution of data shards and check shards after the object is erasure coded, and records the OSDs where the data shards and check shards are located; A storage module, the storage module is used to store an acting_map formed according to erasure code technical information and object attributes; A judgment module, the judgment module is used to determine the all-zero shard distribution of the all-zero shards in the acting_map according to the number of shards of the object and the number of erasure units in the data stripe, calculate the position parameter cur_shard of the current data block to be recovered in the acting_map of the object to be recovered, and judge whether the current data block to be recovered is an all-zero shard according to the position parameter cur_shard, wherein the all-zero shard is an erasure unit filled with all zeros when the original data of the object is insufficient to fill a data stripe of an erasure stripe and the remaining erasure units are supplemented with zeros to form a complete data stripe; The recovery optimization module, when recovering the all-zero shard, creates an empty file and modifies the empty file attribute according to the information of the all-zero shard, and the recovery optimization module recovers the non-all-zero shard normally according to the erasure code recovery process.
6. The erasure code data recovery optimization device based on environmental information according to claim 5, characterized in that: It also includes an empty file identification module, which identifies the attributes of the empty file and obtains information of all-zero fragments.
7. The erasure code data recovery optimization device based on environmental information according to claim 5, characterized in that: The recovery optimization module includes an empty file creation unit and an empty file attribute modification unit.
Citation Information
Patent Citations
Data storage method of cloud storage system
CN102546755A
Volume-level redundancy coding techniques for sequential transfer optimized storage devices
CN107111636A
