A snapshot-based fault-tolerance method, device, equipment and medium

By querying and repairing LP and PL metadata in the snapshot module, data inconsistency problems caused by storage media errors are solved and the data integrity of the source and target volumes is ensured.

CN115114093BActive Publication Date: 2024-10-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210761625.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2024-10-22
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

In the COW snapshot function, storage media errors result in the inability to guarantee the consistency and integrity of data in the source volume and target volume.

Method used

By controlling the snapshot module to issue metadata read requests to the all-flash thin pool, query and repair LP metadata and PL metadata, and perform redirection operations to obtain the corresponding metadata of the target volume to ensure data consistency and integrity.

Benefits of technology

Effectively repairs storage media errors, ensures the consistency and integrity of source and target volume data, and prevents data corruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114093B_ABST
    Figure CN115114093B_ABST
Patent Text Reader

Abstract

The present application discloses a fault-tolerant method, device, equipment and medium based on snapshots, and relates to the field of computer technology. The method includes: controlling a snapshot module to send a metadata read request to an all-flash thin pool; controlling the all-flash thin pool to query a first LP metadata in a source volume based on the metadata read request; if the first LP metadata is queried, obtaining a second LP metadata and a second PL metadata corresponding to a target volume based on the first LP metadata; if a storage medium error occurs in a first storage area where the first LP metadata is located, querying the corresponding first PL metadata based on the metadata read request, repairing the first LP metadata using the first PL metadata, and redirecting the repaired first LP metadata and first PL metadata to obtain the second LP metadata and second PL metadata corresponding to the target volume. The present application repairs the first LP metadata through the first PL metadata, and utilizes non-redirection to ensure the consistency and integrity of the source volume and target volume data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a snapshot-based fault-tolerant method, device, equipment and medium. Background Art

[0002] Currently, in the all-flash thin pool storage function, the storage area of ​​the storage pool is divided into a metadata storage area and a data storage area. In the COW (Copy On Write) snapshot function, after receiving the HOST IO (HOST Input / Output), the snapshot module will copy and write data according to the received IO information, and generate metadata for the corresponding copied data. During this process, MEDIA ERROR (storage medium error) may occur. When the HOST IO accesses the area where the medium error occurs, the consistency and integrity of the source volume and target volume data cannot be guaranteed.

[0003] In summary, how to ensure the consistency and integrity of source volume and target volume data is a problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a snapshot-based fault-tolerant method, apparatus, device and medium, which can ensure the consistency and integrity of source volume and target volume data. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a snapshot-based fault tolerance method, comprising:

[0006] Control the snapshot module to send metadata read requests to the all-flash thin pool;

[0007] Controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the LP metadata is the mapping relationship metadata of the logical block address to the physical block address;

[0008] If the first LP metadata is found, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; the PL metadata is the metadata of the mapping relationship between the physical block address and the logical block address;

[0009] If a storage medium error occurs in the first storage area where the first LP metadata is located, the corresponding first PL metadata is queried in the source volume based on the metadata read request, and the first PL metadata is used to repair the first LP metadata. Then, the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume.

[0010] Optionally, the controlling snapshot module sends a metadata read request to the all-flash thin pool, including:

[0011] The host input and output information sent by the host is written into the source volume to control the snapshot module to send a metadata read request to the all-flash thin pool.

[0012] Optionally, the controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request includes:

[0013] The all-flash thin pool is controlled to obtain a target logical block address based on the metadata read request, and to query the first LP metadata in the source volume based on the target logical block address.

[0014] Optionally, the querying the source volume for the corresponding first PL metadata based on the metadata read request includes:

[0015] The target logical block address is obtained based on the metadata read request, and the corresponding first PL metadata is queried in the source volume based on the target logical block address.

[0016] Optionally, acquiring second LP metadata and second PL metadata corresponding to the target volume based on the first LP metadata includes:

[0017] A target physical block address is determined based on the first LP metadata, and second LP metadata and second PL metadata corresponding to the target volume are acquired based on the target volume physical address.

[0018] Optionally, after querying the source volume for the corresponding first PL metadata based on the metadata read request, the method further includes:

