A method, device, equipment and medium for ensuring data consistency of a thin volume

By inserting LPs into thin volumes and marking them with flags, combined with write cache mirroring and disk flushing operations, the data consistency problem when metadata has not been written to disk is solved, ensuring the stability and consistency of the storage system.

CN116301594BActive Publication Date: 2025-11-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310090892.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-09
Publication Date
2025-11-28
Estimated Expiration
2043-02-09

AI Technical Summary

Technical Problem

In the data consistency problem of thin volumes, how can we ensure data consistency and avoid reading dirty data when data has not been written to disk during the metadata writing process?

Method used

By inserting LPs and marking them with flags during metadata write-to-cache operations, and returning all-zero data, combined with write-cache mirroring and disk flushing operations between the two controllers, data consistency is ensured.

Benefits of technology

No need to format the data area on the volume, preventing the reading of dirty data and improving the stability and consistency of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116301594B_ABST
    Figure CN116301594B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and equipment for guaranteeing data consistency of a thin volume and a medium, and relates to the technical field of data storage. The method comprises the following steps: in response to detecting that data to be written is written into a thin volume module, inserting a corresponding LP in metadata corresponding to the data to be written, and flag marking the metadata; in response to receiving a read request for the data to be written corresponding to the metadata and detecting that the data to be written has not been written to a disk, returning all-zero data to the read request according to the flag marking. The application can guarantee the consistency of thin volume data and improve the reliability of a storage system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data storage, in particular to a method and device for ensuring data consistency of a thin volume, equipment and medium. BACKGROUND

[0002] At present, in order to meet the needs of customers and market demand, many current storage systems provide thin volumes, that is, space is allocated at write time, and data is allocated in space in an append write manner. This introduces the concept of metadata, which is data describing data. LP metadata is used to map the LBA (Logical Block Address) issued by the client into PBA (Physics Block Address), that is, the L of LP metadata refers to LBA, and P refers to PBA. When data is inserted, there will be L->P metadata, and when data is read, Pba is read according to Lba first, and then Pba is used to read the disk to obtain the real data.

[0003] For a thin volume, if an I / O (Input / Output) request that has not been written is accessed, the metadata is first searched, and the data is read according to the L->P mapping relationship. If the I / O of the corresponding LBA position has not been written, the corresponding L->P mapping relationship cannot be queried, and all zeros can be returned to the host. However, for an extreme case, when the metadata is being inserted, the metadata may have been inserted into the write cache, but the data has not been written down. At this time, if an L->P mapping relationship is queried, the data queried according to P may be a block of dirty data.

[0004] Therefore, how to ensure data consistency when the metadata is being inserted but the current data has not been really written to the disk is a problem to be solved at present. SUMMARY

[0005] In order to solve at least one problem mentioned in the background, the present application provides a method and device for ensuring data consistency of a thin volume, equipment and medium, which can ensure the consistency of thin volume data and improve the reliability of the storage system.

[0006] The specific technical solutions provided by the embodiments of the present application are as follows:

[0007] In a first aspect, a method for ensuring data consistency of a thin volume is provided, comprising:

[0008] inserting a corresponding LP in a metadata write cache corresponding to the to-be-written data and flag marking the metadata in response to detecting that the to-be-written data write thin volume module;

[0009] returning all-zero data to the read request according to the flag marking in response to receiving a read request for the to-be-written data corresponding to the metadata and detecting that the to-be-written data has not been written to disk.

[0010] Further, the method further comprises:

[0011] performing write cache mirroring between the double controls on the metadata;

[0012] performing disk flushing corresponding to the to-be-written data.

[0013] Further, the method further comprises:

[0014] erasing the flag marking corresponding to the metadata in response to detecting that disk flushing of the to-be-written data is complete.

[0015] Further, the flag marking comprises a fixed marking, and the returning all-zero data to the read request according to the flag marking comprises:

[0016] returning all-zero data to the read request according to the fixed marking.

[0017] Further, if the metadata is written for the first time, the flag marking further comprises a formatting marking, and the method further comprises:

[0018] writing all-zero data to a physical block address corresponding to the metadata according to the formatting marking in response to receiving a write request for the physical block address and detecting that the to-be-written data has not been written to disk, and then re-executing the write data according to the write request.

