Method, device, equipment and medium for detecting consistency of multiple data copies

By obtaining IO requests in the virtual disk and determining the verification value of the data replica, the problem of large overhead and long detection cycle of multi-data replica data consistency detection and rapid query are solved, and data consistency is realized. sex.

CN117812095BActive Publication Date: 2024-12-20BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202311862381.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-12-20
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

In the prior art, the data consistency detection equipment of multi-data replicas is expensive and has a long detection cycle, which leads to the risk of data inconsistency for a long time.

Method used

By obtaining the input and output IO requests of the virtual disk, the verification value in the data copy is determined, and the metadata is updated according to the verification value, real-time detection of the consistency of multiple data copy data is achieved, reducing device overhead and reducing detection cycle.

Benefits of technology

Real-time detection of consistent multi-data replica data is realized, reducing equipment overhead and detection cycle, and improving data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117812095B_ABST
    Figure CN117812095B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for detecting the consistency of data of multiple data copies. The method is applied to a computing device including a hyper-converged architecture, and includes: obtaining an input and output IO request for a virtual disk; determining the check value of the first target data in the corresponding data copy according to the IO request; obtaining a detection result according to the check value of the first target data in all data copies, and updating the metadata of all data copies. The method provided by the present application, when reading and writing data to a virtual disk, realizes real-time detection of whether the data of multiple data copies are consistent according to the check value of the target data corresponding to the IO request, thereby reducing equipment overhead and shortening the detection cycle, and also updates the metadata of the data copy according to the check value, which can realize fast query of the check value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud computing, and specifically to a method, device, equipment and medium for detecting data consistency of multiple data copies. Background Art

[0002] Hyper-convergence architecture is an integrated data center architecture that integrates multiple resources such as computing, storage, network and security. It deeply integrates servers, storage and network devices, provides resource pooling and automated management through software-defined methods, thereby improving the performance, flexibility and scalability of the data center.

[0003] Computing in a hyper-converged architecture refers to computing virtualization, and storage is implemented by distributed storage. Computing virtualization provides virtual machines, and distributed storage provides virtual disks for virtual machines. In order to ensure data security, multiple copies of virtual disk data are usually stored in multiple copies. These multiple copies of data are stored in different hard disks in the hyper-converged cluster. Network anomalies, hard disk damage, silent data damage, and software failures may lead to data inconsistency in multiple copies of data. How to quickly discover them is an important means to ensure data security.

[0004] Currently, consistency checks on data from multiple data copies are mainly performed by reading the data from all copies for verification, which brings huge overhead to the equipment. In addition, due to the high overhead of the equipment, the execution detection cycle needs to be set longer, so the risk of data inconsistency from multiple data copies will last longer. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method, device, equipment and medium for detecting data consistency of multiple data copies, so as to solve the problems of high equipment overhead and long detection cycle in the prior art.

[0006] In order to achieve the above-mentioned object, the first aspect of the present application provides a method for detecting data consistency of multiple data copies, which is applied to a computing device including a hyper-converged architecture, and the method includes:

[0007] Get the input and output IO requests for the virtual disk;

[0008] Determine, according to the IO request, a checksum value of the first target data in the corresponding data copy;

[0009] A detection result is obtained according to the check value of the first target data in all the data copies, and metadata of all the data copies are updated.

[0010] In an optional implementation, determining, according to the IO request, a checksum value of the first target data in the corresponding data copy includes:

[0011] In the case where the IO request is an IO read request, determining a target data subject in the corresponding virtual disk according to first IO information of the IO read request, wherein the virtual disk includes a plurality of data blocks, each data block includes a plurality of data subjects, the target data subject is at least one of the data subjects, and the target data subject is used to store the first target data;

[0012] In an optional implementation, the first IO information includes a read position, and when the IO request is an IO read request, the target data body in the corresponding virtual disk is determined according to the first IO information of the IO read request, including:

[0013] In the case where the IO request is an IO read request, the data block number is determined according to the read position;

[0014] The target data body is determined based on the read position and the data block number.

[0015] In an optional implementation, determining, according to the IO request, a checksum value of the first target data in the corresponding data copy includes:

[0016] When the IO request is an IO write request and the writing is successful, the check value of the first target data in all the data copies is determined according to the second IO information of the IO write request, wherein the second IO information includes the write position and the write data.

[0017] In an optional implementation, the method further includes:

[0018] When the detection result is inconsistent, a data inconsistency event is triggered to execute a processing strategy for the inconsistent data copies.

[0019] In an optional implementation, the metadata includes header metadata and body metadata;

[0020] The header metadata includes the copy number, hole identifier, consistency identifier, the number of main metadata, the consistency check value prefix, the number of data bodies after the consistency check, and the timestamp. The hole identifier indicates whether the space of the data block is actually allocated storage space in the hard disk, the consistency identifier indicates whether the data represented by the data block is consistent among multiple data copies, the number of main metadata is determined according to the capacity space of the virtual disk and the space occupied by a main metadata, and the timestamp indicates the time when the data consistency of the data copy was last checked;

[0021] The subject metadata includes: a valid flag, a consistency flag, an input / output flag, and an urgent-to-repair flag. The valid flag indicates whether the data in the following three fields of the data subject are valid; the consistency flag indicates whether the data represented by the data subject is the same as the corresponding data subject in half or more of the data copies; the input / output flag indicates whether the identification of the metadata of the data subject is determined by the normal IO reading and writing process; and the urgent-to-repair flag indicates whether the data represented by the data subject needs to be repaired.

[0022] In an optional implementation, the method further includes:

[0023] Based on a preset start condition, all data copies are scanned to obtain verification values ​​of the second target data in all data copies;

[0024] The metadata of all data copies are updated according to the check value of the second target data.

[0025] A second aspect of the present application provides a device for detecting consistency of data of multiple data copies, which is applied to a computing device including a hyper-converged architecture, and the device includes:

[0026] An acquisition module is used to obtain input and output IO requests for the virtual disk;

[0027] A determination module, used to determine a check value of the first target data in the corresponding data copy according to the IO request;

[0028] The detection module is used to obtain a detection result according to the check value of the first target data in all the data copies, and update the metadata of all the data copies.

[0029] The third aspect of the present application provides a computing device, including a hyper-converged architecture, and also including a processor and a memory, wherein the memory stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the method for detecting data consistency of multiple data copies according to the first aspect are implemented.

[0030] The fourth aspect of the present application provides a machine-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method for detecting data consistency of multiple data copies according to the first aspect are implemented.

[0031] Through the above technical solution, when reading and writing data on the virtual disk, real-time detection of whether the data of multiple data copies are consistent is achieved based on the verification value of the target data corresponding to the IO request, thereby reducing equipment overhead and shortening the detection cycle. The metadata of the data copy is also updated according to the verification value, which can realize fast query of the verification value.

[0032] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0034] Figure 1 A schematic diagram of a process flow of a method for detecting data consistency of multiple data copies according to an embodiment of the present application is schematically shown;

[0035] Figure 2 A schematic diagram of the structure of metadata of a data copy according to an embodiment of the present application is shown;

[0036] Figure 3 The schematic diagram shows the structure of a device for detecting data consistency of multiple data copies according to an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0038] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0039] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0040] First, the hyper-converged architecture involved in this application is introduced.

[0041] There are two major modules in the hyper-converged architecture, virtualization and distributed storage system. The distributed storage system provides virtual disks for virtual machines created by virtualization. The distributed storage system manages the hard disks in all hosts in the cluster formed by the hyper-converged architecture in a unified manner, and provides virtual disks for virtual machines through storage access services. The storage access service communicates with the virtual machine process through the vhost protocol, obtains the IO (Input Output) request for the virtual disk from the virtual machine, and after processing, writes or reads data to the disk through the TCP / IP (Transmission Control Protocol / Internet Protocol) network to complete the IO request.