[0019] If a storage medium error occurs in the second storage area where the first PL metadata is located, a target mark indicating that a storage medium error has occurred is set in the first storage area and the second storage area, and the target mark indicating that a storage medium error has occurred is set in the target storage area corresponding to the first storage area and the second storage area in the target volume.

[0020] Optionally, after performing a redirection operation on the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, the method further includes:

[0021] New data is written into the source volume, and new LP metadata and new PL metadata corresponding to the new data are generated in the source volume.

[0022] In a second aspect, the present application discloses a snapshot-based fault-tolerant device, comprising:

[0023] A request sending module is used to control the snapshot module to send a metadata read request to the all-flash thin pool;

[0024] A metadata query module, used to control the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the LP metadata is the mapping relationship metadata of the logical block address to the physical block address;

[0025] a first target volume metadata acquisition module, configured to acquire, if the first LP metadata is found, second LP metadata and second PL metadata corresponding to the target volume based on the first LP metadata; the PL metadata is metadata of a mapping relationship between the physical block address and the logical block address;

[0026] The second target volume metadata acquisition module is used to query the corresponding first PL metadata in the source volume based on the metadata read request if a storage medium error occurs in the first storage area where the first LP metadata is located, and use the first PL metadata to repair the first LP metadata, and then redirect the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume.

[0027] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the aforementioned snapshot-based fault-tolerant method is implemented.

[0028] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned snapshot-based fault-tolerant method is implemented.

[0029] It can be seen that the present application controls the snapshot module to send a metadata read request to the all-flash thin pool; controls the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; LP metadata is the metadata of the mapping relationship between the logical block address and the physical block address; if the first LP metadata is queried, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; PL metadata is the metadata of the mapping relationship between the physical block address and the logical block address; if a storage medium error occurs in the first storage area where the first LP metadata is located, the corresponding first PL metadata is queried in the source volume based on the metadata read request, and the first LP metadata is repaired using the first PL metadata, and then the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume. It can be seen that the present application can ensure the integrity of the source volume data by repairing the first LP metadata using the queried first PL metadata; the present application redirects the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, further ensuring the consistency and integrity of the target volume and source volume data. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] 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, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0031] Figure 1 A flowchart of a snapshot-based fault-tolerance method provided in this application;

[0032] Figure 2 A specific snapshot-based fault-tolerance method flow chart provided in this application;

[0033] Figure 3 A schematic diagram of the structure of a snapshot-based fault-tolerant device provided in this application;

[0034] Figure 4 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] Currently, MEDIA ERROR (storage medium error) sometimes occurs during the write copy process. When HOSTIO accesses the area where the media error occurs, the consistency and integrity of the source volume and target volume data cannot be guaranteed.

[0037] In order to overcome the above problems, the present application provides a snapshot-based fault-tolerant solution that can ensure the consistency and integrity of the source volume and target volume data.

[0038] See also Figure 1 As shown, the embodiment of the present application discloses a snapshot-based fault tolerance method, which includes:

[0039] Step S11: Control the snapshot module to send a metadata read request to the all-flash thin pool.

[0040] In the embodiment of the present application, the snapshot is a completely usable copy of a specified data set in the storage data backup function; the all-flash thin pool is a storage pool that is entirely composed of solid-state storage media and can create thin volumes.

[0041] In the prior art, in the COW snapshot function, the snapshot module sends a 32KB data block to the source volume for reading. If a MEDIA ERROR is found when the 10th LBA (logical block address) is read, and the data corresponding to the logical block address cannot be read, the storage pool module will return the LBA position where the MEDIA ERROR appears on the source volume and the 9 logical block address data read before this position to the snapshot module; and the storage pool module will mark the position of the 10th logical block address as BAD BLOCK, and the snapshot module will mark the position of the 10th logical block address on the target volume as BAD BLOCK, so that it can be ensured that when reading the source volume and the target volume, MEDIA ERROR is returned when reading the 10th logical block address, thereby ensuring data consistency to a certain extent.

[0042] In the embodiment of the present application, it is applied to ROW (Redirect on write) snapshot. ROW snapshot is a technology for redirecting the target volume metadata when HOST IO is written to the volume of the all-flash thin pool, that is, the metadata of the target volume and the metadata of the source volume point to the same data in the data storage area.