[0019] Further, the method further comprises:

[0020] performing metadata checking to query whether metadata corresponding to a logical block address has been inserted;

[0021] directly performing write on to-be-written data corresponding to the metadata in response to detecting that the metadata has been inserted;

[0022] The inserting a corresponding LP in a metadata write cache corresponding to the to-be-written data and flag marking the metadata in response to detecting that the to-be-written data write thin volume module comprises:

[0023] In response to detecting that the to-be-written data is written into the thin volume module and metadata corresponding to the logical block address has not been inserted, inserting a corresponding LP when metadata corresponding to the to-be-written data is written into the cache, and flag marking the metadata.

[0024] Further, the method further comprises:

[0025] In response to detecting that the to-be-written data is flushed to the disk, re-returning corresponding to-be-written data in response to a read request for returning all-zero data.

[0026] In a second aspect, a device for ensuring data consistency of a thin volume is provided, and the device comprises:

[0027] A marking module is configured to, in response to detecting that to-be-written data is written into the thin volume module, insert a corresponding LP when metadata corresponding to the to-be-written data is written into the cache, and flag mark the metadata.

[0028] A communication module is configured to, in response to receiving a read request for the to-be-written data corresponding to the metadata and detecting that the to-be-written data has not been flushed to the disk, return all-zero data in response to the read request according to the flag mark.

[0029] In a third aspect, an electronic device is provided, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method for ensuring data consistency of a thin volume when executing the computer program.

[0030] In a fourth aspect, a computer readable storage medium is provided, which stores computer executable instructions for executing the method for ensuring data consistency of a thin volume.

[0031] The embodiments of the present application have the following beneficial effects:

[0032] The method, device, equipment and medium for ensuring data consistency of a thin volume provided by the embodiments of the present application can ensure that the host does not read dirty data due to the characteristics of the thin volume, that is, the content of the corresponding data area will not be accessed as long as no metadata is inserted, and can prevent the host from accessing dirty data on the disk through metadata indexing in the case that metadata insertion is successful but data insertion fails by flag marking when metadata is written into the cache, thereby ensuring data consistency of the storage system and improving stability of the storage system. BRIEF DESCRIPTION OF DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0034] Figure 1 A total flowchart of the method for guaranteeing data consistency of the thin volume provided by the embodiments of the present application is shown.

[0035] Figure 2 A specific flowchart of the method for guaranteeing data consistency of the thin volume provided by the embodiments of the present application is shown.

[0036] Figure 3 A structural schematic diagram of the device for guaranteeing data consistency of the thin volume provided by the embodiments of the present application is shown.

[0037] Figure 4 An exemplary system that can be used to implement various embodiments described herein is shown. DETAILED DESCRIPTION

[0038] In order to make the objects, technical solutions and advantages of the present application clearer, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0039] It should be understood that in the description of the present application, unless the context clearly requires otherwise, the terms "comprise", "comprising", and the like in the specification and claims should be interpreted as including the meaning of "including but not limited to", rather than the exclusive or exhaustive meaning.

[0040] Embodiment one

[0041] The present application provides a method for guaranteeing data consistency of a thin volume, with reference to Figure 1 , comprising:

[0042] S1, in response to detecting that data to be written is written into a thin volume module, inserting a corresponding LP in the metadata write cache corresponding to the data to be written, and flag marking the metadata;

[0043] S2, in response to receiving a read request for the data to be written corresponding to the metadata and detecting that the data to be written has not been written to disk, returning all-zero data to the read request according to the flag marking.