[0042] Distributed storage systems use multiple copies of technology to achieve data redundancy. To ensure the reliability of virtual disks, the number of data copies of virtual disks is usually set to 2 or 3. Distributed storage systems in hyper-converged architectures divide and store data copies in hard disks. Although there can be multiple copies of data, from a performance perspective, for read IO requests, data only needs to be read from one data copy, provided that the data between multiple data copies is completely consistent. Otherwise, the inconsistent data read by the application in the virtual machine from different data copies will cause confusion. Exceptions to hard disks, HBA (HostBus Adapter) cards, or RAID (Redundant Arrays of Independent Disks) cards may cause silent data corruption, leading to data inconsistency between data copies. At the same time, server, network, and software exceptions may cause inconsistent data written by multiple data copies. In order to discover data inconsistencies in multiple data copies of a distributed storage system, it is necessary to compare multiple data copies.

[0043] The distributed storage system splits the data and stores it in a virtual disk. For a virtual disk, it is an address space starting from 0. The distributed storage system cuts this address space into fixed sizes so that the data is stored in the form of data blocks. The size of a data block is usually set to 8MB, and each data block is mapped to the hard disk through the mapping algorithm of the distributed storage system.

[0044] See also Figure 1 , Figure 1 The following schematically shows a flow chart of a method for detecting consistency of multiple data copies according to an embodiment of the present application. Figure 1As shown, an embodiment of the present application provides a method for detecting consistency of multi-copy data, which is applied to a computing device including a hyper-converged architecture. The method may include the following steps 110 to 130.

[0045] Step 110: Obtain an IO request for the virtual disk;

[0046] Step 120: Determine the checksum value of the first target data in the corresponding data copy according to the IO request;

[0047] Step 130: Obtain a detection result based on the check value of the first target data in all data copies, and update the metadata of all data copies.

[0048] In the embodiment of the present application, the IO request is used to read and write data in the data copy stored in the virtual disk, so the IO request needs to be obtained. The embodiment of the present application detects data consistency when reading and writing data, thereby improving the real-time performance of the detection.

[0049] There is a corresponding relationship between the IO request and the data to be read or written, so the first target data in the data copy corresponding to the IO request can be determined according to the IO request; further, the check value of the first target data is obtained according to the first target data. The check value can be calculated using a check value algorithm, such as MD5 (Message-Digest Algorithm) and DES (Data Encryption Standard), which is not limited in the embodiments of the present application.

[0050] Then, the check values ​​of the first target data in all the data copies are compared to obtain the test result. In schematic form, if the check values ​​of the first target data in all the data copies are the same, a data consistency test result is obtained; if the check values ​​of the first target data in all the data copies are different, a data inconsistency test result is obtained.

[0051] At the same time, the metadata of all data copies can be updated according to the checksum of the first target data in all data copies. Metadata, also known as intermediary data or relay data, is data about data, mainly information describing data properties, used to support functions such as indicating storage location, historical data, resource search, and file records.

[0052] In order to quickly detect the data consistency of multiple data copies, the management method used when comparing data is to design metadata based on data blocks, and cut each data block into smaller data items. A data item usually represents 4KB of data. Therefore, each data block can include a group of up to 2048 data items. Therefore, additional memory space is required to store these metadata.

[0053] Please also read Figure 2 , Figure 2 The schematic diagram of the structure of metadata of a data copy according to an embodiment of the present application is shown schematically. Figure 2 As shown, in this embodiment of the present application, the metadata of a data copy includes two parts, header metadata and body metadata. The header metadata occupies 10 bytes of space, and one body metadata occupies 4 bits of space. The number of body metadata is determined according to the size of the data block set by the virtual disk. In this embodiment of the present application, one data block represents 8MB of data, and one data body represents 4KB of data. Therefore, the number of data subjects included in one data block is at most 2048.

[0054] For header metadata, include:

[0055] The replica ID occupies 3 digits, that is, it can represent up to 8 data replicas, that is, in the embodiment of the present application, 8 data replicas can be compared for consistency at the same time;

[0056] Hole Flag (HF), occupies 1 bit, indicating whether the space of the data block is actually allocated storage space in the hard disk. Schematically, 1 indicates no hole, and 0 indicates a hole. For a data block with a hole, since no storage space is actually allocated, there will be no problem of inconsistent data copies;

[0057] The consistency flag (CF) occupies 1 bit and indicates whether the 8MB of data represented by the data block is consistent among multiple data copies. Schematically, if any data subject in the data block is inconsistent, the consistency flag is 1, indicating inconsistency;