[0043] In the embodiment of the present application, the specific process of controlling the snapshot module to send a metadata read request to the all-flash thin pool is: writing the host input and output information sent by the host to the source volume to control the snapshot module to send a metadata read request to the all-flash thin pool. It should be pointed out that in the ROW snapshot, before writing the host input and output information sent by the host to the source volume, a snapshot mapping relationship is created between the source volume and the target volume.

[0044] Step S12: controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the LP metadata is the mapping relationship metadata of the logical block address to the physical block address.

[0045] In an embodiment of the present application, after the all-flash thin pool module receives a metadata read request, the metadata read request is parsed to control the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the specific steps of controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request are: first, the all-flash thin pool is controlled to obtain the target logical block address (LBA) based on the metadata read request, and then the first LP metadata is querying in the source volume based on the target logical block address. It should be pointed out that the target logical block address obtained by controlling the all-flash thin pool based on the metadata read request can specifically be the starting logical block address and the size of the query range (the range size of the overall logical block address). It should be pointed out that the LP metadata is the mapping relationship metadata from LBA to PBA (Physical block address, the physical block address where data is stored on the disk), wherein one logical block address will only correspond to one physical block address, that is, the LP metadata is one-to-one.

[0046] Step S13: If the first LP metadata is found, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; the PL metadata is the mapping relationship metadata from the physical block address to the logical block address.

[0047] In an embodiment of the present application, if the first LP metadata is queried through the target logical address, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata. Specifically, the process of obtaining the second LP metadata and the second PL metadata corresponding to the target volume based on the first LP metadata is: determining the target physical block address based on the first LP metadata, and obtaining the second LP metadata and the second PL metadata corresponding to the target volume based on the target volume physical address. It should be pointed out that the PL metadata is the mapping relationship metadata from the physical block address to the logical block address, wherein, when deduplication is enabled, one physical block address will correspond to multiple logical block addresses, that is, the PL metadata can be one-to-many.

[0048] Step S14: If a storage medium error occurs in the first storage area where the first LP metadata is located, the corresponding first PL metadata is queried in the source volume based on the metadata read request, and the first PL metadata is used to repair the first LP metadata, and then the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume.

[0049] In an embodiment of the present application, if the first LP metadata cannot be queried, that is, a storage medium error occurs in the first storage area where the first LP metadata is located, the first LP metadata is restored by querying the first PL metadata corresponding to the first LP metadata, and then the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume (the damaged source volume LP metadata is repaired, and then the LP / PL metadata of the target volume is redirected to protect data integrity and consistency); specifically, the process of querying the first LP metadata is: obtaining the target logical block address based on the metadata read request, and querying the corresponding first PL metadata in the source volume based on the target logical block address (the source volume PL information corresponding to this LBA can be found by querying the information stored in the source volume PL metadata area).

[0050] In an embodiment of the present application, after the redirection operation is performed on the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, new data can be written in the source volume, and new LP metadata and new PL metadata corresponding to the new data can be generated in the source volume.

[0051] It can be seen that the present application controls the snapshot module to send a metadata read request to the all-flash thin pool; controls the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; LP metadata is the metadata of the mapping relationship from the logical block address to the physical block address; if the first LP metadata is queried, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; PL metadata is the metadata of the mapping relationship from the physical block address to the logical block address; if a storage medium error occurs in the first storage area where the first LP metadata is located, the corresponding first PL metadata is queried in the source volume based on the metadata read request, and the first PL metadata is repaired using the first PL metadata, and then the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume. It can be seen that the present application uses the target logical block address to query the first LP metadata, and when a media error occurs at the location of the first LP metadata, the first PL metadata corresponding to the first LP metadata is queried using the same target logical block address; the present application uses the queried first PL metadata to repair the first LP metadata to ensure the integrity of the source volume data; the present application redirects the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, further ensuring the consistency and integrity of the target volume and source volume data.

[0052] See also Figure 2 As shown, the embodiment of the present application discloses a specific snapshot-based fault tolerance method, which includes:

[0053] Step S21: Control the snapshot module to send a metadata read request to the all-flash thin pool.

[0054] In the embodiment of the present application, the specific process of controlling the snapshot module to send a metadata read request to the all-flash thin pool is: writing the host input and output information sent by the host to the source volume to control the snapshot module to send a metadata read request to the all-flash thin pool. It should be pointed out that in the ROW snapshot, before writing the host input and output information sent by the host to the source volume, a snapshot mapping relationship is created between the source volume and the target volume.

[0055] Step S22: controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the LP metadata is the mapping relationship metadata of the logical block address to the physical block address.

[0056] In an embodiment of the present application, after the all-flash thin pool module receives a metadata read request, the metadata read request is parsed to control the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the specific steps of controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request are: first, the all-flash thin pool is controlled to obtain the target logical block address (LBA) based on the metadata read request, and then the first LP metadata is queryed in the source volume based on the target logical block address. It should be pointed out that the target logical block address that the all-flash thin pool is controlled to obtain based on the metadata read request can specifically be the starting logical block address and the size of the query range (the range size of the overall logical block address).

[0057] Step S23: If the first LP metadata is found, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; the PL metadata is the mapping relationship metadata from the physical block address to the logical block address.

[0058] In an embodiment of the present application, if the first LP metadata is queried through the target logical address, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata. Specifically, the process of obtaining the second LP metadata and the second PL metadata corresponding to the target volume based on the first LP metadata is: determining the target physical block address based on the first LP metadata, and obtaining the second LP metadata and the second PL metadata corresponding to the target volume based on the target volume physical address.

[0059] Step S24: If a storage medium error occurs in the first storage area where the first LP metadata is located, query the corresponding first PL metadata in the source volume based on the metadata read request.

[0060] Among them, the more specific process of step S24 is shown in the aforementioned disclosed embodiment, and will not be described in detail here.

[0061] Step S25: If the first PL metadata is found, the first LP metadata is repaired using the first PL metadata, and a redirection operation is performed on the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume.

[0062] Among them, the more specific process of step S25 is shown in the aforementioned disclosed embodiment, and will not be described in detail here.

[0063] Step S26: If a storage medium error occurs in the second storage area where the first PL metadata is located, a target mark indicating that a storage medium error has occurred is set in the first storage area and the second storage area, and the target mark indicating that a storage medium error has occurred is set in the target storage area corresponding to the first storage area and the second storage area in the target volume.

[0064] In the embodiment of the present application, if it is found that a storage medium error occurs in the second storage area where the first PL metadata is located during the process of querying the first PL metadata through the target logical block address, then at this time, storage medium errors occur in the corresponding storage locations of the first PL metadata and the first LP metadata, and further data reading will also fail due to the failure of metadata reading. The integrity of this part of data has been destroyed. In order to ensure the integrity and consistency of the data to the greatest extent, the corresponding processing of MEDIA ERROR in the COW snapshot is adopted, and a target mark indicating that a storage medium error occurs is set in the first storage area and the second storage area, and the target mark indicating that a storage medium error occurs is set in the target storage area corresponding to the first storage area and the second storage area in the target volume (that is, a BAD BLOCK mark is set at the same position of the source volume and the target volume at the position corresponding to the LBA where the MEDIA ERROR occurs on the source volume).

[0065] In the embodiment of the present application, in the ROW snapshot function, if a MEDIA ERROR occurs in the LP metadata corresponding to a certain LBA of the source volume, the corresponding PL metadata is scanned for recovery, and then the LP / PL metadata of the target volume is redirected; if the PL metadata is also damaged, a BAD BLOCK mark is set at the same position of the source volume and the target volume, thereby ensuring the consistency and integrity of the data to the greatest extent. It can be seen that the present application has pioneered a method for ensuring data consistency and integrity by using metadata repair techniques after a metadata MEDIA ERROR occurs in the ROW snapshot function, thereby ensuring the data consistency and integrity of the source volume and the target volume.

