CN115470049A - Metadata repairing method and device, electronic equipment and storage medium - Google Patents

Metadata repairing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115470049A
CN115470049A CN202211420802.9A CN202211420802A CN115470049A CN 115470049 A CN115470049 A CN 115470049A CN 202211420802 A CN202211420802 A CN 202211420802A CN 115470049 A CN115470049 A CN 115470049A
Authority
CN
China
Prior art keywords
entry
table entry
damaged
secondary address
backup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211420802.9A
Other languages
Chinese (zh)
Other versions
CN115470049B (en
Inventor
刘海伟
公维锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN202211420802.9A priority Critical patent/CN115470049B/en
Publication of CN115470049A publication Critical patent/CN115470049A/en
Application granted granted Critical
Publication of CN115470049B publication Critical patent/CN115470049B/en
Priority to PCT/CN2023/084812 priority patent/WO2024103596A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a metadata repairing method, a metadata repairing device, electronic equipment and a storage medium, which relate to the field of virtual storage, and the method comprises the following steps: when a damaged table entry exists in a secondary address table of the virtual disk, inquiring a backup table entry corresponding to the damaged table entry in a backup disk corresponding to the virtual disk; each table entry of the secondary address table is used for recording the address of each user data in the virtual disk; when the backup table entry is found, repairing the damaged table entry by using the backup table entry; when the backup table entry is not found, a reverse-push secondary address table is constructed by scanning the addresses of all user data in the virtual disk, and the damaged table entry is repaired by utilizing the reverse-push secondary address table; the damaged table entries in the secondary address table of the virtual disk can be repaired by adopting backup data and a reverse secondary address table constructed by scanning all user data addresses in the virtual disk, so that the lost user data can be repaired as much as possible.

Description

Metadata repairing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of virtual storage, and in particular, to a method and an apparatus for metadata recovery, an electronic device, and a computer-readable storage medium.
Background
The virtual disk is an important component in the virtual machine device, wherein qcow2 is a common format of the virtual disk. In the related art, a primary address Table (L1 Table) and a secondary address Table (L2 Table) are important metadata required for address management of a virtual disk, where the primary address Table is used to store addresses of the secondary address Table in the virtual disk, and the secondary address Table is used to store addresses of a user Data Cluster (Data Cluster) in the virtual disk. Thus, the virtual disk can perform user data query according to the sequence from L1 to L2. In addition, in the addressing process of the virtual disk, in order to improve the efficiency of searching data, a secondary address table cached in a memory is often used for recording the accessed user data cluster. However, when the system is powered off and the file system is abnormal, the cache data of the secondary address table may be disturbed, so that the secondary address table cannot be printed on the virtual disk, and the data content is converted into a random number. At this time, the secondary address table cannot be used for addressing, thereby causing the data loss problem of the virtual disk.
Therefore, how to repair the damaged secondary data table is a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention aims to provide a metadata repairing method, a metadata repairing device, electronic equipment and a computer readable storage medium, which can repair damaged entries in a secondary address table of a virtual disk by adopting backup data and a reverse secondary address table constructed in a mode of scanning all user data addresses in the virtual disk so as to repair lost user data as far as possible.
In order to solve the above technical problem, the present invention provides a metadata repair method, including:
when a damaged table entry exists in a secondary address table of a virtual disk, inquiring a backup table entry corresponding to the damaged table entry in a backup disk corresponding to the virtual disk; each table entry of the secondary address table is used for recording the address of each user data in the virtual disk;
when the backup table entry is found, repairing the damaged table entry by using the backup table entry;
and when the backup table entry is not found, a reverse secondary address table is constructed by scanning the addresses of all the user data in the virtual disk, and the damaged table entry is repaired by utilizing the reverse secondary address table.
Optionally, before determining that there is a damaged entry in the secondary address table of the virtual disk, the method further includes:
acquiring the secondary address table from the virtual disk, and sequentially setting each table entry in the secondary address table as a table entry to be detected;
judging whether the data content of the table entry to be detected can be divided by the size of a preset data cluster;
if not, determining that the table entry to be detected is a damaged table entry.
Optionally, the obtaining the secondary address table from the virtual disk includes:
acquiring a primary address table from the virtual disk, and searching a corresponding secondary address table in the virtual disk according to each table item of the primary address table; and the table entry of the primary address table is used for recording the initial address of each secondary address table in the virtual disk.
Optionally, after determining that the entry to be detected is a damaged entry, the method further includes:
recording the index of the damaged table entry in the primary address table;
correspondingly, the querying the backup table entry corresponding to the damaged table entry in the backup disk corresponding to the virtual disk includes:
and acquiring a backup primary address table from the backup disk, and searching the backup table entry in the backup disk by using the index and the backup primary address table.
Optionally, the method further comprises:
and regularly utilizing the data in the virtual disk to perform backup updating on the data in the backup disk.
Optionally, the constructing a reverse-pushing secondary address table by scanning addresses of all user data in the virtual disk includes:
skipping the disk data with the preset size at the head of the virtual disk, and sequentially setting the data with the specified size as data to be verified in the remaining disk data according to the sequence from front to back;
and performing matching verification on the data to be verified by using preset characteristics, and writing a target address of the data to be verified in the virtual disk into the reverse-pushing secondary address table when the data to be verified passes the matching verification, so that the target address is used as an item of the reverse-pushing secondary address table.
Optionally, the performing matching verification on the data to be verified by using the preset features includes:
and when the head and the tail of the data to be verified do not simultaneously contain the key words of the primary address table and the data to be verified and the key words of the reference count table are different, determining that the data to be verified passes the matching verification.
Optionally, the repairing the damaged entry by using the backward-pushing secondary address table includes:
searching a corresponding previous normal table entry of the damaged table entry in the secondary address table;
and determining a target table entry corresponding to the normal table entry in the reverse-pushing secondary address table, and repairing the damaged table entry by using the next table entry of the target table entry.
Optionally, the repairing the damaged entry by using the backward-pushing secondary address table includes:
determining a damaged table entry group consisting of continuous damaged table entries in the secondary address table, and searching a previous normal table entry corresponding to the damaged table entry group;
determining a target table entry corresponding to the normal table entry in the reverse-thrust secondary address table, and repairing the damaged table entry group by using a specified number of table entries behind the target table entry; the specified number is the number of damaged entries contained in the damaged entry group.
Optionally, after repairing the damaged entry by using the backward-pushing secondary address table, the method further includes:
marking the repaired damaged table entry as a repaired table entry, and determining a target index value of the repaired table entry in the secondary address table;
restarting a virtual machine to which the virtual disk belongs, and determining whether user data corresponding to the repaired table entry is recovered in the virtual machine;
if not, adding an offset value to the target index value within a preset offset interval so as to move the position of the repaired table item in the secondary address table; the offset value is integral multiple of the size of the preset data cluster.
Optionally, before adding an offset value to the target index value within a preset offset interval, the method further includes:
determining a repaired table entry group formed by continuous repaired table entries, and determining a previous normal table entry and a next normal table entry corresponding to the repaired table entry group in the secondary address table;
determining a first index value corresponding to the previous normal table entry and a second index value corresponding to the next normal table entry in the secondary address table; determining a preset offset interval corresponding to the repaired table entry group by using the first index value, the second index value and the size of the preset data cluster;
correspondingly, the adding an offset value to the target index value within a preset offset interval includes:
and adding an offset value to the target index value in a preset offset interval corresponding to the repaired table item group to which the repaired table item belongs.
Optionally, after adding an offset value to the target index value within a preset offset interval, the method further includes:
restarting the virtual machine to which the virtual disk belongs, and determining whether the user data corresponding to the repaired table entry added with the offset value is recovered in the virtual machine;
if not, adjusting the offset value in the preset offset interval, adding the adjusted offset value to the target index value of the repaired table entry, and entering the step of restarting the virtual machine to which the virtual disk belongs.
The present invention also provides a metadata repair apparatus, including:
the backup table item query module is used for querying a backup table item corresponding to a damaged table item in a backup disk corresponding to a virtual disk when the damaged table item exists in a secondary address table of the virtual disk; each table entry of the secondary address table is used for recording the address of each user data in the virtual disk;
the first repairing module is used for repairing the damaged table entry by using the backup table entry when the backup table entry is found;
and the second repair module is used for scanning the addresses of all user data in the virtual disk to construct a reverse secondary address table and repairing the damaged table item by using the reverse secondary address table when the backup table item is not found.
The present invention also provides an electronic device comprising:
a memory for storing a computer program;
a processor for implementing the metadata repair method as described above when executing the computer program.
The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are loaded and executed by a processor, the metadata recovery method as described above is implemented.
The invention provides a metadata repairing method, which comprises the following steps: when a damaged table entry exists in a secondary address table of a virtual disk, inquiring a backup table entry corresponding to the damaged table entry in a backup disk corresponding to the virtual disk; each table entry of the secondary address table is used for recording the address of each user data in the virtual disk; when the backup table entry is found, repairing the damaged table entry by using the backup table entry; and when the backup table entry is not found, a reverse secondary address table is constructed by scanning the addresses of all the user data in the virtual disk, and the damaged table entry is repaired by utilizing the reverse secondary address table.
Therefore, when the damaged table entry exists in the secondary address table of the virtual disk, the backup table entry corresponding to the damaged table entry is preferentially inquired in the backup disk corresponding to the virtual disk, and the damaged table entry is preferentially repaired by using more accurate backup data, so that the success rate of recovering user data is improved; if the relevant backup table entry can not be searched from the backup disk, the invention can also construct a reverse secondary address table by scanning all user data addresses in the virtual disk, and repair the damaged table entry by utilizing the reverse secondary address table, because the reverse secondary address table can contain all user data addresses, and normal table entries containing correct user data addresses still exist in the secondary address table, and further the similarity exists between the secondary address table and the reverse secondary address table, the invention can repair the damaged table entry by utilizing the reverse secondary address table based on the similarity, and avoid the loss of user data as much as possible. In short, the invention can adopt the backup data and the reverse secondary address table to repair the damaged table entry in the secondary address table of the virtual disk so as to repair the lost user data as much as possible. The present invention can also provide a metadata repair apparatus, an electronic device, and a computer-readable storage medium, having the above-mentioned advantageous effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a metadata recovery method according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating first type of repair of entries in a secondary address table according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating second type of second-level address table entry repair according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a third type of table entry repair of a secondary address table according to an embodiment of the present invention;
fig. 5 is a block diagram illustrating a structure of a metadata recovery apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram illustrating another exemplary metadata recovery apparatus according to an embodiment of the present invention;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present invention;
fig. 8 is a block diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, a primary address Table (L1 Table) and a secondary address Table (L2 Table) are important metadata required for address management of a virtual disk, where the secondary address Table is used to store addresses of user data clusters in the virtual disk. However, when the system is powered off and the file system is abnormal, the secondary address table cache may have a data disorder condition, which further causes the problems that the data of the secondary address table cannot be printed on the virtual disk, the data content is converted into a random number, and the like. At this time, the secondary address table cannot be used for addressing, thereby causing the data loss problem of the virtual disk. In view of this, the present invention may provide a metadata repairing method, which may repair a damaged entry in a secondary address table of a virtual disk by using backup data and a backward-pushing secondary address table constructed by scanning all user data addresses in the virtual disk, so as to repair lost user data as much as possible. Referring to fig. 1, fig. 1 is a flowchart illustrating a metadata recovery method according to an embodiment of the present invention, where the method includes:
s101, when a damaged table entry exists in a secondary address table of a virtual disk, a backup table entry corresponding to the damaged table entry is inquired in a backup disk corresponding to the virtual disk; and each table entry of the secondary address table is used for recording the address of each user data in the virtual disk.
It should be noted that, first, each entry in the secondary address table is used to store the address of the corresponding user data in the virtual disk, and the virtual disk is based on each entry in the secondary address table for addressing the user data. This means that if a damaged entry is found in the secondary address table, the user data address stored in the entry is invalid, and the virtual disk cannot find the corresponding user data using the damaged entry, which means that the user data is lost. Therefore, if the damaged entry in the secondary address table can be repaired, the corresponding relationship between the secondary address table and the user data is recovered, which means that the lost user data is retrieved.
The embodiment of the invention can firstly introduce the corresponding backup disk for the virtual disk and utilize the backup disk to backup the user data, the primary address table, the secondary address table and the like stored in the virtual disk. Furthermore, when a damaged entry exists in the secondary address table of the virtual disk, the damaged entry can be repaired by using the corresponding backup entry in the backup disk, so as to achieve the effect of recovering the user data. In practical application, the backup disk can be physically isolated from the production storage pool where the virtual disk is located, so that when the production storage pool suffers from mechanical or electrical failure, the backup storage pool will not be affected, and the safety of user data can be protected to the greatest extent. It should be noted that, in the embodiment of the present invention, only the damaged entry having the fault in the secondary address table of the virtual disk is restored by using the backup disk, but the user data corresponding to the entry is not repaired. This is because the user data itself may not be damaged, and only the corresponding entry in the secondary address table has an exception; meanwhile, under the influence of the backup period, the user data in the backup disk may not be identical to the user data in the virtual disk, and further, if the user data corresponding to the damaged entry is also repaired by using the backup disk, the user data is easily damaged, which brings inconvenience to the normal use of the user.
Further, it should be noted that the embodiment of the present invention does not limit how to determine the detection method of the damaged entry, for example, whether the entry is damaged may be determined by whether the corresponding user Data can be found by using the entry, or whether the entry is damaged may be determined by whether the entry can be divided by a preset Data Cluster size, where a Data Cluster (Cluster) is a minimum storage unit in a virtual disk, each user Data may be stored by using a corresponding user Data Cluster (Data Cluster), and further an address of each user Data should be an integer multiple of the Data Cluster size. In view of the fact that the detection efficiency is high by adopting the preset data cluster size, the method is adopted to detect each table entry in the secondary address table in the embodiment of the invention.
In a possible case, before determining that there is a damaged entry in the secondary address table of the virtual disk, the method may further include:
step 11: acquiring a secondary address table from the virtual disk, and sequentially setting each table item in the secondary address table as a table item to be detected;
step 12: judging whether the data content of the table entry to be detected can be divided by the size of a preset data cluster; if yes, go to step 13; if not, entering step 14;
step 13: step 12 is executed for the next table entry to be detected;
step 14: and determining the table entry to be detected as a damaged table entry.
It should be noted that a plurality of secondary address tables may be provided in the virtual disk, and data clusters occupied by each secondary address table may not be adjacent to each other, and it is inconvenient to search for the secondary address table by scanning the virtual disk. In view of the fact that each entry of the primary address table stores the initial address of each secondary address table in the virtual disk, the embodiment of the present invention may perform secondary address table lookup using the primary address table.
In one possible scenario, obtaining a secondary address table from a virtual disk includes:
step 21: acquiring a primary address table from the virtual disk, and searching a corresponding secondary address table in the virtual disk according to each table item of the primary address table; the table entry of the primary address table is used for recording the initial address of each secondary address table in the virtual disk.
Further, it should be noted that, for the convenience of query and management, in addition to recording the initial address of the secondary address table, the primary address table also stores the index of each entry in the secondary address table. Meanwhile, considering that the primary address table in the backup disk and the primary address table in the virtual disk are the same in terms of data content and table structure, after finding out the damaged entry in the secondary address table, the index of the entry corresponding to the primary address table in the virtual disk can be determined, and then the corresponding backup entry can be found in the backup disk by using the index and the primary address table in the backup disk.
In a possible case, after determining that the entry to be detected is a damaged entry, the method may further include:
step 31: recording the corresponding index of the damaged table item in the primary address table;
correspondingly, querying the backup table entry corresponding to the damaged table entry in the backup disk corresponding to the virtual disk may include:
step 32: and acquiring a backup primary address table from the backup disk, and searching a backup table item in the backup disk by using the index and the backup primary address table.
Furthermore, in order to ensure that the data in the backup disk is reliable and effective, the data in the backup disk can be regularly backed up and updated by using the data in the virtual disk.
In one possible case, the method may further include:
step 41: and regularly utilizing the data in the virtual disk to perform backup updating on the data in the backup disk.
It should be noted that, the embodiment of the present invention does not limit the specific backup update period, and may be set according to the actual application requirement.
S102, when the backup table entry is found, the damaged table entry is repaired by using the backup table entry.
If the backup table entry corresponding to the damaged table entry can be found in the backup disk, the backup table entry can be written back to the corresponding position of the damaged table entry in the secondary address table of the virtual disk again, so that the damaged table entry can be repaired.
S103, when the backup table entry is not found, a reverse secondary address table is constructed by scanning the addresses of all the user data in the virtual disk, and the damaged table entry is repaired by utilizing the reverse secondary address table.
Further, under the influence of factors such as the backup period, the backup table entry corresponding to the damaged table entry may not be stored in the backup disk, and at this time, the repair of the secondary address table of the virtual disk cannot be completed by using the backup data. In this way, the embodiment of the present invention may provide another way to repair the secondary address Table, and may construct a backward secondary address Table (Maybe _ L2_ Table) by scanning all user data addresses in the virtual disk, and repair the secondary address Table of the virtual disk by using the backward secondary address Table. In brief, besides user data, metadata similar to a primary address Table, a secondary address Table, a reference count Table (Refcount Table) and the like are recorded in the virtual disk, and the metadata has significant data characteristics, so that the data in the virtual disk can be screened according to the data characteristics, metadata contents are screened out, possible user data are reserved, and a reverse-pushing secondary address Table is constructed by using addresses of the possible user data. Subsequently, because the reverse-push secondary address table and the secondary address table of the virtual disk both store the user data address, that is, the two tables have similarity, the reverse-push table item closest to the loss table item can be searched in the reverse-push secondary table according to the similarity between the two tables, and then the loss table item can be repaired by using the reverse-push table item. Of course, the specific building process of the backward-stepping secondary address table and the repair process of the damaged table entry by using the table may further include other preferable steps, which may be specifically referred to the description in the subsequent embodiments.
Based on the embodiment, when it is determined that the damaged entry exists in the secondary address table of the virtual disk, the backup entry corresponding to the damaged entry is preferentially inquired in the backup disk corresponding to the virtual disk, and the damaged entry is preferentially repaired by using the accurate backup data, so that the success rate of recovering the user data is improved; if the relevant backup table entry can not be searched from the backup disk, the invention can also construct a reverse secondary address table by scanning all user data addresses in the virtual disk, and repair the damaged table entry by utilizing the reverse secondary address table, because the reverse secondary address table can contain all user data addresses, and normal table entries containing correct user data addresses still exist in the secondary address table, and further the similarity exists between the secondary address table and the reverse secondary address table, the invention can repair the damaged table entry by utilizing the reverse secondary address table based on the similarity, and avoid the loss of user data as much as possible. In brief, the invention can adopt the backup data and the reverse-push secondary address table to repair the damaged table entry in the secondary address table of the virtual disk, so as to repair the lost user data as much as possible.
Based on the above embodiment, a construction method of the reverse-pushing secondary address table and a process of repairing a damaged table entry in the secondary address table by using the table are described in detail below. In one possible case, the construction of the backward-stepping secondary address table by scanning the addresses of all user data in the virtual disk comprises:
s201, skipping the disk data with the preset size at the head of the virtual disk, and sequentially setting the data with the specified size as the data to be verified in the remaining disk data according to the sequence from front to back.
When performing virtual disk scanning, in order to improve scanning efficiency, disk data with a preset size at the head of the virtual disk may be skipped first. This is because this part of the data is mainly the header of the virtual disk file (qcow 2 file) and does not contain valid user data, so scanning may not be required. The embodiment of the present invention does not limit the specific preset size, and may be, for example, 3 data clusters. After skipping the file header, the implementation of the present invention will sequentially scan the remaining disk data from front to back. Specifically, in the embodiment of the present invention, data with a specified size is sequentially set as to-be-verified data according to a sequence from front to back, where the specified size is a size of user data that can be pointed to by an entry of a secondary address table, and may be, for example, 64 bits (bit). In other words, the embodiment of the present invention will sequentially extract 64 bits of data from the remaining disk data for detection.
S201, matching verification is conducted on the data to be verified by means of preset characteristics, and when the data to be verified pass the matching verification, the target address of the data to be verified in the virtual disk is written into a reverse secondary address table, so that the target address serves as an entry of the reverse secondary address table.
The embodiment of the invention specifically adopts the relevant characteristics of the metadata to carry out matching verification on the data to be verified. Specifically, the verification can be performed by using a key of a primary address table and a key of a reference count table, wherein the key of the primary address table is 0x8000 × 0000, wherein the × represents a wildcard character, namely, a field with a beginning of 8000 and a suffix of 0000 is skipped; and the key to reference the count table is 0X0001000100010001. If the data to be verified does not contain the keywords, the data to be verified can be roughly judged to belong to the user data, then the data to be verified can be judged to pass the verification, and the address of the data to be verified in the virtual disk can be written into a reverse-push secondary address table.
In a possible case, performing matching verification on data to be verified by using preset features may include:
step 51: and when the head and the tail of the data to be verified do not simultaneously contain the key words of the primary address table and the data to be verified is different from the key words of the reference count table, determining that the data to be verified passes the matching verification.
It should be noted that, since the scan of the virtual disk is performed in the order from front to back in the embodiment of the present invention, the addresses stored in the backward secondary address table are also sequentially incremented.
The following describes specific steps for repairing the damaged entry by using the backward-pushing secondary address table. As described above, the backward-stepping secondary address table has similarity with the secondary address table in the virtual disk, so that the backward-stepping secondary address table can be used to search the backward-stepping table entry closest to the damaged entry based on the similarity, and the damaged entry can be repaired by using the backward-stepping table entry. For easy understanding, please refer to fig. 2, fig. 2 is a schematic diagram of entry repair of a first secondary address table according to an embodiment of the present invention, in which the left side is a backward secondary address table, the right side is a secondary address table of a virtual disk, and an entry marked by a mark 13 (entry content is 0x 111111111111) is a damaged entry. The embodiment of the present invention can search the previous normal table entry (i.e. the table entry marked by the mark 14, the table entry content is 0x33c8e 0000) of the damaged table entry in the original secondary address table, the normal table entry is adjacent to the damaged table entry, and the table entry content is smaller than the correct table entry content corresponding to the damaged table entry. Furthermore, a target entry (i.e., the entry marked by the mark 12, the entry content being 0x33c8e 0000) corresponding to the normal entry and having the same content may be searched in the reverse-push secondary address table, and the damaged entry is repaired by using a subsequent entry of the target entry (i.e., the entry marked by the mark 11, the entry content being 0x33cb 80000), where the subsequent entry of the target entry is an entry that is immediately adjacent to the target entry and has an entry content larger than that of the target entry.
In one possible case, repairing the damaged entry using a backward-pushing secondary address table may include:
step 61: searching the corresponding previous normal table entry of the damaged table entry in the secondary address table;
step 62: and determining a target table entry corresponding to the normal table entry in the reverse-push secondary address table, and repairing the damaged table entry by using the next table entry of the target table entry.
Further, if a plurality of adjacent damaged table entries exist in the secondary address table, batch repair can be performed on the damaged table entries. For easy understanding, please refer to fig. 3, fig. 3 is a schematic diagram of second type of second level address table entry repair according to the embodiment of the present invention, in which the side is a backward-moving second level address table, the right side is a second level address table of a virtual disk, and 4 consecutive entries (the entries are 0x 111111111111, 0x222222, 0x333333333, and 0x4444444 respectively) marked by the mark 23 are all damaged entries, and these 4 damaged entries can constitute a damaged entry group. The embodiment of the present invention can search the previous normal table entry (i.e. the table entry marked by the mark 24, the table entry content is 0x33c8e 0000) of the damaged table entry group in the original secondary address table, the normal table entry is adjacent to the damaged table entry group, and the table entry content is smaller than the minimum correct table entry content in the damaged table entry group. Furthermore, a target entry (i.e., the entry marked by the mark 22, the entry content is 0x33c8e 0000) corresponding to the normal entry and having the same content may be searched in the reverse-push secondary address table, and the damaged entry group is repaired by using 4 entries (i.e., 4 consecutive entries pointed by the mark 21, the entry contents are sequentially 0x33cb80000, 0x33ce70000, and 0x33d 200000) after the target entry.
In one possible case, repairing the corrupted table entry using a backward-pushing secondary address table may include:
step 71: determining a damaged table entry group consisting of continuous damaged table entries in the secondary address table, and searching a previous normal table entry corresponding to the damaged table entry group;
step 71: determining a target table entry corresponding to the normal table entry in the reverse-pushing secondary address table, and repairing the damaged table entry group by using the specified number of table entries behind the target table entry; the specified number is the number of corrupted entries contained in the set of corrupted entries.
Based on the embodiment, the invention can construct the reverse-push secondary address table in a mode of scanning all user data addresses in the virtual disk, and repair the damaged table entry based on the similarity between the table and the original secondary address table, thereby further repairing the damaged table entry which can not be repaired by backup data and further improving the effective degree of user data recovery.
Based on the above embodiment, the reverse-push secondary address table is used for repairing the damaged table entry by using a possible user data address, but when the reverse-push secondary address table is constructed, part of the user data address is inevitably omitted, so that the situation that the user address is omitted in the virtual disk secondary address table is caused, and the user data is difficult to recover. For example, referring to fig. 4, fig. 4 is a schematic diagram illustrating a third type of entry repair of a secondary address table according to an embodiment of the present invention, wherein the left side indicates a correct secondary address table, and the right side indicates an incorrect secondary address table. When the table is restored to obtain the secondary address table shown on the right side, although the contents of the entries included in the four entries marked by the marker 32 are completely consistent with the contents of the 4 entries following the two entries marked by the marker 31 in the correct secondary address table, the contents of the two entries marked by the missing marker 31 not only cause the four addresses corresponding to the four entries marked by the marker 32 to be completely invalid, but also additionally cause the two entries following the four entries marked by the marker 32 to be unrecoverable, thereby causing 6 user data losses. Therefore, the embodiment of the present invention may also perform position adjustment on the entries that have been repaired but do not recover the corresponding user data, so as to recover the user data as much as possible. In a possible case, after repairing the damaged entry by using the backward-pushing secondary address table, the method may further include:
s301, the repaired damaged table entry is marked as a repaired table entry, and the target index value of the repaired table entry in the secondary address table is determined.
Specifically, the entries included in the entry group 32 in FIG. 4 may all be marked as repaired entries. It should be particularly noted that the embodiment of the present invention needs to additionally determine the target index value of the repaired entry in the secondary address table, i.e. determine the current location of the repaired entry in the secondary address table.
S302, restarting a virtual machine to which the virtual disk belongs, and determining whether user data corresponding to the repaired table entry is recovered in the virtual machine; if so, judging that the repair is successful; if not, the process proceeds to step S303.
Specifically, due to the data content of the entry marked by the missing mark 31 before the entry marked by the mark 32, the user data corresponding to the entry marked by the mark 32 cannot be read. It is this entry that has been repaired but that fails to recover user data, as indicated by marker 32, that is additionally processed by embodiments of the present invention.
S303, adding an offset value for the target index value in a preset offset interval to move the position of the repaired table item in the secondary address table; the offset value is an integer multiple of the size of the preset data cluster.
Embodiments of the present invention may continue to add offset values to the target index values of the repaired entries to attempt to move the repaired entries to other locations and determine whether the repaired entries can recover the user data corresponding to other locations. It should be noted that, since the data cluster is the minimum storage unit in the virtual disk, the offset value should be an integer multiple of the preset data cluster size; meanwhile, if the target index value of the repaired entry (or the target index value of the repaired entry group) is offset to the position of the normal entry after the offset value is added, the repaired entry is covered by the normal entry, and the offset value does not have the repairing effect, so that in order to avoid using an invalid offset value, the offset value can be added in a preset offset interval. Obviously, the value of the preset offset interval is related to the normal entry adjacent to the repaired entry. Specifically, the preset offset interval is determined as follows:
in a possible case, before adding the offset value to the target index value within the preset offset interval, the method further includes:
step 81: determining a repaired table item group formed by continuous repaired table items, and determining a previous normal table item and a next normal table item which correspond to the repaired table item group in the secondary address table;
step 82: and determining a first index value corresponding to the previous normal table entry and a second index value corresponding to the next normal table entry in the secondary address table.
It should be noted that "first" and "second" are only used to distinguish the index values of the previous normal entry and the next normal entry, and do not represent that the two normal entries have multiple entries in the secondary address table.
Step 83: and determining a preset offset interval corresponding to the repaired table entry group by using the first index value, the second index value and the size of the preset data cluster.
Specifically, the upper limit value of the preset offset interval should be the interval between the index values of the two normal entries minus the size of the preset data cluster.
Correspondingly, adding an offset value to the target index value within the preset offset interval may include:
step 84: and adding an offset value for the target index value in a preset offset interval corresponding to the repaired table item group to which the repaired table item belongs.
Further, after the addition of the offset value is completed, whether the user data is recovered or not can be further verified, and if the user data is not recovered, the offset value can be continuously modified until the recovery is completed or the recovery failure is determined.
In one possible case, after adding the offset value to the target index value within the preset offset interval, the method further includes:
s304, restarting the virtual machine to which the virtual disk belongs, and determining whether the user data corresponding to the repaired table entry added with the deviant is recovered in the virtual machine; if so, judging that the repair is successful; if not, the process proceeds to step S305.
S305, if not, adjusting the offset value in the preset offset interval, adding the adjusted offset value to the target index value of the repaired table entry, and entering the step of restarting the virtual machine to which the virtual disk belongs.
Based on the above embodiment, the embodiment of the present invention may also perform position adjustment on the entry that is repaired but does not recover the corresponding user data, so as to recover the user data as much as possible.
The following describes the metadata repair method based on a specific schematic diagram. Referring to fig. 5, fig. 5 is a block diagram illustrating a structure of a metadata recovery apparatus according to an embodiment of the present invention, and the modules and applications included in the apparatus are described in detail below.
(1) A disk bad block checking module: the L2 Table (L2 Table) is used to check for a damaged disk. According to the L1- > L2 addressing rule corresponding to the qcow2 virtual disk, L2 table entries (the content of the L2 table) are checked in a traversing mode, and L2 table entries which do not accord with the expected rule are found out. The rule is whether the L2 entry can be evenly divided by the data Cluster size (Cluster _ size), and if not, the L2 entry is damaged. The disk bad block checking module obtains a damaged L2 table entry and an index thereof in the L1;
(2) The virtual disk backup module: the system is used for backing up the virtual disk into the backup storage pool so as to perform data recovery when environmental abnormality occurs. Generally in a virtualized platform, two backup strategies, timed backup and immediate backup, may be provided. When the virtual disk is backed up, the virtual disk is backed up in a backup storage pool according to a backup strategy regardless of the metadata or the real data of qcow 2. If the L1 index and the L2 table entry found by the disk bad block checking module exist in the backup disk, the L2 table entry in the backup disk can be used to recover the damaged qcow2 metadata. When the metadata is restored, the real data corresponding to the L2 table entry is not restored, so as to avoid that the previous data covers the current data (once the qcow2 disk metadata is established, the corresponding relationship does not change).
(3) A disk offset recursion module: for exploring all possible user Data clusters (Data Cluster). It does not rely on L1- > L2 addressing rule of qcow2 virtual disk, but according to each offset data cluster size, and according to qcow2 metadata characteristics (firstly, three table headers whose sizes are data cluster sizes are skipped, secondly, fields whose contents are 0X 00010001000100010001 (possibly a reference count table) are skipped, and finally, the skipped contents are 0X8000X 0000[ -representing wildcard characters, namely, fields whose beginning is 8000 and 0000 is suffix) are skipped, and addresses of data blocks which are possibly user data clusters are screened one by one (possibly L2 table entries); further obtaining all possible L2 table entries, and constructing a reverse-pushing secondary address table (Maybe _ L2_ Tables) by using the possible L2 table entries;
(4) Bad block accurate repair module: for repairing qcow2 disk metadata. The method takes the L1 index output by the disk bad block checking module as input, preferentially searches whether a corresponding L2 table entry exists in a backup disk, and if so, writes the L2 table entry into the L2 table entry corresponding to the L1 index of the current damaged disk; and if the backup disk does not find the corresponding L2 table entry, writing the backward-pushing secondary address table obtained by the disk offset backward-pushing module into the L2 table entry corresponding to the L1 index of the current damaged disk.
(5) A repair adjustment module: for adjusting the Offset value (Offset) of the L2 table entry in the L2 table written from the backward secondary address table. When the bad block accurate repair module repairs the virtual disk and certain data cannot be recovered, the offset value of the L2 table entry written from the reverse-push secondary address table in the L2 table can be adjusted through the module so as to repair all data blocks as far as possible.
In the following, the metadata recovery apparatus, the electronic device, and the computer-readable storage medium according to the embodiments of the present invention are introduced, and the metadata recovery apparatus, the electronic device, and the computer-readable storage medium described below may be referred to in correspondence with the data recovery method described above.
Referring to fig. 6, fig. 6 is a block diagram of another metadata recovery apparatus according to an embodiment of the present invention, where the apparatus may include:
a backup table entry query module 601, configured to query a backup table entry corresponding to a damaged table entry in a backup disk corresponding to a virtual disk when it is determined that the damaged table entry exists in a secondary address table of the virtual disk; each table entry of the secondary address table is used for recording the address of each user data in the virtual disk;
a first repair module 602, configured to repair a damaged entry by using a backup entry when the backup entry is found;
the second repairing module 603 is configured to, when the backup table entry is not found, construct a reverse-push secondary address table by scanning addresses of all user data in the virtual disk, and repair the damaged table entry by using the reverse-push secondary address table.
Optionally, the apparatus may further include:
the setting module is used for acquiring a secondary address table from the virtual disk before determining that the damaged table entry exists in the secondary address table of the virtual disk, and setting each table entry in the secondary address table as a table entry to be detected in sequence;
the damaged table item judging module is used for judging whether the data content of the table item to be detected can be divided by the size of a preset data cluster; if not, determining that the table entry to be detected is a damaged table entry.
Optionally, the setting module may include:
the searching submodule is used for acquiring a primary address table from the virtual disk and searching a corresponding secondary address table in the virtual disk according to each table item of the primary address table; the table entry of the primary address table is used for recording the initial address of each secondary address table in the virtual disk.
Optionally, the apparatus may further include:
the recording module is used for recording the corresponding index of the damaged table entry in the primary address table after determining that the table entry to be detected is the damaged table entry;
accordingly, the backup table entry query module 601 may include:
and the backup table item query submodule is used for acquiring the backup primary address table from the backup disk and searching the backup table item in the backup disk by using the index and the backup primary address table.
Optionally, the apparatus may further include:
and the backup module is used for regularly utilizing the data in the virtual disk to perform backup updating on the data in the backup disk.
Optionally, the second repair module 603 includes:
the scanning setting submodule is used for skipping the disk data with the preset size at the head of the virtual disk, and sequentially setting the data with the specified size as the data to be verified in the remaining disk data according to the sequence from front to back;
and the backward-stepping secondary address table construction sub-module is used for performing matching verification on the data to be verified by using the preset characteristics, and writing the target address of the data to be verified in the virtual disk into the backward-stepping secondary address table when the data to be verified passes the matching verification so as to take the target address as the table entry of the backward-stepping secondary address table.
Optionally, the backward-pushing secondary address table building submodule may include:
and the verification unit is used for determining that the data to be verified passes the matching verification when the head and the tail of the data to be verified do not simultaneously contain the key words of the primary address table and the data to be verified is different from the key words of the reference count table.
Optionally, the second repair module 603 includes:
the first searching sub-module is used for searching the corresponding previous normal table item of the damaged table item in the secondary address table;
and the first repair submodule is used for determining a target table entry corresponding to the normal table entry in the backward-pushing secondary address table and repairing the damaged table entry by using the next table entry of the target table entry.
Optionally, repairing the damaged entry by using a backward-stepping secondary address table includes:
the second searching sub-module is used for determining a damaged table item group formed by continuous damaged table items in the secondary address table and searching a previous normal table item corresponding to the damaged table item group;
the second repair submodule is used for determining the corresponding target table entries of the normal table entries in the reverse-pushing secondary address table and repairing the damaged table entry group by using the specified number of table entries behind the target table entries; the specified number is the number of corrupted entries contained in the set of corrupted entries.
Optionally, the apparatus may further include:
the marking module is used for marking the repaired damaged table entry as a repaired table entry and determining a target index value of the repaired table entry in the secondary address table after the damaged table entry is repaired by utilizing the reverse-pushing secondary address table;
the first recovery verification module is used for restarting a virtual machine to which the virtual disk belongs and determining whether user data corresponding to the repaired table entry is recovered in the virtual machine;
the offset value increasing module is used for increasing the offset value for the target index value in the preset offset interval if the target index value is not the target index value, so as to move the position of the repaired table item in the secondary address table; the offset value is an integer multiple of the size of the preset data cluster.
Optionally, the apparatus may further include:
the table item determining module is used for determining a repaired table item group formed by continuous repaired table items before adding an offset value to the target index value in a preset offset interval, and determining a previous normal table item and a next normal table item which correspond to the repaired table item group in the secondary address table;
the index value determining module is used for determining a first index value corresponding to a previous normal table item and a second index value corresponding to a next normal table item in the secondary address table;
the preset offset interval setting module is used for determining a preset offset interval corresponding to the repaired table entry group by using the first index value, the second index value and the size of a preset data cluster;
correspondingly, the offset value increasing module is specifically configured to:
and adding an offset value for the target index value in a preset offset interval corresponding to the repaired table item group to which the repaired table item belongs.
Optionally, the apparatus may further include:
the second recovery verification module is used for restarting the virtual machine to which the virtual disk belongs after adding the offset value to the target index value within the preset offset interval, and determining whether the user data corresponding to the repaired table entry added with the offset value is recovered in the virtual machine; if not, adjusting the offset value in the preset offset interval, adding the adjusted offset value to the original table entry content of the repaired table entry, and entering the step of restarting the virtual machine to which the virtual disk belongs.
Referring to fig. 7, fig. 7 is a block diagram of an electronic device according to an embodiment of the present invention, where the embodiment of the present invention further provides an electronic device, including:
a memory 701 for storing a computer program;
a processor 702 for implementing the steps of the metadata repair method as described above when executing the computer program.
Since the embodiment of the electronic device portion corresponds to the embodiment of the metadata repairing method portion, please refer to the description of the embodiment of the metadata repairing method portion for the embodiment of the electronic device portion, which is not described herein again.
Referring to fig. 8, fig. 8 is a block diagram of a computer-readable storage medium according to an embodiment of the present invention, and the embodiment of the present invention further provides a computer-readable storage medium 810, where a computer program 811 is stored on the computer-readable storage medium 810, and when the computer program 811 is executed by a processor, the steps of the metadata recovery method according to any of the embodiments are implemented.
Since the embodiment of the computer-readable storage medium portion corresponds to the embodiment of the metadata recovery method portion, please refer to the description of the embodiment of the metadata recovery method portion for the embodiment of the storage medium portion, and details are not repeated here.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The metadata recovery method, apparatus, electronic device and computer-readable storage medium provided by the present invention are described in detail above. The principles and embodiments of the present invention have been described herein using specific examples, which are presented only to assist in understanding the method and its core concepts of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (15)

1. A method of metadata repair, comprising:
when a damaged table entry exists in a secondary address table of a virtual disk, inquiring a backup table entry corresponding to the damaged table entry in a backup disk corresponding to the virtual disk; each table entry of the secondary address table is used for recording the address of each user data in the virtual disk;
when the backup table entry is found, repairing the damaged table entry by using the backup table entry;
and when the backup table entry is not found, a reverse secondary address table is constructed by scanning the addresses of all the user data in the virtual disk, and the damaged table entry is repaired by utilizing the reverse secondary address table.
2. The method of claim 1, prior to determining that there is a corrupted entry in the secondary address table of the virtual disk, further comprising:
acquiring the secondary address table from the virtual disk, and setting each table entry in the secondary address table as a table entry to be detected in sequence;
judging whether the data content of the table entry to be detected can be divided by the size of a preset data cluster;
if not, determining that the table entry to be detected is a damaged table entry.
3. The method of claim 2, wherein the retrieving the secondary address table from the virtual disk comprises:
acquiring a primary address table from the virtual disk, and searching a corresponding secondary address table in the virtual disk according to each table item of the primary address table; and the table entry of the primary address table is used for recording the initial address of each secondary address table in the virtual disk.
4. The method according to claim 3, further comprising, after determining that the entry to be detected is a damaged entry:
recording the corresponding index of the damaged table entry in the primary address table;
correspondingly, the querying the backup table entry corresponding to the damaged table entry in the backup disk corresponding to the virtual disk includes:
and acquiring a backup primary address table from the backup disk, and searching the backup table entry in the backup disk by using the index and the backup primary address table.
5. The metadata recovery method according to claim 1, further comprising:
and regularly utilizing the data in the virtual disk to perform backup updating on the data in the backup disk.
6. The method of claim 1, wherein the constructing a backward secondary address table by scanning addresses of all user data in the virtual disk comprises:
skipping the disk data with the preset size at the head of the virtual disk, and sequentially setting the data with the specified size as data to be verified in the remaining disk data according to the sequence from front to back;
and performing matching verification on the data to be verified by using preset characteristics, and writing a target address of the data to be verified in the virtual disk into the reverse secondary address table when the data to be verified passes the matching verification, so that the target address is used as an entry of the reverse secondary address table.
7. The metadata recovery method according to claim 6, wherein the performing matching verification on the data to be verified by using a preset feature comprises:
and when the head and the tail of the data to be verified do not simultaneously contain the key words of the primary address table and the data to be verified and the key words of the reference count table are different, determining that the data to be verified passes the matching verification.
8. The method of claim 6, wherein the repairing the corrupted entry using the backward-looking secondary address table comprises:
searching a corresponding previous normal table entry of the damaged table entry in the secondary address table;
and determining a target table entry corresponding to the normal table entry in the reverse-thrust secondary address table, and repairing the damaged table entry by using the next table entry of the target table entry.
9. The method of claim 6, wherein the repairing the corrupted entry using the backward-looking secondary address table comprises:
determining a damaged table entry group consisting of continuous damaged table entries in the secondary address table, and searching a previous normal table entry corresponding to the damaged table entry group;
determining a target table entry corresponding to the normal table entry in the reverse-thrust secondary address table, and repairing the damaged table entry group by using a specified number of table entries behind the target table entry; the specified number is the number of damaged entries contained in the damaged entry group.
10. The metadata repair method according to any one of claims 1 to 9, further comprising, after repairing the corrupted entry using the backward-pushed secondary address table:
marking the repaired damaged table entry as a repaired table entry, and determining a target index value of the repaired table entry in the secondary address table;
restarting a virtual machine to which the virtual disk belongs, and determining whether user data corresponding to the repaired table entry is recovered in the virtual machine;
if not, adding an offset value to the target index value within a preset offset interval so as to move the position of the repaired table item in the secondary address table; the offset value is an integral multiple of the size of the preset data cluster.
11. The metadata recovery method according to claim 10, wherein before adding an offset value to the target index value within a preset offset interval, the method further comprises:
determining a repaired table entry group formed by continuous repaired table entries, and determining a previous normal table entry and a next normal table entry corresponding to the repaired table entry group in the secondary address table;
determining a first index value corresponding to the previous normal table entry and a second index value corresponding to the next normal table entry in the secondary address table;
determining a preset offset interval corresponding to the repaired table entry group by using the first index value, the second index value and the size of the preset data cluster;
correspondingly, the adding an offset value to the target index value within a preset offset interval includes:
and adding an offset value to the target index value in a preset offset interval corresponding to the repaired table item group to which the repaired table item belongs.
12. The method of claim 10, further comprising, after adding an offset value to the target index value within a preset offset interval:
restarting the virtual machine to which the virtual disk belongs, and determining whether the user data corresponding to the repaired table entry added with the offset value is recovered in the virtual machine;
if not, adjusting the offset value in the preset offset interval, adding the adjusted offset value to the target index value of the repaired table entry, and entering the step of restarting the virtual machine to which the virtual disk belongs.
13. A metadata recovery apparatus, comprising:
the backup table item query module is used for querying a backup table item corresponding to a damaged table item in a backup disk corresponding to a virtual disk when the damaged table item exists in a secondary address table of the virtual disk; each table entry of the secondary address table is used for recording the address of each user data in the virtual disk;
the first repairing module is used for repairing the damaged table entry by using the backup table entry when the backup table entry is found;
and the second repair module is used for constructing a reverse secondary address table by scanning the addresses of all the user data in the virtual disk when the backup table entry is not found, and repairing the damaged table entry by using the reverse secondary address table.
14. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the metadata repair method as claimed in any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium having stored thereon computer-executable instructions which, when loaded and executed by a processor, carry out a method of metadata repair as claimed in any one of claims 1 to 12.
CN202211420802.9A 2022-11-15 2022-11-15 Metadata repairing method and device, electronic equipment and storage medium Active CN115470049B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211420802.9A CN115470049B (en) 2022-11-15 2022-11-15 Metadata repairing method and device, electronic equipment and storage medium
PCT/CN2023/084812 WO2024103596A1 (en) 2022-11-15 2023-03-29 Metadata restoration method and apparatus, and electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211420802.9A CN115470049B (en) 2022-11-15 2022-11-15 Metadata repairing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115470049A true CN115470049A (en) 2022-12-13
CN115470049B CN115470049B (en) 2023-02-28

Family

ID=84338208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211420802.9A Active CN115470049B (en) 2022-11-15 2022-11-15 Metadata repairing method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN115470049B (en)
WO (1) WO2024103596A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024103596A1 (en) * 2022-11-15 2024-05-23 浪潮电子信息产业股份有限公司 Metadata restoration method and apparatus, and electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980195A (en) * 2010-10-26 2011-02-23 青岛海信移动通信技术股份有限公司 Mobile communication terminal-based database index repair method and device
US20170371551A1 (en) * 2016-06-23 2017-12-28 Linkedin Corporation Capturing snapshots of variable-length data sequentially stored and indexed to facilitate reverse reading
US20190042375A1 (en) * 2017-08-07 2019-02-07 Micron Technology, Inc. Performing data restore operations in memory
CN110225351A (en) * 2019-06-20 2019-09-10 北京达佳互联信息技术有限公司 Video file processing method, device, electronic equipment and storage medium
CN112256464A (en) * 2020-10-20 2021-01-22 湖南国科微电子股份有限公司 Hard disk data error correction method and device, electronic equipment and storage medium
CN114840358A (en) * 2022-04-28 2022-08-02 济南浪潮数据技术有限公司 Data restoration method, device and medium based on virtual disk

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704208B (en) * 2017-10-13 2021-08-10 郑州云海信息技术有限公司 Method, device and medium for repairing metadata
CN115470049B (en) * 2022-11-15 2023-02-28 浪潮电子信息产业股份有限公司 Metadata repairing method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980195A (en) * 2010-10-26 2011-02-23 青岛海信移动通信技术股份有限公司 Mobile communication terminal-based database index repair method and device
US20170371551A1 (en) * 2016-06-23 2017-12-28 Linkedin Corporation Capturing snapshots of variable-length data sequentially stored and indexed to facilitate reverse reading
US20190042375A1 (en) * 2017-08-07 2019-02-07 Micron Technology, Inc. Performing data restore operations in memory
CN110225351A (en) * 2019-06-20 2019-09-10 北京达佳互联信息技术有限公司 Video file processing method, device, electronic equipment and storage medium
CN112256464A (en) * 2020-10-20 2021-01-22 湖南国科微电子股份有限公司 Hard disk data error correction method and device, electronic equipment and storage medium
CN114840358A (en) * 2022-04-28 2022-08-02 济南浪潮数据技术有限公司 Data restoration method, device and medium based on virtual disk

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
JIANXIN LI: "iROW: An Efficient Live Snapshot System for Virtual Machine Disk", 《 2012 IEEE 18TH INTERNATIONAL CONFERENCE ON PARALLEL AND DISTRIBUTED SYSTEMS》 *
李等: "一种块级连续数据保护***的快速恢复方法", 《北京理工大学学报》 *
詹东阳: "面向可控云的虚拟机域外安全监测与管理技术研究", 《中国博士学位论文全文数据库信息科技辑》 *
谈华芳等: "一种基于对象存储中的元数据组织管理方法", 《计算机工程》 *
陈春媛: "基于qcow2镜像格式的快照技术", 《信息与电脑(理论版)》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024103596A1 (en) * 2022-11-15 2024-05-23 浪潮电子信息产业股份有限公司 Metadata restoration method and apparatus, and electronic device and storage medium

Also Published As

Publication number Publication date
CN115470049B (en) 2023-02-28
WO2024103596A1 (en) 2024-05-23

Similar Documents

Publication Publication Date Title
US7143251B1 (en) Data storage using identifiers
KR101613678B1 (en) Recovery for non-volatile memory after power loss
JP4950886B2 (en) Nonvolatile storage device, memory controller, and defective area detection method
US7240178B2 (en) Non-volatile memory and non-volatile memory data rewriting method
US11269902B2 (en) Time series data management method, device, and apparatus
CN115470049B (en) Metadata repairing method and device, electronic equipment and storage medium
CN113127378B (en) Data reading method and device and data storage device
CN111581022B (en) Data recovery method and system
US10572335B2 (en) Metadata recovery method and apparatus
CN1696906A (en) Method, system and program product for autonomous error recovery for memory devices
CN101901169A (en) Scanner and method
CN114201120A (en) Data reading and writing method and device and related equipment
CN114721972A (en) Garbage recycling method and device, readable storage medium and electronic equipment
CN112447254A (en) Error detection method in ternary content addressable memory
CN115955248A (en) Data compression method and device, electronic equipment and storage medium
US7716416B2 (en) Analysis for a multiple tag hit in a content addressable memory (CAM)
CN116909939A (en) LSM tree-based key value separation storage engine garbage recycling method, system and equipment
CN115048402B (en) Self-adaptive dynamic data set member inserting, deleting and retrieving method with time effect
CN107908500B (en) Bad block identification method and device
CN111736778B (en) Data updating method, device and system and electronic equipment
CN107301073B (en) Configuration information retrieval method and device based on solid state disk system
JP5041003B2 (en) Search device and search method
CN115454710B (en) Flash memory data reading method and device, electronic equipment and storage medium
CN115357384B (en) Space reclamation method and device for repeated data deleting storage system
CN112463460B (en) Erasure code-based small block data recovery method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant