Data consistency verification method, device and equipment of distributed storage system

文档序号:1860763 发布日期:2021-11-19 浏览:4次 中文

阅读说明:本技术 一种分布式存储系统的数据一致性校验方法、装置及设备 (Data consistency verification method, device and equipment of distributed storage system ) 是由 孙润宇 李彦博 孟祥瑞 于 2021-07-09 设计创作,主要内容包括:本申请公开了一种分布式存储系统的数据一致性校验方法,该方法通过设置一致性校验的配置信息,能够确定每次一致性校验的开始时间和结束时间,实现一致性校验过程的全自动化,而且,在达到本次一致性校验的结束时间时,即便没有校验完存储池的全部对象也可以停止本次一致性校验,并记录一致性校验的进度信息,下一次一致性校验时可以根据进度信息从本次校验位置继续进行一致性校验,显著提升了一致性校验过程的灵活性。此外,本申请还提供了一种分布式存储系统的数据一致性校验装置、设备及可读存储介质,其技术效果与上述方法的技术效果相对应。(The method can determine the starting time and the ending time of each consistency check by setting the configuration information of the consistency check, realizes the full automation of the consistency check process, and can stop the consistency check even if all objects in a storage pool are not checked when the ending time of the consistency check is reached, and record the progress information of the consistency check, and can continue the consistency check from the check position according to the progress information during the next consistency check, thereby obviously improving the flexibility of the consistency check process. In addition, the application also provides a data consistency checking device, equipment and a readable storage medium of the distributed storage system, and the technical effect of the device corresponds to that of the method.)

1. A data consistency checking method of a distributed storage system is characterized by comprising the following steps:

reading configuration information of consistency verification, and determining the starting time and the ending time of the next consistency verification according to the configuration information;

when the starting time is reached, reading progress information of consistency check, and carrying out consistency check on the object of the target storage pool according to the progress information;

and when the end time is reached, stopping consistency check and updating the progress information.

2. The method of claim 1, wherein before the reading the progress information of the consistency check and performing the consistency check on the object in the target storage pool according to the progress information, the method further comprises:

and determining a target storage pool to be subjected to consistency check according to the storage pool identification information in the configuration information.

3. The method as claimed in claim 2, wherein said reading the progress information of consistency check when the starting time is reached, and performing consistency check on the object in the target storage pool according to the progress information comprises:

when the starting time is reached, reading progress information of consistency check, awakening a consistency check thread of the target storage pool, and calling the consistency check thread to carry out consistency check on the object of the target storage pool according to the progress information;

correspondingly, when the end time is reached, stopping consistency check and updating the progress information, including:

and when the ending time is reached, stopping consistency check, sleeping the consistency check thread, and updating the progress information.

4. The method of claim 1, wherein said stopping consistency checking and updating the progress information upon reaching the end time comprises:

and when the end time is reached, waiting for the target object which is currently subjected to consistency verification to finish the consistency verification, stopping the consistency verification, and updating the progress information.

5. The method of claim 4, wherein said updating said progress information comprises:

and updating the progress information according to the target object, wherein the progress information comprises the identification information of the last object which completes the consistency check.

6. The method of claim 1, wherein after said determining a start time and an end time for a next consistency check based on said configuration information, further comprising:

setting and starting a start timer according to the start time, and monitoring whether the start time is reached through the start timer;

correspondingly, when the starting time is reached, the method further comprises the following steps:

and setting and starting an ending timer according to the ending time, and monitoring whether the ending time is reached or not through the ending timer.

7. The method of any of claims 1 to 6, wherein during the process of performing consistency check on the object in the target storage pool according to the progress information, the method further comprises:

and if all the objects in the target storage pool complete consistency check, resetting the progress information, and performing consistency check on the objects in the target storage pool again according to the reset progress information.

8. A data consistency verification apparatus for a distributed storage system, comprising:

the time determining module is used for reading the configuration information of the consistency check and determining the starting time and the ending time of the next consistency check according to the configuration information;

the checking module is used for reading the progress information of consistency checking when the starting time is reached, and carrying out consistency checking on the object of the target storage pool according to the progress information;

and the progress updating module is used for stopping consistency check and updating the progress information when the end time is reached.

9. A data consistency verification apparatus for a distributed storage system, comprising:

a memory: for storing a computer program;

a processor: for executing the computer program to implement the data consistency checking method of the distributed storage system according to any one of claims 1 to 7.

10. A readable storage medium, having stored thereon a computer program for implementing a method for data consistency checking of a distributed storage system according to any one of claims 1 to 7 when being executed by a processor.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for verifying data consistency in a distributed storage system.

Background

In the distributed storage system, stored data is cut according to a fixed size, the piece of data with the fixed size is called an object, a PG (place Group) is a collection of a plurality of objects and is a logical concept, the PG and the objects are corresponding through a consistent hash algorithm, and one PG corresponds to the plurality of objects. Each PG corresponds to an OSD (Object-based Storage Device) through a data distribution algorithm, one PG corresponds to a plurality of OSDs, an OSD can be simply understood as a physical disk, and a plurality of PGs can be located on one OSD.

In a storage cluster, inconsistency of data in the storage cluster may occur due to hardware failure or software defect, and in order to detect and identify the inconsistency, it is a common practice to perform data consistency check on objects in the storage cluster. At present, data consistency check consumes certain system resources and once the data consistency check is started, all the check is completed and the data consistency check can not be finished, and the data consistency check function is greatly limited.

In summary, the current data consistency verification scheme cannot be suspended and has poor flexibility, and how to overcome the above defects is a problem to be solved by those skilled in the art.

Disclosure of Invention

The application aims to provide a data consistency verification method, a device, equipment and a readable storage medium of a distributed storage system, which are used for solving the problems that the existing data consistency verification scheme cannot be suspended and is poor in flexibility. The specific scheme is as follows:

in a first aspect, the present application provides a data consistency checking method for a distributed storage system, including:

reading configuration information of consistency verification, and determining the starting time and the ending time of the next consistency verification according to the configuration information;

when the starting time is reached, reading progress information of consistency check, and carrying out consistency check on the object of the target storage pool according to the progress information;

and when the end time is reached, stopping consistency check and updating the progress information.

Optionally, before the reading of the progress information of consistency check and the consistency check of the object in the target storage pool according to the progress information, the method further includes:

and determining a target storage pool to be subjected to consistency check according to the storage pool identification information in the configuration information.

Optionally, the reading the progress information of the consistency check when the starting time is reached, and performing the consistency check on the object in the target storage pool according to the progress information includes:

when the starting time is reached, reading progress information of consistency check, awakening a consistency check thread of the target storage pool, and calling the consistency check thread to carry out consistency check on the object of the target storage pool according to the progress information;

correspondingly, when the end time is reached, stopping consistency check and updating the progress information, including:

and when the ending time is reached, stopping consistency check, sleeping the consistency check thread, and updating the progress information.

Optionally, when the end time is reached, stopping consistency check, and updating the progress information includes:

and when the end time is reached, waiting for the target object which is currently subjected to consistency verification to finish the consistency verification, stopping the consistency verification, and updating the progress information.

Optionally, the updating the progress information includes:

and updating the progress information according to the target object, wherein the progress information comprises the identification information of the last object which completes the consistency check.

Optionally, after determining the starting time and the ending time of the next consistency check according to the configuration information, the method further includes:

setting and starting a start timer according to the start time, and monitoring whether the start time is reached through the start timer;

correspondingly, when the starting time is reached, the method further comprises the following steps:

and setting and starting an ending timer according to the ending time, and monitoring whether the ending time is reached or not through the ending timer.

Optionally, in the process of performing consistency check on the object in the target storage pool according to the progress information, the method further includes:

and if all the objects in the target storage pool complete consistency check, resetting the progress information, and performing consistency check on the objects in the target storage pool again according to the reset progress information.

In a second aspect, the present application provides a data consistency checking apparatus for a distributed storage system, including:

the time determining module is used for reading the configuration information of the consistency check and determining the starting time and the ending time of the next consistency check according to the configuration information;

the checking module is used for reading the progress information of consistency checking when the starting time is reached, and carrying out consistency checking on the object of the target storage pool according to the progress information;

and the progress updating module is used for stopping consistency check and updating the progress information when the end time is reached.

In a third aspect, the present application provides a data consistency checking device for a distributed storage system, including:

a memory: for storing a computer program;

a processor: for executing the computer program to implement the data consistency check method of the distributed storage system as described above.

In a fourth aspect, the present application provides a readable storage medium, on which a computer program is stored, the computer program being, when executed by a processor, configured to implement the data consistency checking method of the distributed storage system as described above.

The application provides a data consistency checking method of a distributed storage system, which comprises the following steps: reading the configuration information of consistency check, and determining the starting time and the ending time of the next consistency check according to the configuration information; when the starting time is reached, reading progress information of consistency check, and carrying out consistency check on the object of the target storage pool according to the progress information; and when the end time is reached, stopping consistency check and updating the progress information. Therefore, the method can determine the starting time and the ending time of each consistency check by setting the configuration information of the consistency check, realizes the full automation of the consistency check process, and can stop the consistency check even if all objects in the storage pool are not checked when the ending time of the consistency check is reached, and record the progress information of the consistency check, so that the consistency check can be continuously carried out from the check position according to the progress information during the next consistency check, and the flexibility of the consistency check process is obviously improved. The consistency check can be carried out when the system resources are sufficient or routine maintenance is carried out at night, the influence of the data consistency check on the performance of the storage system is reduced, the reliability of the system is ensured, and the product competitiveness is improved.

In addition, the application also provides a data consistency checking device, equipment and a readable storage medium of the distributed storage system, and the technical effect of the device corresponds to that of the method, and the details are not repeated here.

Drawings

For a clearer explanation of the embodiments or technical solutions of the prior art of the present application, the drawings needed for the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

Fig. 1 is a flowchart of a first embodiment of a data consistency checking method of a distributed storage system provided in the present application;

fig. 2 is a flowchart of a second embodiment of a data consistency checking method of a distributed storage system provided in the present application;

FIG. 3 is a functional block diagram of an embodiment of a data consistency check apparatus of a distributed storage system provided in the present application;

fig. 4 is a schematic structural diagram of an embodiment of a data consistency check device of a distributed storage system provided in the present application.

Detailed Description

The core of the application is to provide a data consistency verification method, a data consistency verification device, data consistency verification equipment and a readable storage medium of a distributed storage system, the full automation of a consistency verification process is realized, progress information of consistency verification is allowed to be paused and recorded in the middle, consistency verification can be continuously carried out from the current verification position according to the progress information during the next consistency verification, and the flexibility of the consistency verification process is obviously improved.

In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

Referring to fig. 1, a first embodiment of a data consistency checking method for a distributed storage system provided in the present application is described below, where the first embodiment includes:

s11, reading the configuration information of the consistency check, and determining the starting time and the ending time of the next consistency check according to the configuration information;

s12, when the starting time is reached, reading the progress information of consistency check, and carrying out consistency check on the object of the target storage pool according to the progress information;

and S13, stopping consistency check when the end time is reached, and updating the progress information.

Specifically, the consistency check process of the storage pool is configured in advance, and the configuration content includes, but is not limited to, a time period of the consistency check, including the start time and the end time. For example, the data consistency check can be performed in a certain time period of every day, every week or every month in a customized manner, the time period is automatically suspended after the time period is ended, and the consistency check is continued from the last ending position in the next time period, so that the flexibility of the data consistency check is improved. In practical applications, the consistency check time periods of a plurality of storage pools may be configured, and for convenience of description, the consistency check process of a single storage pool is described as an example below.

In order to facilitate the subsequent consistency check process to continue the consistency check from the end position of the previous consistency check process, in this embodiment, after each consistency check is finished, the progress information of the consistency check process of the entire storage pool is recorded/updated. Specifically, when the consistency check operation is actually performed, the objects in the storage pool are checked, and consistency check is performed on the objects in the storage pool in sequence according to a certain order, for example, in the case that the object IDs are sequential numbers, consistency check may be performed on the objects in the storage pool in sequence from smaller object IDs to larger object IDs, at this time, after each consistency check is completed, the ID of the object that has completed consistency check, or the ID of the last object that has completed consistency check, may be recorded as the progress information.

The specific consistency check flow is as follows: determining PG (PG) to which the target object belongs through a consistent hash algorithm; the main OSD of the PG sends a request to all standby OSD to lock the check information of the same version of the target object, if the versions of the OSD are different, the OSD is synchronized to be the same; after receiving the confirmation information with the same version, the main OSD requires all OSD to calculate the check information of the target object, wherein the check information comprises the meta information of the object, such as all keys of size and extended attribute, historical version information and the like; the main OSD receives the check information, judges whether the data of the target object are consistent or not by comparing the check information, if not, reports the data to the Monitor of the cluster, and reports the alarm to inform the user.

It should be noted that when the end time is reached, consistency check may be performed on a certain object, and in this case, a wait may be made slightly, and the consistency check process is stopped after the object completes the consistency check.

The data consistency verification method for the distributed storage system provided by the embodiment can determine the starting time and the ending time of each consistency verification by setting the configuration information of the consistency verification, so that the full automation of the consistency verification process is realized, and when the ending time of the consistency verification reaches, the consistency verification can be stopped even if all objects in a storage pool are not verified, and the progress information of the consistency verification is recorded, so that the consistency verification can be continuously performed from the verification position according to the progress information during the next consistency verification, and the flexibility of the consistency verification process is obviously improved. The consistency check can be carried out when the system resources are sufficient or routine maintenance is carried out at night, the influence of the data consistency check on the performance of the storage system is reduced, the reliability of the system is ensured, and the product competitiveness is improved.

A second embodiment of the data consistency checking method for the distributed storage system provided by the present application is described in detail below, and referring to fig. 2, the second embodiment specifically includes:

s21, reading the configuration information of consistency check, determining the target storage pool to be subjected to consistency check according to the storage pool identification information in the configuration information, and determining the starting time and the ending time of the next consistency check of the target storage pool;

s22, setting and starting a start timer according to the start time, and monitoring whether the start time is reached through the start timer;

s23, when the starting time is reached, reading the progress information of consistency check, awakening the consistency check thread of the target storage pool, and calling the consistency check thread to carry out consistency check on the object of the target storage pool according to the progress information;

s24, when the starting time is reached, setting and starting an ending timer according to the ending time, and monitoring whether the ending time is reached or not through the ending timer;

s25, in the consistency check process, if all the objects in the target storage pool complete the consistency check, resetting the progress information, and carrying out the consistency check on the objects in the target storage pool again according to the reset progress information;

s26, when the end time is reached, waiting for the target object which is currently carrying out consistency check to finish the consistency check, stopping the consistency check, and sleeping the consistency check thread;

and S27, updating the progress information according to the target object, and returning to S21, wherein the progress information comprises the identification information of the last object which completes the consistency check.

Based on the second embodiment, the following introduces a consistency check process of the present application, taking practical application as an example, where the process is as follows:

(1) the storage pool consistency check period is customized, such as by selecting the day of the day, or the days of the week, or the days of the month, the start time and end time of the 24 hour system, and the storage pool identification.

If the time period information of the storage pool exists in the database, the time period information is cleared, if the data consistency check is carried out on the storage pool before the self-defined time period, whether the user needs to restart is prompted, and if yes, the saved relevant information of the consistency check is cleared.

(2) And reading and storing the consistency verification time period and the storage pool identification, calculating the starting time and the ending time of the consistency verification of the storage pool at this time, starting a starting timer, and creating a data consistency verification thread of the storage pool.

And if the current time is within the consistency check time period, immediately performing data consistency check on the storage pool, otherwise, performing data consistency check again by the beginning time.

(3) When the starting timer detects that the current time reaches the starting time of the consistency check, the data consistency check thread of the storage pool is awakened, the ending timer is started, the data consistency check is started, if the inconsistency of the data is detected, a prompt is reported, and the check is continued.

(4) When the ending timer detects that the current time reaches the ending time of the consistency check, the ending timer firstly waits for the object currently performing the consistency check to finish the check, and records the identification information of the object so as to continue the check from the object next time.

(5) And reading the currently set consistency check time period, calculating the starting time and the ending time of the next consistency check of the storage pool, starting the starting timer again, and sleeping the data consistency check thread of the storage pool.

And then repeating the previous process, and when the start timer detects that the current time reaches the start time of the next consistency check, firstly acquiring the identification information of the object at the last end, and continuing the check by taking the object as a starting point. And when all the objects in the storage pool are verified, restarting verification according to the consistency verification time period.

It is worth mentioning that, in the time interval between the end of the last consistency check and the start of the next consistency check, if the operation of deleting the storage pool occurs, the consistency check time period setting of the storage pool, the progress information saved when the data consistency check is finished, the related timer and the data consistency check thread are prompted and cleared.

The following describes a data consistency verification apparatus of a distributed storage system according to an embodiment of the present application, and the data consistency verification apparatus of the distributed storage system described below and the data consistency verification method of the distributed storage system described above may be referred to correspondingly.

As shown in fig. 3, the data consistency check apparatus of the distributed storage system of this embodiment includes:

the time determining module 31 is configured to read configuration information of consistency verification, and determine a start time and an end time of next consistency verification according to the configuration information;

the checking module 32 is configured to read progress information of consistency checking when the starting time is reached, and perform consistency checking on the object in the target storage pool according to the progress information;

and a progress updating module 33, configured to stop the consistency check when the end time is reached, and update the progress information.

The data consistency check apparatus of the distributed storage system of this embodiment is used to implement the foregoing data consistency check method of the distributed storage system, and therefore a specific implementation of the apparatus may be seen in the foregoing parts of the embodiment of the data consistency check method of the distributed storage system, for example, the time determination module 31, the check module 32, and the progress update module 33 are respectively used to implement steps S11, S12, and S13 in the data consistency check method of the distributed storage system. Therefore, specific embodiments thereof may be referred to in the description of the corresponding respective partial embodiments, and will not be described herein.

In addition, since the data consistency check apparatus of the distributed storage system of this embodiment is used to implement the data consistency check method of the distributed storage system, the role of the apparatus corresponds to that of the method, and details are not described here.

In addition, the present application further provides a data consistency verification device of a distributed storage system, as shown in fig. 4, including:

the memory 100: for storing a computer program;

the processor 200: for executing the computer program to implement the data consistency check method of the distributed storage system as described above.

Finally, the present application provides a readable storage medium having stored thereon a computer program for implementing the data consistency checking method of the distributed storage system as described above when executed by a processor.

The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

The above detailed descriptions of the solutions provided in the present application, and the specific examples applied herein are set forth to explain the principles and implementations of the present application, and the above descriptions of the examples are only used to help understand the method and its core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:存储系统的带宽资源分配方法、装置、设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类