[0066] It can be seen that the present application controls the snapshot module to send a metadata read request to the all-flash thin pool; controls the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the LP metadata is the metadata of the mapping relationship from the logical block address to the physical block address; if the first LP metadata is queried, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; the PL metadata is the metadata of the mapping relationship from the physical block address to the logical block address; if a storage medium error occurs in the first storage area where the first LP metadata is located, the corresponding first PL metadata is queried in the source volume based on the metadata read request; if the first PL metadata is queried, the first LP metadata is repaired using the first PL metadata, and the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume; if a storage medium error occurs in the second storage area where the first PL metadata is located, a target mark indicating that a storage medium error occurs is set in the first storage area and the second storage area, and the target mark indicating that a storage medium error occurs is set in the target storage area corresponding to the first storage area and the second storage area in the target volume. In summary, the present application uses the queried first PL metadata to repair the first LP metadata to ensure the integrity of the source volume data; the present application redirects the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, further ensuring the consistency and integrity of the target volume and source volume data; in addition, when a non-storage medium error occurs in the second storage area where the first PL metadata is located, the present application sets a target mark indicating that a storage medium error has occurred in the first storage area and the second storage area of ​​the source volume, and sets the target mark indicating that a storage medium error has occurred in the target storage area corresponding to the first storage area and the second storage area in the target volume, thereby ensuring the consistency of the target volume and source volume data.

[0067] See also Figure 3 As shown, the embodiment of the present application discloses a snapshot-based fault-tolerant device, including:

[0068] A request sending module 11 is used to control the snapshot module to send a metadata read request to the all-flash thin pool;

[0069] The metadata query module 12 is used to control the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the LP metadata is the mapping relationship metadata of the logical block address to the physical block address;

[0070] The first target volume metadata acquisition module 13 is used to acquire the second LP metadata and the second PL metadata corresponding to the target volume based on the first LP metadata if the first LP metadata is queried; the PL metadata is the mapping relationship metadata from the physical block address to the logical block address;

[0071] The second target volume metadata acquisition module 14 is used to query the corresponding first PL metadata in the source volume based on the metadata read request if a storage medium error occurs in the first storage area where the first LP metadata is located, and use the first PL metadata to repair the first LP metadata, and then redirect the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume.

[0072] It can be seen that the present application controls the snapshot module to send a metadata read request to the all-flash thin pool; controls the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; LP metadata is the metadata of the mapping relationship between the logical block address and the physical block address; if the first LP metadata is queried, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; PL metadata is the metadata of the mapping relationship between the physical block address and the logical block address; if a storage medium error occurs in the first storage area where the first LP metadata is located, the corresponding first PL metadata is queried in the source volume based on the metadata read request, and the first LP metadata is repaired using the first PL metadata, and then the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume. It can be seen that the present application can ensure the integrity of the source volume data by repairing the first LP metadata using the queried first PL metadata; the present application redirects the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, further ensuring the consistency and integrity of the target volume and source volume data.

[0073] In a specific embodiment, the request sending module 11 includes:

[0074] A request sending unit, used for writing the host input and output information sent by the host to the source volume to control the snapshot module to send a metadata read request to the all-flash thin pool;

[0075] In a specific embodiment, the metadata query module 12 includes:

[0076] A first LP metadata query unit, configured to control the all-flash thin pool to obtain a target logical block address based on the metadata read request, and query the first LP metadata in the source volume based on the target logical block address;

[0077] In a specific embodiment, the second target volume metadata acquisition module 14 includes:

[0078] a first PL metadata acquisition unit, configured to acquire the target logical block address based on the metadata read request, and query the corresponding first PL metadata in the source volume based on the target logical block address;

[0079] In a specific embodiment, the first target volume metadata acquisition module 13 includes:

[0080] A first target volume metadata acquisition unit, configured to determine a target physical block address based on the first LP metadata, and acquire second LP metadata and second PL metadata corresponding to the target volume based on the target volume physical address;

[0081] In a specific embodiment, the second target volume metadata acquisition module 14 includes:

[0082] a marking unit configured to, if a storage medium error occurs in the second storage area where the first PL metadata is located, set a target mark indicating that a storage medium error has occurred in the first storage area, and set a target mark indicating that a storage medium error has occurred in a target storage area corresponding to the first storage area in the target volume;