[0058] Item Count (IC), occupies 11 bits, indicating the number of data entities in the data block, and can represent up to 2 11 , that is, 2048 data subjects;

[0059] Consistency Check Prefix (CCP), occupies 2 bytes. During the full disk data scan, the prefix of the complete metadata of the data block, such as the first 3 bits, is recorded to speed up the data comparison process.

[0060] The number of data subjects after consistency check (Consistency Check Item Sum, CCIS), the number of inconsistent data items after consistency check, occupies 2 bytes;

[0061] Timestamp: indicates the time when the data copy consistency was last checked, and occupies 4 bytes.

[0062] For subject metadata, include:

[0063] Valid Flag (VF), occupies 1 bit, indicating whether the data of the following three fields of the data body is valid. Schematically, 1 indicates that the data of the following three fields of the data body is valid, and 0 indicates that the data of the following three fields of the data body is invalid;

[0064] The consistency flag (CF) occupies 1 bit and indicates whether the data represented by the data subject is the same as the corresponding data subject in half or more of the data copies. Schematically, 1 indicates the same and 0 indicates different.

[0065] Input Output (IO), occupies 1 bit, indicating whether the metadata identification of the data subject is determined by the normal IO reading and writing process. Schematically, 1 indicates that the metadata identification of the data subject is determined by the normal IO reading and writing process, rather than by an additional asynchronous scan, and 0 indicates that the metadata identification of the data subject is not determined by the normal IO reading and writing process;

[0066] The Urgency Flag (UF) occupies 1 bit. Schematically, a value of 1 indicates that during normal IO reading and writing, the data represented by the data subject fails to be written and is inconsistent with the data of other data copies / data blocks / data subjects, and needs to be repaired.

[0067] In the embodiment of the present application, the metadata space occupied by a data block includes 10 bytes for the header metadata and 4*2048=1034 bytes for the 2048 main body metadata, for a total of 1034 bytes. For 1TB of data, if the requirement is to generate two copies of the data, the additional memory space required to store metadata in the virtual disk is (1TB÷8MB)×1034Byte×2=258.5MB. Furthermore, the checksum value can be quickly queried based on the metadata of the data copy.

[0068] Therefore, when reading and writing data on a virtual disk, the embodiment of the present application implements real-time detection of whether the data of multiple data copies are consistent based on the verification value of the target data corresponding to the IO request, thereby reducing device overhead and shortening the detection cycle. It also updates the metadata of the data copy based on the verification value, and can realize fast query of the verification value.

[0069] It is understandable that IO requests include IO read requests and IO write requests, and the processing logic corresponding to the two different requests is also different, which will be introduced below.

[0070] In an optional implementation, step 120 includes:

[0071] In the case where the IO request is an IO read request, determining a target data subject in the corresponding virtual disk according to first IO information of the IO read request, wherein the virtual disk includes a plurality of data blocks, each data block includes a plurality of data subjects, the target data subject is at least one of the data subjects, and the target data subject is used to store the first target data;

[0072] According to the acquired data of the target data subject, a check value of the first target data in the corresponding data copy is determined.

[0073] Specifically, since the IO read request only needs to read data from one of all the data copies, the target data subject in the virtual disk corresponding to the read request can be determined according to the first IO information of the IO read request. It is understandable that the data of one of the data copies can be obtained from all the data copies, or the data of one of the data copies can be obtained randomly from all the data copies, which is not limited in the embodiments of the present application.

[0074] It should be noted that the virtual disk includes multiple data blocks, each data block includes multiple data bodies, and the target data body is at least one of the data bodies, and the target data body is used to store the first target data. Therefore, when multiple data copies are stored in the virtual disk, the data of different data copies are stored in different data blocks and data bodies. The number of target data bodies can be multiple, and the embodiments of the present application do not limit this.

[0075] The virtual disk can return data corresponding to the IO read request based on the IO read request, and then, according to the acquired data of the target data body, the check value of the first target data in the corresponding data copy can be determined.

[0076] In addition, in order to obtain the checksum value of the first target data of all data copies, a comparison request can be sent to the hard disks corresponding to other data copies through the storage access service. After receiving the response to the comparison request, the storage access service forwards the data obtained in the response, that is, the checksum value of the first target data of other data copies, to the data collection module, and then the checksum value of the first target data of all data copies can be used to obtain the verification result.

[0077] In an optional implementation manner, the first IO information includes a read position and a first data size, and when the IO request is an IO read request, determining the target data subject in the corresponding virtual disk according to the first IO information of the IO read request includes:

[0078] In the case where the IO request is an IO read request, the data block number is determined according to the read position;

[0079] The target data body is determined based on the read position and the data block number.

[0080] It is understandable that the first IO information of the read request may include a read position, that is, the position of the data to be read. Then, the target data body where the data corresponding to the IO request is located in the virtual disk can be determined through the first IO information.

[0081] First, divide the read position by the preset data block size and round down to get the target data block number, refer to formula (1):

[0082] block_id=[offset÷block_size]; (1)

[0083] Where block_id represents the target data block number, offset represents the read position, block_size represents the preset data block size, and [x] represents the maximum integer not exceeding x;

[0084] Then, the data block position can be obtained by subtracting the product of the target data block number and the preset data block size from the read position, referring to formula (2):

[0085] block_offset=offset-(block_id×block_size); (2)

[0086] Wherein, block_offset indicates the target data block position, offset indicates the read position, block_id indicates the target data block number, and block_size indicates the preset data block size;

[0087] Finally, the target data block position is divided by the preset data body size and rounded down to get the target data body number, i.e. the target data body, refer to formula (3):

[0088] item_id=[block_offset÷item_size]; (3)

[0089] In the formula, item_id represents the target data body number, block_offset represents the data block position, item_size represents the preset data body size, and [x] represents the maximum integer not exceeding x.

[0090] Therefore, in the embodiment of the present application, the target data body in the corresponding virtual disk can be determined according to the read position in the first IO information of the IO read request, thereby realizing rapid determination of the target data body.

[0091] It should be noted that when the data processing volume corresponding to the IO read request is large, or when the access data is at the edge, the IO request may need to be split for ease of processing.

[0092] If the preset conditions are met, it means that the data corresponding to the IO read request crosses the boundary of the data block. Therefore, in order to improve the accuracy and speed of data processing, the IO read request needs to be split. The preset conditions meet formula (4):

[0093] offset+size>(block_id+1)×block_size (4)

[0094] In the formula, offset indicates the read position, size indicates the data size, block_id indicates the data block number, and block_size indicates the preset data block size. Since data blocks are numbered starting from 0, 1 needs to be added here.

[0095] For example, if an IO read request is divided into two, the first IO read request ends at the end position of a data block, and the second IO read request starts at the start position of the next data block, referring to formula (5):

[0096] block_id2=block_id+1; block_offset2=0; item_id2=0 (5)

[0097] In the formula, block_id2 represents the data block number of the second IO read request, block_id represents the data block number of the first IO read request, block_offset2 represents the data block position of the second IO read request, and item_id2 represents the data body number of the second IO read request.

[0098] As a result, IO read requests are segmented, improving the accuracy and speed of data processing.

[0099] In an optional implementation, step 120 includes:

[0100] When the IO request is an IO write request and the writing is successful, the check value of the first target data in all the data copies is determined according to the second IO information of the IO write request, wherein the second IO information includes the write position and the write data.

[0101] Specifically, since the IO write request needs to write data to all data copies, the virtual disk will return a write success message after the data is written successfully. Therefore, it is only necessary to determine the check value of the first target data in all data copies corresponding to the IO write request based on the second IO information of the IO write request when the data is written successfully. The second IO information includes the write position and the write data, wherein the write data represents the data that the IO write request wants to write to the virtual disk. The specific logic is similar to the IO read request mentioned above and will not be repeated here.

[0102] Thus, for an IO write request, the checksum value of the first target data in all data copies can be directly determined.

[0103] In an optional implementation, the method further includes:

[0104] When the detection result is inconsistent, a data inconsistency event is triggered to execute a processing strategy for the inconsistent data copies.

[0105] Specifically, when the detection result is inconsistent, the data of the data copy needs to be processed, so a data inconsistency event can be triggered to execute a processing strategy for the inconsistent data copy.

[0106] In an illustrative manner, the processing strategy may include: the distributed storage system automatically repairs the inconsistent data copies and outputs prompt information. Assuming that among the three data copies, the data of one data copy A1 is different from the data of the other two data copies A2 and A3, the data of the data copies A2 and A3 can be used to repair the data copy A1. Prompt information can also be output to remind the operator to manually check the inconsistent data copies.

[0107] In an optional implementation, the method further includes:

[0108] Based on a preset start condition, all data copies are scanned to obtain verification values ​​of the second target data in all data copies;

[0109] The metadata of all data copies are updated according to the check value of the second target data.

[0110] It is understandable that the method for detecting the consistency of data of multiple data copies adopted in the embodiment of the present application is to compare in real time with the IO request, thereby improving the real-time performance of the data consistency detection. However, the IO request does not necessarily read and write all the data in the data copy. Therefore, in the embodiment of the present application, the asynchronous scan can also be started based on the preset start condition to ensure the integrity of the data consistency detection. Schematically, the preset start condition can be when the computing device business request is at a low point or when the operator manually triggers it, and the scanning frequency of the asynchronous scan should not be too high, and is usually performed at a preset time length, such as a week or a month. It is understandable that in order to avoid metadata confusion caused by the two verification methods, the two verification methods need to run mutually exclusive, that is, during the asynchronous verification process, the aforementioned real-time verification method is temporarily ineffective.

[0111] Specifically, the data analysis module will trigger the data collection module to construct a comparison request one by one starting from the first data block. The data collection module forwards the comparison request to the storage access service, and then sends it to the hard disk where all data copies are located, calculates the checksum value of the second target data, and after aggregating and packaging it in data blocks, responds to the storage access service, and then forwards it to the data collection module and the data analysis module. The second target data can be data other than the first target data, or it can be all data including the first target data.

[0112] Thus, the check values ​​of the second target data in all the data copies are obtained, and the metadata of the data copies are updated by comparing these check values.

[0113] In the embodiment of the present application, an asynchronous scanning method is also used to ensure the integrity of data consistency detection. The method provided in the embodiment of the present application is based on the granularity of virtual disks, and a policy can be turned on, off or configured for a virtual hard disk separately. Since there are a large number of virtual machines running in a hyper-converged system, not all data are of the same importance. Therefore, it is possible to flexibly control the virtual disk by setting a separate method such as turning off verification, turning on real-time verification, turning on asynchronous verification, etc.

[0114] Corresponding to the above-mentioned embodiment, please refer to Figure 3 , Figure 3 The structure block diagram of a device for detecting consistency of multiple data copies according to an embodiment of the present application is schematically shown. Figure 3As shown, an embodiment of the present application provides a device 300 for detecting data consistency of multiple data copies, which is applied to a computing device including a hyper-converged architecture, and the device may include:

[0115] The acquisition module 310 is used to acquire an input / output IO request for a virtual disk;

[0116] A determination module 320, configured to determine, according to the IO request, a check value of the first target data in the corresponding data copy;

[0117] The detection module 330 is used to obtain a detection result according to the check value of the first target data in all the data copies, and update the metadata of all the data copies.

[0118] The device for detecting data consistency of multiple data copies provided in the embodiment of the present application can implement each process of the method for detecting data consistency of multiple data copies in the method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0119] An embodiment of the present application also provides a computing device, which may include a processor and a memory, wherein a program or instruction is stored in the memory. When the program or instruction is executed by the processor, each process of the embodiment of the method for detecting data consistency of multiple data copies described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0120] An embodiment of the present application also provides a machine-readable storage medium, which stores instructions for enabling a machine to execute the above-mentioned method for detecting data consistency of multiple data copies, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0125] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0126] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0127] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0128] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0129] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for detecting consistency of multiple data copies, characterized in that: Applied to a computing device including a hyper-converged architecture, the method includes: Get the input and output IO request for the virtual disk; Determine, according to the IO request, a check value of the first target data in the corresponding data copy; Obtaining a detection result according to the check value of the first target data in all the data copies, and updating metadata of all the data copies; The step of determining the checksum value of the first target data in the corresponding data copy according to the IO request includes: In the case where the IO request is an IO read request, determining a target data subject in the corresponding virtual disk according to first IO information of the IO read request, wherein the virtual disk includes a plurality of data blocks, each data block includes a plurality of data subjects, the target data subject is at least one of the data subjects, and the target data subject is used to store the first target data; Determine, based on the acquired data of the target data subject, a check value of the first target data in the corresponding data copy; Alternatively, determining the check value of the first target data in the corresponding data copy according to the IO request includes: In the case that the IO request is an IO write request and the writing is successful, the check value of the first target data in all data copies is determined according to the second IO information of the IO write request, wherein the second IO information includes the write position and the write data.