[0044] Specifically, metadata, also known as intermediary data or relay data, is data for describing data, mainly information describing data attributes, used to support functions such as indicating storage location, historical data, resource lookup, file recording, etc. Metadata is a kind of electronic catalog. In order to achieve the purpose of compiling a catalog, the content or characteristics of the data being described and collected must be described and collected, and the purpose of assisting data retrieval must be achieved. Among them, the LP metadata is used to map the LBA (Logical Block Address) issued by the client into PBA (Physics Block Address), that is, the L of the LP metadata refers to LBA, and P refers to PBA. When data insertion is performed, there will be an L->P metadata. When data is read, Pba is read according to Lba first, and then Pba is used to read the disk to obtain the real data. The storage system includes a normal volume and a thin volume. Unlike the normal volume, the thin volume queries metadata, and only when the metadata hits can the access mode of the real valid data be queried. The volume can be formatted without formatting; and the normal volume must complete the formatting of the volume to ensure that dirty data is not read. The thin volume can be considered as not having written data as long as the metadata insertion is not completed, so as to ensure the consistency of the data and prevent dirty data from being read. However, for an extreme case, when the metadata is being inserted, the metadata may have been inserted into the write cache, but the data has not been written down. At this time, if an L->P mapping relationship is queried, the data queried according to P may be a block of dirty data. Therefore, an effective solution is needed to avoid reading dirty data and to achieve data consistency. When the to-be-written data is written to the thin volume module, the LP mapping relationship corresponding to the metadata is inserted, and the metadata is marked with a flag at the same time. The flag mark can include a fixed mark (pinned mark). When the metadata is inserted, but the to-be-written data corresponding to the metadata has not been written to the disk or has failed to be written and a read request for the metadata is received at the same time, the fixed mark (pinned mark) is executed to return all zero data, so as to avoid reading dirty data. By using such a way, due to the characteristics of the thin volume, the data area on the volume does not need to be formatted, that is, as long as the metadata is not inserted, the content of the corresponding data area will not be accessed, so as to ensure that the host will not read dirty data. At the same time, by marking the flag when writing the metadata cache, the situation that the metadata is successfully inserted but the data insertion fails is prevented, so as to index the dirty data on the disk through the metadata, thereby ensuring the data consistency of the storage system and improving the stability of the storage system.

[0045] The following will be further described in combination with Figure 2 The following will be further described in combination with

[0046] In some embodiments, the method further comprises:

[0047] S3, performing inter-dual control write cache mirroring on the metadata;

[0048] S4, performing disk flushing corresponding to the data to be written.

[0049] In some embodiments, the method further comprises:

[0050] S5, in response to detecting that the disk flushing of the data to be written is complete, erasing the flag mark corresponding to the metadata.

[0051] Specifically, when the metadata is written, the corresponding LP is inserted, and the metadata is marked with a flag. When the metadata insertion is complete, but the corresponding data to be written has not been written to the disk, and at the same time a read request for the metadata is received, all zero data is returned due to the flag mark. After the metadata is inserted, inter-dual control mirroring of the write cache is performed on the metadata. After the inter-dual control write cache mirroring of the metadata is complete, disk flushing of the data is directly initiated. After the disk flushing of the data is complete, an unpin operation is initiated to erase the flag mark corresponding to the metadata in the write cache, so that subsequent data reading is normally performed.

[0052] In some embodiments, the flag mark includes a fixed mark, based on which S2 comprises:

[0053] S21, returning all zero data according to the fixed mark for the read request.

[0054] Specifically, the flag mark includes a fixed mark, which is a pinned mark. When the metadata insertion is complete, but the metadata corresponding to the data to be written has not been written to the disk or has failed to write, and at the same time a read request for the metadata is received, all zero data is returned according to the flag mark - fixed mark (pinned mark), so as to avoid reading dirty data.

[0055] In some embodiments, if the metadata is written for the first time, the flag mark further includes a formatting mark, based on which the method further comprises:

[0056] 101, in response to receiving a write request for a physical block address corresponding to the metadata and detecting that the data to be written has not been written to the disk, first writing all zero data to the physical block address corresponding to the metadata according to the formatting mark, and then re-executing the write data according to the write request.

[0057] Specifically, the flag mark further includes a formatting mark, i.e., a needformat mark. For a thin volume, normally, as long as metadata is written, data is definitely inserted successfully, at this time, reading metadata to access corresponding data can not be formatted to ensure consistency. However, for some abnormal scenarios, for example, metadata is inserted successfully, but corresponding to-be-written data has not been landed or is written unsuccessfully, when a metadata reading request is received at this time, all-zero data is returned to the reading request according to the pinned fixed mark; at the same time, the metadata is written for the first time and a writing request for the metadata is received, i.e., data writing occurs, corresponding physical block address (P) is written with all-zero data according to the formatting mark (needformat mark) first, and then the formal data to be written is written, which is equivalent to initializing the data area corresponding to the small piece of metadata to avoid data writing failure again.

[0058] In some embodiments, the method further includes:

[0059] 201, performing metadata checking to query whether metadata corresponding to the logical block address has been inserted;

[0060] 202, in response to detecting that the metadata has been inserted, directly performing writing of to-be-written data corresponding to the metadata;

[0061] Based on this, S1 includes:

[0062] S11, in response to detecting that to-be-written data is written to the thin volume module and metadata corresponding to the logical block address has not been inserted, inserting corresponding LP in metadata write cache corresponding to the to-be-written data, and flag marking the metadata.

[0063] Specifically, before flag marking the metadata, metadata checking can be performed to query whether metadata corresponding to the LBA has been inserted. If metadata corresponding to the LBA has been inserted, directly performing writing of to-be-written data corresponding to the metadata can be performed; if metadata corresponding to the LBA has not been inserted, inserting corresponding LP in metadata write cache corresponding to the to-be-written data and flag marking the metadata can be performed.

[0064] In some embodiments, the method further includes:

[0065] 301, in response to detecting that landing of the to-be-written data is completed, re-returning corresponding to-be-written data to a reading request of returning all-zero data.

[0066] Specifically, after the disk brushing of the to-be-written data is completed, at this time, the metadata insertion is successful, and the to-be-written data corresponding to the metadata is not dirty data. At this time, re-reading can be performed on the read request that returns all-zero data before execution, the real data of the corresponding writing of the metadata is read, and the data is returned, so as to improve the reading efficiency.

[0067] In the embodiment, due to the characteristics of the thin volume, the data area on the volume does not need to be formatted, that is, the content of the corresponding data area will not be accessed as long as there is no metadata insertion, so that the host cannot read dirty data, and the flag mark is marked when the metadata is written, so that the dirty data on the disk is indexed through the metadata in the case that the metadata insertion is successful and the data insertion fails, so as to ensure the data consistency of the storage system and improve the stability of the storage system.

[0068] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps and do not particularly indicate the order or sequence, nor are they used to limit the present application. They are only used to facilitate the description of the method of the present application and cannot be understood as indicating the sequence of the steps. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the realization of the person skilled in the art. When the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist and is not within the protection scope required by the present application.

[0069] Embodiment two

[0070] Corresponding to the above embodiment, the present application also provides a device for ensuring data consistency of a thin volume, referring to Figure 3 , the device comprises a marking module and a communication module.

[0071] The marking module is configured to insert a corresponding LP into the metadata write cache corresponding to the to-be-written data and mark the metadata with a flag in response to detecting that the to-be-written data is written into the thin volume module.

[0072] Further, the device further comprises a processing module configured to perform write cache mirroring between the metadata and perform disk brushing corresponding to the to-be-written data.

[0073] Further, the processing module is further configured to delete the flag mark corresponding to the metadata in response to detecting that the disk brushing of the to-be-written data is completed.

[0074] Further, the flag mark includes a fixed mark, and the communication module is further configured to return all-zero data to the read request according to the fixed mark.

[0075] Further, if the metadata is written for the first time, the flag mark further includes a formatting mark, and the communication module is further configured to, in response to receiving a write request for a physical block address corresponding to the metadata and detecting that the to-be-written data has not been flushed, first write all-zero data to the physical block address corresponding to the metadata according to the formatting mark, and then re-perform writing data according to the write request.

[0076] Further, the processing module is further configured to perform metadata checking, and query whether metadata corresponding to a logical block address has been inserted; and configured to, in response to detecting that the metadata has been inserted, directly perform writing to-be-written data corresponding to the metadata; and the marking module is further configured to, in response to detecting that the to-be-written data is written to the thin volume module and metadata corresponding to a logical block address has not been inserted, insert a corresponding LP in metadata write cache corresponding to the to-be-written data, and mark the metadata with a flag.

[0077] Further, the communication module is further configured to, in response to detecting that flushing of the to-be-written data is completed, re-return corresponding to-be-written data to the read request of returning all-zero data.