[0083] In a specific embodiment, the snapshot-based fault-tolerant device further includes:

[0084] The metadata generation unit is used to write new data into the source volume and generate new LP metadata and new PL metadata corresponding to the new data in the source volume.

[0085] Furthermore, an embodiment of the present application also provides an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0086] Figure 4 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, an input / output interface 24, a communication interface 25, and a communication bus 26. The memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the following steps:

[0087] Control the snapshot module to send metadata read requests to the all-flash thin pool;

[0088] Controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; the LP metadata is the mapping relationship metadata of the logical block address to the physical block address;

[0089] If the first LP metadata is found, the second LP metadata and the second PL metadata corresponding to the target volume are obtained based on the first LP metadata; the PL metadata is the metadata of the mapping relationship between the physical block address and the logical block address;

[0090] If a storage medium error occurs in the first storage area where the first LP metadata is located, the corresponding first PL metadata is queried in the source volume based on the metadata read request, and the first PL metadata is used to repair the first LP metadata. Then, the repaired first LP metadata and the first PL metadata are redirected to obtain the second LP metadata and the second PL metadata corresponding to the target volume.

[0091] In some specific implementations, the control snapshot module sends a metadata read request to the all-flash thin pool, and specifically the following steps can be implemented:

[0092] The host input and output information sent by the host is written into the source volume to control the snapshot module to send a metadata read request to the all-flash thin pool.

[0093] In some specific implementations, the controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request may specifically implement the following steps:

[0094] The all-flash thin pool is controlled to obtain a target logical block address based on the metadata read request, and to query the first LP metadata in the source volume based on the target logical block address.

[0095] In some specific implementations, the querying of the corresponding first PL metadata in the source volume based on the metadata read request may specifically implement the following steps:

[0096] The target logical block address is obtained based on the metadata read request, and the corresponding first PL metadata is queried in the source volume based on the target logical block address.

[0097] In some specific implementations, the acquiring the second LP metadata and the second PL metadata corresponding to the target volume based on the first LP metadata may specifically implement the following steps:

[0098] A target physical block address is determined based on the first LP metadata, and second LP metadata and second PL metadata corresponding to the target volume are acquired based on the target volume physical address.

[0099] In some specific implementations, after querying the source volume for the corresponding first PL metadata based on the metadata read request, the following steps may be specifically implemented:

[0100] If a storage medium error occurs in the second storage area where the first PL metadata is located, a target mark indicating that a storage medium error has occurred is set in the first storage area and the second storage area, and the target mark indicating that a storage medium error has occurred is set in the target storage area corresponding to the first storage area and the second storage area in the target volume.

[0101] In some specific implementations, after the redirection operation is performed on the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, the following steps may be specifically implemented:

[0102] New data is written into the source volume, and new LP metadata and new PL metadata corresponding to the new data are generated in the source volume.

[0103] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 24 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0104] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The memory 22 can include a random access memory as a running memory and a non-volatile memory for external memory storage purposes. The storage resources thereon include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0105] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 on the source host and the computer program 222. The operating system 221 can be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the snapshot-based fault tolerance method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0106] In this embodiment, the input and output interface 24 may specifically include but is not limited to a USB interface, a hard disk reading interface, a serial interface, a voice input interface, a fingerprint input interface, and the like.

[0107] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned snapshot-based fault-tolerance method disclosed above is implemented.

[0108] For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.