2. The method according to claim 1, characterized in that The first IO information includes a read position, and when the IO request is an IO read request, determining the target data subject in the corresponding virtual disk according to the first IO information of the IO read request includes: In the case where the IO request is an IO read request, determining a data block number according to the read position; The target data body is determined according to the read position and the data block number.

3. The method according to claim 1, characterized in that The method further comprises: When the detection result is inconsistent, a data inconsistency event is triggered to execute a processing strategy for the inconsistent data copies.

4. The method according to claim 1, characterized in that: The metadata includes header metadata and body metadata; The header metadata includes a copy number, a hole identifier, a consistency identifier, a body metadata quantity, a consistency check value prefix, a data body quantity after consistency check, and a timestamp, wherein the hole identifier indicates whether the space of the data block is actually allocated with storage space in the hard disk, the consistency identifier indicates whether the data represented by the data block is consistent among multiple data copies, the quantity of the body metadata is determined according to the capacity space of the virtual disk and the occupied space of one body metadata, and the timestamp indicates the time when the data consistency of the data copy was last detected; The subject metadata includes: a valid flag, a consistency flag, an input and output, and an urgent to-be-repaired flag, wherein the valid flag indicates whether the data in the following three fields of the data subject are valid, the consistency flag indicates whether the data represented by the data subject is the same as the corresponding data subject in half or more of the data copies, the input and output indicates whether the identification of the metadata of the data subject is determined by a normal IO reading and writing process, and the urgent to-be-repaired flag indicates whether the data represented by the data subject needs to be repaired.

5. The method according to claim 1, characterized in that The method further comprises: Based on a preset start condition, all data copies are scanned to obtain verification values ​​of the second target data in all the data copies; The metadata of all the data copies are updated according to the check value of the second target data.

6. A device for detecting consistency of multiple data copies, characterized in that: Applied to a computing device including a hyper-converged architecture, the device includes: An acquisition module is used to obtain input and output IO requests for the virtual disk; A determination module, configured to determine, according to the IO request, a check value of the first target data in the corresponding data copy; A detection module, configured to obtain a detection result according to the check value of the first target data in all the data copies, and update the metadata of all the data copies; The step of determining the checksum value of the first target data in the corresponding data copy according to the IO request includes: In the case where the IO request is an IO read request, determining a target data subject in the corresponding virtual disk according to first IO information of the IO read request, wherein the virtual disk includes a plurality of data blocks, each data block includes a plurality of data subjects, the target data subject is at least one of the data subjects, and the target data subject is used to store the first target data; Determine, based on the acquired data of the target data subject, a check value of the first target data in the corresponding data copy; Alternatively, determining the check value of the first target data in the corresponding data copy according to the IO request includes: In the case that the IO request is an IO write request and the writing is successful, the check value of the first target data in all data copies is determined according to the second IO information of the IO write request, wherein the second IO information includes the write position and the write data.

7. A computing device, characterized in that It includes a hyper-converged architecture and also includes a processor and a memory, wherein the memory stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for detecting data consistency of multiple data copies according to any one of claims 1-5 are implemented.

8. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method for detecting data consistency of multiple data copies according to any one of claims 1-5 are implemented.

Citation Information

Patent Citations

  • Disk management method and system, electronic device and storage medium

    CN109634523A

  • Archived data storage method, system, device and medium

    CN113282238A

  • Data processing method and device and computer readable storage medium

    CN113296685A

  • Data consistency verification method and device, electronic equipment and readable storage medium

    CN113391767A

  • Method and device for reading and writing virtual hard disk, medium and electronic equipment

    CN116483284A