[0078] The specific limitations of the device for ensuring data consistency of the thin volume can be referred to the related limitations of the method for ensuring data consistency of the thin volume in the above, and thus will not be described here. Each module in the device for ensuring data consistency of the thin volume can be realized by software, hardware, and a combination thereof, in whole or in part. Each module can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to each module.

[0079] Embodiment Three

[0080] Corresponding to the above embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor can implement the method for ensuring data consistency of the thin volume when executing the program, and the method includes:

[0081] In response to detecting that to-be-written data is written to the thin volume module, inserting a corresponding LP in metadata write cache corresponding to the to-be-written data, and marking the metadata with a flag;

[0082] In response to receiving a read request for the to-be-written data corresponding to the metadata and detecting that the to-be-written data has not been flushed, returning all-zero data to the read request according to the flag tag.

[0083] As Figure 4 shown, in some embodiments, a system can be the above electronic device used in the method of ensuring data consistency for a thin volume in any of the embodiments. In some embodiments, the system can include one or more computer-readable media (e.g., system memory or NVM / storage) having instructions and one or more processors (e.g., processor(s)) coupled with the one or more computer-readable media and configured to execute the instructions to implement modules to perform the actions described in this application.

[0084] For one embodiment, the system control module can include any suitable interface controllers to provide any suitable interface to at least one of the processor(s) and / or any suitable device or component in communication with the system control module.

[0085] The system control module can include a memory controller module to provide an interface to system memory. The memory controller module can be a hardware module, a software module, and / or a firmware module.

[0086] The system memory can be used, for example, to load and store data and / or instructions for the system. For one embodiment, the system memory can include any suitable volatile memory, such as suitable DRAM. In some embodiments, the system memory can include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0087] For one embodiment, the system control module can include one or more input / output (I / O) controllers to provide an interface to the NVM / storage and the communication interface(s).

[0088] The NVM / storage can be used, for example, to store data and / or instructions. The NVM / storage can include any suitable non-volatile memory (e.g., flash memory) and / or can include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0089] The NVM / storage can include a storage resource that is physically part of the device on which the system is installed, or it can be accessed by the device without being a part of the device. For example, the NVM / storage can be accessed over a network via the communication interface(s).

[0090] The communication interface(s) can provide an interface to the system to communicate through one or more networks and / or with any other suitable devices. The system can communicate wirelessly with one or more components of a wireless network in accordance with any of one or more wireless network standards and / or protocols.

[0091] For one embodiment, at least one of the processor(s) can be packaged together with logic of one or more controllers of the system control module (e.g., a memory controller module). For one embodiment, at least one of the processor(s) can be packaged together with logic of one or more controllers of the system control module to form a system in a package (SiP). For one embodiment, at least one of the processor(s) can be integrated on the same die with logic of one or more controllers of the system control module. For one embodiment, at least one of the processor(s) can be integrated on the same die with logic of one or more controllers of the system control module to form a system on a chip (SoC).

[0092] In various embodiments, the system can be, but is not limited to, a server, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.). In various embodiments, the system can have more or less components, and / or different architectures. For example, in some embodiments, the system includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including touch screen displays), non- volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit (ASIC), and speakers.

[0093] It is noted that the present application can be implemented in software and / or in a combination of software and hardware, e.g., application specific integrated circuit (ASIC), general purpose computer or any other similar hardware devices. In one embodiment, the software program of the present application is implemented by the processor to perform predetermined steps or functions. Also, the software program of the present application (including related data structures) can be stored in a computer readable recording medium, e.g., RAM memory, magnetic or optical drive or diskette, and so on. Further, some steps or functions of the present application can be implemented in hardware, e.g., as an electronic circuit that cooperates with the processor to perform various steps or functions.

[0094] In addition, part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be called or provided. Those skilled in the art should understand that the form of computer program instructions in a computer readable medium includes but is not limited to source files, executable files, installation package files, etc. Correspondingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer executes the corresponding compiled program after compiling the instructions, or the computer reads and executes the instructions, or the computer executes the corresponding installed program after reading and installing the instructions. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.

[0095] Communication media includes media that facilitates the transfer of a computer program from one place to another. A storage medium can include one or both of tangible and / or non-tangible media. Tangible media can include computer- readable media such as volatile and non-volatile, removable and non-removable media implemented in a method or technology for storage and / or transmission. Non-tangible media can include communication media such as signals, carriers, and waves that communicate a computer program from one place to another.

[0096] Here, according to one embodiment of the present application includes a device, the device includes a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to run the method and / or technical solutions based on the foregoing according to the plurality of embodiments of the present application.

[0097] Embodiment four

[0098] Corresponding to the above embodiment, the present application also provides a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions are used to execute the method for guaranteeing data consistency of the thin volume.

[0099] In this embodiment, computer readable storage media can include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. For example, computer readable storage media includes, but is not limited to, volatile memory such as random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM); and non-volatile memory such as flash memory, various read-only memories (ROM, PROM, EPROM, EEPROM), magnetic and ferromagnetic / ferroelectric memories (MRAM, FeRAM), and magnetic and optical storage devices (hard disk, tape, CD, DVD); or other now known or future developed memory devices that store computer readable information / data for use by a computer system.

[0100] Although preferred embodiments in the application have been described, those skilled in the art will recognize modifications and variations which fall within the scope of the application. Accordingly, the appended claims are intended to encompass all such modifications and variations as falling within the scope of the application.

[0101] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A method for ensuring data consistency of a thin volume, the method comprising: The method comprises: in response to detecting that the to-be-written data is written into the thin volume module, inserting a corresponding LP in the metadata write cache corresponding to the to-be-written data and flag marking the metadata; in response to receiving a read request for the to-be-written data corresponding to the metadata and detecting that the to-be-written data has not been flushed, returning all-zero data to the read request according to the flag marking; wherein the method further comprises: performing inter-dual control write cache mirroring on the metadata; performing disk flushing corresponding to the to-be-written data; the method further comprises: performing metadata checking to query whether the metadata corresponding to the logical block address has been inserted; in response to detecting that the metadata has been inserted, directly performing writing of the to-be-written data corresponding to the metadata; the response to detecting that the to-be-written data is written into the thin volume module, inserting a corresponding LP in the metadata write cache corresponding to the to-be-written data and flag marking the metadata, comprises: in response to detecting that the to-be-written data is written into the thin volume module and that the metadata corresponding to the logical block address has not been inserted, inserting a corresponding LP in the metadata write cache corresponding to the to-be-written data and flag marking the metadata; the method further comprises: in response to detecting that the disk flushing of the to-be-written data is completed, re-returning the corresponding to-be-written data to the read request of returning all-zero data.

2. The method for ensuring data consistency of a thin volume according to claim 1, wherein, the method further comprises: in response to detecting that the disk flushing of the to-be-written data is completed, erasing the flag marking corresponding to the metadata.

3. The method of claim 1 or 2, wherein, The flag marking comprises a fixed marking, and the returning of all-zero data to the read request according to the flag marking comprises: returning all-zero data to the read request according to the fixed marking.

4. The method for ensuring data consistency of a thin volume according to claim 3, wherein, If the metadata is written for the first time, the flag marking further comprises a formatting marking, and the method further comprises: in response to receiving a write request for the physical block address corresponding to the metadata and detecting that the to-be-written data has not been flushed, first writing all-zero data to the physical block address corresponding to the metadata according to the formatting marking, and then re-performing writing of data according to the write request.

5. An apparatus for ensuring data consistency of a thin volume according to the method of claim 1, characterized by, The apparatus comprises: a marking module, configured to, in response to detecting that the to-be-written data is written into the thin volume module, insert a corresponding LP in the metadata write cache corresponding to the to-be-written data and flag mark the metadata; a communication module, configured to, in response to receiving a read request for the to-be-written data corresponding to the metadata and detecting that the to-be-written data has not been flushed, return all-zero data to the read request according to the flag marking.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method for ensuring data consistency of the thin volume when executing the computer program.

7. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer executable instructions are used to execute the method for ensuring data consistency of the thin volume. The computer executable instructions are used to execute the method for ensuring data consistency of the thin volume.

Citation Information

Patent Citations

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

    CN111813603A

  • Compatibility processing method, system and device for space reclamation of storage system

    WO2021082422A1