[0109] The computer-readable storage medium mentioned here includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, magnetic disk or optical disk or any other form of storage medium known in the technical field. Wherein, when the computer program is executed by the processor, the aforementioned snapshot-based fault tolerance method is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0110] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the snapshot-based fault tolerance method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0111] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0112] The steps of the algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0113] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants 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, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0114] The above is a detailed introduction to a snapshot-based fault-tolerant method, device, equipment and medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A snapshot-based fault tolerance method, characterized in that: include: Control the snapshot module to send metadata read requests to the all-flash thin pool; Controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; LP metadata is metadata of the mapping relationship between logical block addresses and physical block addresses; If the first LP metadata is found, obtaining the second LP metadata and the second PL metadata corresponding to the target volume based on the first LP metadata; The PL metadata is metadata of the mapping relationship between the physical block address and the logical block address; If a storage medium error occurs in the first storage area where the first LP metadata is located, query the corresponding first PL metadata in the source volume based on the metadata read request, repair the first LP metadata using the first PL metadata, and then redirect the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume; The controlling the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request includes: controlling the all-flash thin pool to obtain a target logical block address based on the metadata read request, and querying the first LP metadata in the source volume based on the target logical block address; The querying the source volume for the corresponding first PL metadata based on the metadata read request includes: acquiring the target logical block address based on the metadata read request, and querying the source volume for the corresponding first PL metadata based on the target logical block address; The acquiring the second LP metadata and the second PL metadata corresponding to the target volume based on the first LP metadata comprises: determining the target physical block address based on the first LP metadata, and acquiring the second LP metadata and the second PL metadata corresponding to the target volume based on the target volume physical address; After querying the corresponding first PL metadata in the source volume based on the metadata read request, the method also includes: if a storage medium error occurs in the second storage area where the first PL metadata is located, a target mark indicating that a storage medium error occurs is set in the first storage area and the second storage area, and the target mark indicating that a storage medium error occurs is set in the target storage area corresponding to the first storage area and the second storage area in the target volume.

2. The snapshot-based fault-tolerance method according to claim 1, characterized in that: The controlling snapshot module sends a metadata read request to the all-flash thin pool, including: The host input and output information sent by the host is written into the source volume to control the snapshot module to send a metadata read request to the all-flash thin pool.

3. The snapshot-based fault tolerance method according to any one of claims 1 to 2, characterized in that: After the redirection operation is performed on the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume, the method further includes: New data is written into the source volume, and new LP metadata and new PL metadata corresponding to the new data are generated in the source volume.

4. A snapshot-based fault-tolerant device, characterized in that: include: A request sending module is used to control the snapshot module to send a metadata read request to the all-flash thin pool; A metadata query module, used to control the all-flash thin pool to query the first LP metadata in the source volume based on the metadata read request; LP metadata is metadata of the mapping relationship between logical block addresses and physical block addresses; A first target volume metadata acquisition module, configured to acquire second LP metadata and second PL metadata corresponding to the target volume based on the first LP metadata if the first LP metadata is found; The PL metadata is metadata of the mapping relationship between the physical block address and the logical block address; a second target volume metadata acquisition module, configured to query the corresponding first PL metadata in the source volume based on the metadata read request if a storage medium error occurs in the first storage area where the first LP metadata is located, repair the first LP metadata using the first PL metadata, and then perform a redirection operation on the repaired first LP metadata and the first PL metadata to obtain the second LP metadata and the second PL metadata corresponding to the target volume; The metadata query module is specifically used to control the all-flash thin pool to obtain a target logical block address based on the metadata read request, and query the first LP metadata in the source volume based on the target logical block address; The second target volume metadata acquisition module is specifically configured to acquire the target logical block address based on the metadata read request, and query the corresponding first PL metadata in the source volume based on the target logical block address; The first target volume metadata acquisition module is specifically configured to determine a target physical block address based on the first LP metadata, and acquire second LP metadata and second PL metadata corresponding to the target volume based on the target volume physical address; The device is also used to set a target mark indicating the occurrence of a storage medium error in the first storage area and the second storage area if a storage medium error occurs in the second storage area where the first PL metadata is located, and to set the target mark indicating the occurrence of a storage medium error in the target storage area corresponding to the first storage area and the second storage area in the target volume.

5. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the snapshot-based fault-tolerant method as claimed in any one of claims 1 to 2 is implemented.

6. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the snapshot-based fault-tolerant method according to any one of claims 1 to 2 is implemented.

Citation Information

Patent Citations

  • Snapshot data processing method, system and storage device

    CN101819543A

  • Metadata processing method and device

    CN110532201A

  • Method, device and equipment for repairing local metadata of full flash memory array

    CN110688257A

  • Simplified volume metadata backup method, device and equipment and readable storage medium

    CN111813603A

  • Disk data protection method and apparatus

    WO2015154425A1