Method and device for determining reconstruction time interval
By flexibly configuring the reconstruction time interval based on the matching rules of the storage pool type and device inclusion relationship in a distributed storage system, the problem of rigid automatic reconstruction mechanism in the existing technology is solved, and resource utilization and system performance are improved.
Patent Information
- Application Number
- CN202410949425.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-08
AI Technical Summary
When existing distributed storage systems face network fluctuations and hardware failures, the immediate automatic reconstruction mechanism is too rigid, resulting in a decrease in resource utilization and unable to effectively deal with the risk of data loss.
By determining the offline but not kicked out target device information in the status list of the object storage device based on the matching rules based on the storage pool type, combining the inclusion relationship between devices, refine the fault scenario and flexibly configure the reconstruction time interval so that in the Reasonably trigger data reconstruction in different fault scenarios to improve resource utilization efficiency.
The refined processing of different fault scenarios is achieved, resource utilization and system performance are improved, and resource waste and performance degradation are avoided due to frequent reconstruction.
Smart Images

Figure CN118916197A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed storage technology, and in particular to a method and device for determining a reconstruction time interval. Background Art
[0002] With the rapid development of big data and cloud computing technologies, distributed storage systems have become an indispensable infrastructure for processing massive amounts of data. Distributed storage systems integrate multiple server nodes and their disk resources to build efficient and scalable storage clusters, providing stable and reliable storage services for various applications. However, in the actual operation of distributed storage systems, they face various complex failure scenarios, including but not limited to network fluctuations, hardware failures (such as node failures, hard disk damage), etc. If these failures are not handled properly, they may seriously threaten the integrity of the data and the availability of the system.
[0003] At present, in order to cope with the potential risk of data loss in distributed storage systems, distributed storage systems are usually equipped with automatic fault detection and recovery mechanisms; among them, when the object storage device (OSD) is detected to be offline, the data reconstruction process will be triggered immediately, that is, the affected data blocks will be migrated from the offline OSD to the normal OSD to maintain data integrity and system availability.
[0004] However, the current processing method of the immediate automatic reconstruction mechanism is too rigid, which reduces the resource utilization of the system. Summary of the invention
[0005] In view of this, the present invention provides a method, apparatus, computer device and storage medium for determining a reconstruction time interval to solve the problem that the current processing method of the immediate automatic reconstruction mechanism is too rigid and reduces the resource utilization of the system.
[0006] In a first aspect, the present invention provides a method for determining a reconstruction time interval, the method comprising: determining first device information that matches a first target state in an object storage device status list based on a matching rule corresponding to the type of storage pool; wherein the first target state is a state in which the first target object storage device is offline but has not been kicked out of the storage pool; determining a corresponding fault scenario for the second device information based on an inclusion relationship between the first device information and the second device information; and determining a reconstruction time interval for the second device information based on the corresponding fault scenario.
[0007] The method for determining the reconstruction time interval provided in the embodiment of the present application can flexibly determine the first target object storage device that is offline but has not been kicked out of the storage pool in the object storage device status list for different storage pool types through the matching rules corresponding to the storage pool type; through the inclusion relationship between the first target object storage device and the second target object storage device that is currently offline but has not been kicked out of the storage pool, the classification of fault scenarios can be further refined; and then the reconstruction time interval is flexibly configured according to the corresponding fault scenario, so that the trigger time of data reconstruction can be determined for different fault scenarios, thereby improving the rationality of the reconstruction time of the determined second device information, thereby improving resource utilization efficiency.
[0008] In an optional embodiment, based on the inclusion relationship between the first device information and the second device information, determining the corresponding fault scenario of the second device information includes at least one of the following: if the first device information includes the second device information, then determining the first fault scenario corresponding to the first device information from the preset fault scenarios, and using the first fault scenario as the corresponding fault scenario of the second device information; wherein the second device information indicates a second target object storage device that is currently offline but has not been kicked out of the storage pool; if the first device information does not include the second device information, determining the set of object storage devices running on the node where the second device information is located; determining the metering value of the second target object storage device included in the set of object storage devices; determining the second fault scenario corresponding to the metering value of the second target object storage device from the preset fault scenarios, and using the second fault scenario as the corresponding fault scenario of the second device information.
[0009] The method for determining the reconstruction time interval provided in the embodiment of the present application can quickly and accurately locate the corresponding fault scenario of the second device information by directly determining the first fault scenario corresponding to the first device information from the preset fault scenario if the first device information includes the second device information. If the first device information does not include the second device information, the fault scenario of the second device is indirectly determined by analyzing the object storage device set of the node where the second device is located and its measurement value, thereby covering more types of fault conditions and improving the comprehensiveness and accuracy of the determined corresponding fault scenario.
[0010] In an optional embodiment, a second fault scenario corresponding to the measurement value of the second target object storage device is determined from preset fault scenarios, and the second fault scenario is used as the corresponding fault scenario for the second device information, including: determining the ratio between the number of second target object storage devices and the total number of object storage devices in the object storage device set; detecting whether the ratio exceeds a preset ratio; if the ratio exceeds the preset ratio, determining a second fault scenario corresponding to the preset ratio from the preset fault scenarios, and using the second fault scenario as the corresponding fault scenario for the second device information; if the ratio does not exceed the preset ratio, determining a third fault scenario corresponding to the ratio from the preset fault scenarios, and using the second fault scenario as the corresponding fault scenario for the second device information.
[0011] The method for determining the reconstruction time interval provided in the embodiment of the present application can determine the fault scenarios corresponding to different proportions by determining and calculating the proportion of the second target object storage device in the object storage device set, and combine the preset proportion as the dividing line to more finely divide the fault scenarios, thereby improving the accuracy of the determined fault scenarios.
[0012] In an optional implementation, the types of storage pools include: a replica mode and an erasure code mode; wherein, based on a matching rule corresponding to the type of storage pool, matching the first device information from the object storage device status list includes: when the number of online object storage devices in the object storage device status list reaches a maximum value, recording the information of the online object storage device; when the type of the storage pool is the replica mode, and any object storage device is detected to be offline, detecting whether the number of current online object storage devices in the object storage device status list is greater than a first preset number; if the number of current online object storage devices is not greater than the first preset number, determining information that does not belong to the current online object storage device from the maximum number of online object storage devices determined based on the object storage device status list; when the type of the storage pool is the erasure code mode, and any object storage device is detected to be offline, detecting whether the number of current online object storage devices in the object storage device status list is greater than a second preset number; if the number of current online object storage devices is not greater than the second preset number, determining information that does not belong to the current online object storage device from the maximum number of online object storage devices determined based on the object storage device status list.
[0013] The method for determining the reconstruction time interval provided in the embodiment of the present application determines different matching rules by the type of storage pool, which can improve the flexibility and applicability of the matching rules. When it is detected that the object storage device is offline, it is determined whether to trigger the fault handling process by comparing whether the number of current online devices is greater than the number of corresponding matching rules, thereby improving the accuracy of triggering the fault handling process.
[0014] In an optional embodiment, the above method also includes: obtaining the last offline time of the second target object storage device; determining the storage pool reconstruction time based on the sum of the reconstruction time interval and the last offline time; if the current offline time is the storage pool reconstruction time, kicking the second target object storage device out of the storage pool and triggering automatic reconstruction of the storage pool.
[0015] The method for determining the reconstruction time interval provided in the embodiment of the present application determines the reconstruction time by calculating the sum of the most recent offline time and the reconstruction time interval, ensuring that the storage pool is reconstructed only when the second target object device really needs to be replaced, thereby avoiding resource waste and performance degradation caused by frequent reconstruction.
[0016] In an optional embodiment, the above method also includes at least one of the following: when the storage pool type is a replica mode, if the number of current online object storage devices is greater than a first preset number, the offline object storage device is deleted; when the storage pool type is an erasure code mode, if the number of current online object storage devices is greater than a second preset number, the offline object storage device is deleted.
[0017] The method for determining the reconstruction time interval provided in the embodiment of the present application improves the availability and fault tolerance of data by maintaining multiple data. When the number of online object storage devices is greater than the first preset number, it means that even if some devices are offline, the remaining devices can still provide sufficient data, so the offline devices can be safely deleted without affecting the availability and integrity of the data, while optimizing resource utilization and improving the overall performance of the system.
[0018] In an optional implementation, determining the node where the second device information is located includes: acquiring a mapping relationship between the node and the second target object storage device; and determining the node where the second device information is located based on the mapping relationship.
[0019] The method for determining the reconstruction time interval provided in the embodiment of the present application can accurately locate the second device information to the node where the second device information is located after determining the second device information through a mapping relationship, thereby accurately identifying and processing the second target object storage device corresponding to the second device information.
[0020] In a second aspect, the present invention provides a device for determining a reconstruction time interval, the device comprising: a first determination module, for determining first device information that matches a first target state in an object storage device status list based on a matching rule corresponding to the type of storage pool; wherein the first target state is a state in which the first target object storage device is offline but has not been kicked out of the storage pool; a second determination module, for determining a corresponding fault scenario of the second device information based on an inclusion relationship between the first device information and the second device information; and a third determination module, for determining the reconstruction time interval of the second device information based on the corresponding fault scenario.
[0021] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for determining the reconstruction time interval of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining a reconstruction time interval of the first aspect or any corresponding embodiment thereof.
[0023] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the method for determining a reconstruction time interval of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 is a flow chart of a method for determining a reconstruction time interval according to an embodiment of the present invention;
[0026] Figure 2 is a flow chart of another method for determining a reconstruction time interval according to an embodiment of the present invention;
[0027] Figure 3 is a mapping table between a node and a second target faulty device provided according to this embodiment;
[0028] Figure 4 is a flow chart of another method for determining a reconstruction time interval according to an embodiment of the present invention;
[0029] Figure 5 is a flowchart of a method for determining a reconstruction time interval according to an embodiment of the present invention;
[0030] Figure 6 is a structural block diagram of a device for determining a reconstruction time interval according to an embodiment of the present invention;
[0031] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0033] Distributed storage usually consists of several server nodes (each server node has several disks). These server nodes are organized into a distributed storage cluster through distributed storage software, which then manages the server nodes and provides storage services to the outside world. Distributed storage software manages the storage resources (disks) on the server by creating storage pools. A storage pool can be understood as a logical container for storing data objects and related metadata. A storage pool can be regarded as a group of relatively independent data storage spaces. There are multiple server nodes in the storage pool, and the hard disks on them are managed by the object storage device service. Usually, one hard disk corresponds to one object storage device service. In addition, there are several placement groups (PGs) in the storage pool. The placement group is a logical concept that corresponds to the object storage device through the data distribution algorithm, and thus generates two storage pool-level data redundancy modes: copy mode and erasure code mode. Therefore, a placement group exists in multiple object storage devices. When business data needs to be written to the storage pool, the client will cut the data into fixed sizes. This fixed-size data is called an object. The object and placement group can be matched through a consistent hashing algorithm. The corresponding placement group can be calculated through the object name. The placement group exists on multiple object storage devices. In this way, the object is written to the disk through the object storage device service.
[0034] The fault domain of a storage pool refers to the different physical entities used to store data in the storage pool, such as nodes and cabinets. Fault domains are used to distinguish different availability zones to provide better fault tolerance and availability when a failure occurs.
[0035] There are two types of redundancy in storage pools: copy mode and erasure code mode. The copy mode means that each placement group in the storage pool exists in several object storage devices, and the business data on them is exactly the same, and they are copies of each other. The most common is a three-copy storage pool, that is, each placement group in the storage pool exists on three object storage devices. The selection of these three object storage devices is controlled by the data distribution algorithm. If certain fault domain rules are met, such as the node fault domain, the three object storage devices corresponding to a certain placement group need to be selected from different nodes to ensure that other data copies can be used normally when a node fails.
[0036] The only difference between the erasure code mode and the replica mode is that the data stored on the object storage device are not copies of each other, but are first calculated by a certain erasure algorithm, and then the calculated data is stored. The storage pool of the erasure code mode can include 2+1 and 4+2 mode storage pools. Among them, taking 4+2 as an example, each placement group in the storage pool exists in 6 object storage devices. When data is written, four data blocks and two check blocks are calculated by the erasure algorithm, and then the results are written to the six object storage devices respectively. When reading, any four blocks of data can be taken to calculate the original data through the erasure algorithm.
[0037] From the above content, we can know that storage pools with different redundancy strategies have different tolerance for failures. For example, a storage pool in replica mode can still read and write data when only one copy is stored, but a storage pool in erasure code mode needs to have 4 data blocks at the same time to read and write data according to different erasure ratio settings, such as 4+2. When the failure exceeds the range that the redundancy strategy can tolerate, data loss will occur, which is called a super fault domain. In addition, as the cluster size continues to increase, disk or node failures occur from time to time. When a failure occurs, the distributed storage system will automatically kick the offline disk or node out of the storage pool, and recalculate the mapping of the affected PG, so that the data on it can be restored to the normal node through reconstruction.
[0038] However, there is a scenario where, when a distributed storage pool fails, the OSD service is disconnected from the cluster due to network fluctuations. To ensure business operations, the cluster can only mark the abnormal OSD as offline. However, network fluctuations may only be short-term phenomena, and it is not desirable to have these data immediately trigger reconstruction and restore to other nodes. Alternatively, due to other hardware failures in the machine, the machine needs to be powered off for repair and hardware replacement. In this case, it is foreseeable that the node will be offline for a short period of time, and it is not desirable to immediately reconstruct the data to other nodes. Alternatively, due to a hard disk failure, multiple hard disks fail in a short period of time. When the failure domain is about to be exceeded, reconstruction is desired immediately to prevent secondary failures from causing data security issues.
[0039] Based on this, the present invention provides a method for determining a reconstruction time interval. Through the matching rules corresponding to the storage pool type, the first target object storage device in the object storage device status list that is offline but has not been kicked out of the storage pool can be flexibly determined for different storage pool types; through the inclusion relationship between the first target object storage device and the second target object storage device that is currently offline but has not been kicked out of the storage pool, the classification of fault scenarios can be further refined; and then the reconstruction time interval is flexibly configured according to the corresponding fault scenario, so as to flexibly determine the trigger time of data reconstruction.
[0040] According to an embodiment of the present invention, an embodiment of a method for determining a reconstruction time interval is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0041] In this embodiment, a method for determining a reconstruction time interval is provided, which can be used in computer devices, such as computers, servers, etc. Figure 1 FIG. 4 is a flow chart of a method for determining a reconstruction time interval according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0042] Step S101, based on the matching rule corresponding to the storage pool type, determine the first device information matching the first target state in the object storage device state list; wherein the first target state is the state where the first target object storage device is offline but not kicked out of the storage pool.
[0043] The storage pool indicates a logical collection in the storage system for organizing and managing storage devices (such as hard disks, etc.). The storage pool type can be a replica mode, an erasure code mode, or other types, which are not specifically limited here.
[0044] Matching rules are used to represent rules defined according to storage pool types, and are specifically used to determine which device states match specific conditions. Matching rules can be rules determined by device states (such as online, offline, faulty, etc.), performance parameters (such as read / write speed, latency, etc.), or other related factors.
[0045] The first target state is a state in which the first target object storage device is offline but not kicked out of the storage pool. The object storage device state list is a list of device information in multiple different states. The object storage device state list may include: first device information matching the state in which the object storage device is offline but not kicked out of the storage pool, and may also include other device information matching the state of an online object storage device, which is not specifically limited here.
[0046] Specifically, different types of storage pools may correspond to different matching rules. For example, in the replica mode, the first device information may be determined based on whether the number of offline devices exceeds the replica redundancy threshold; while in the erasure code mode, the first device information may be determined based on whether the remaining online devices are sufficient to support data reconstruction. This is not specifically limited here and can be implemented by those skilled in the art.
[0047] Step S102, based on the inclusion relationship between the first device information and the second device information, determine the corresponding fault scenario of the second device information; wherein the second device information indicates a second target object storage device that is currently offline but has not been kicked out of the storage pool.
[0048] The inclusion relationship refers to the association or similarity between the first device information and the second device information. For example, the first device information and the second device information may belong to the same type of device, be located at the same node, or have the same failure mode, etc., which is not specifically limited here.
[0049] The second device information indicates the second target object storage device that is currently offline but has not been kicked out of the storage pool. The second device information can be detected by the timer function of the cluster monitor according to a preset time interval (such as 3s, 5s, etc.), or it can be detected by other detection components. It is not specifically limited here and can be implemented by those skilled in the art. More specifically, the second target object storage device can be all storage devices that are currently offline but have not been kicked out of the storage pool detected by the timer function of the cluster monitor within 3s, or it can be all storage devices that are currently offline but have not been kicked out of the storage pool detected by the timer function of the cluster monitor within 5s, etc. It is not specifically limited here.
[0050] The corresponding fault scenario refers to a fault scenario that the second target object device may face, determined based on the inclusion relationship between the first device information and the second device information. The fault scenario may be a hardware failure, a software error, a network problem, etc., which are not specifically limited here.
[0051] Specifically, the first device information may include the second device information, that is, the second target object storage device corresponding to the second device information is in the object storage device status list. In order to ensure that PG restores safety redundancy as soon as possible, the corresponding fault scenario of the second device information can be determined as a super fault domain scenario, that is, the storage pool needs to be reconstructed in a very short time (such as 2s, 3s, etc.). The first device information does not include the second device information, and the corresponding fault scenario of the second device information can be determined by detecting the number of faults in the second device information or the proportion of the number of faults in the second device information, etc., which is not specifically limited here and can be implemented by those skilled in the art.
[0052] Step S103: determining a reconstruction time interval of the second device information based on a corresponding fault scenario.
[0053] The reconstruction interval refers to the waiting time for the storage pool to be reconstructed in a fault scenario. The reconstruction interval can be 2s or 10min, etc., which can be determined by the corresponding fault scenario and is not specifically limited here.
[0054] In an application scenario, there is a mapping rule between the corresponding fault scenario and the reconstruction time interval of the second device information, that is, a mapping table between the corresponding fault scenario and the reconstruction time interval of the second device information is pre-set. When the corresponding fault scenario is determined, the reconstruction time interval corresponding to the corresponding fault scenario can be directly determined from the mapping table. For example: when the corresponding fault scenario is fault scenario A, the reconstruction time interval can be 2s; for another example: when the corresponding fault scenario is fault scenario B, the reconstruction time interval can be 5min, etc.
[0055] In an application scenario, a fault scenario neural network model can be pre-trained to obtain a trained fault scenario neural network model, wherein the corresponding fault scenario can be used as the input of the trained fault scenario neural network model, and the reconstruction time interval of the second device information can be used as the output of the trained fault scenario neural network model.
[0056] In an application scenario, after determining the corresponding fault scenario, the technician can manually set or select the reconstruction time interval of the second device information according to the corresponding fault scenario. For example: when the corresponding fault scenario is determined to be fault scenario A, a selection page pop-up window can be displayed for fault scenario A, wherein the selection page includes at least two selectable reconstruction time interval options, and in response to a confirmation operation on the selection page, the reconstruction time interval can be determined from the at least two selectable reconstruction time interval options. The determination operation can be an operation generated by the user by clicking the mouse, tapping the keyboard, or touching the screen, and accordingly, the computer device can determine the reconstruction time interval in response to the user's trigger operation on the selection page.
[0057] More specifically, based on the corresponding fault scenario, determining the reconstruction time interval of the second device information may also be implemented in other ways, which are not specifically limited here and may be implemented by those skilled in the art.
[0058] The method for determining the reconstruction time interval provided in the embodiment of the present application can flexibly determine the first target object storage device that is offline but has not been kicked out of the storage pool in the object storage device status list for different storage pool types through the matching rules corresponding to the storage pool type; through the inclusion relationship between the first target object storage device and the second target object storage device that is currently offline but has not been kicked out of the storage pool, the classification of fault scenarios can be further refined; and then the reconstruction time interval is flexibly configured according to the corresponding fault scenario, so as to flexibly determine the trigger time of data reconstruction.
[0059] In this embodiment, a method for determining a reconstruction time interval is provided, which can be used in the above-mentioned computer equipment, such as a computer, a server, etc. Figure 2 FIG. 4 is a flow chart of a method for determining a reconstruction time interval according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0060] Step S201: Based on the matching rule corresponding to the storage pool type, determine the first device information that matches the first target state in the object storage device state list; wherein the first target state is the state in which the first target object storage device is offline but has not been kicked out of the storage pool. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0061] Step S202: determining a corresponding fault scenario of the second device information based on an inclusion relationship between the first device information and the second device information; wherein the second device information indicates a second target object storage device that is currently offline but has not been kicked out of the storage pool.
[0062] Specifically, the above step S202 includes at least one of the following:
[0063] Step S2021: If the first device information includes the second device information, a first fault scenario corresponding to the first device information is determined from preset fault scenarios, and the first fault scenario is used as the corresponding fault scenario of the second device information.
[0064] The first device information may include a unique authentication identifier that identifies the object storage device. The second device information may also include a unique authentication identifier that identifies the object storage device. When the unique authentication identifier of the first device information in the object storage device status list includes the unique authentication identifier of the second device information, it is determined that the second device information belongs to the first device information, and the first fault scenario corresponding to the first device information can be used as the corresponding fault scenario of the second device information. It should be noted that the first fault scenario can be a pre-set fault scenario that matches the first device information.
[0065] Specifically, determining the node where the second device information is located in the above step S2021 includes:
[0066] Step m1, obtaining a mapping relationship between the node and the second target object storage device.
[0067] A mapping relationship refers to a corresponding relationship between a node and a storage device, which clearly indicates to which node each second target object storage device belongs. The mapping relationship can be statically configured or dynamically generated, which is not specifically limited here. Specifically, the mapping relationship between the second target object storage device and the node is stored in a configuration file, database or memory in advance. System administrators or automated tools can access these storage locations to retrieve the required mapping information.
[0068] Step m2: determine the node where the second device information is located based on the mapping relationship.
[0069] Once the mapping relationship is obtained, the node corresponding to the second target object storage device can be determined by traversing or querying the mapping relationship. Specifically, the unique identifier can be matched with the device identifier in the mapping relationship, or other methods can be matched, which are not specifically limited here and can be implemented by those skilled in the art.
[0070] Step S2022: If the second device information is not included in the first device information, determine the object storage device set running on the node where the second device information is located; determine the measurement value of the second target object storage device included in the object storage device set; determine the second failure scenario corresponding to the measurement value of the second target object storage device from the preset failure scenarios, and use the second failure scenario as the corresponding failure scenario of the second device information.
[0071] Metrics are characteristic values that can be infinitely subdivided and measured. Metrics can be specific values or ratios, etc., which are not specifically limited here. Nodes refer to physical or logical units that store or process data in a distributed system. Each node can run at least one object storage device, and object storage devices can constitute an object storage device collection.
[0072] Specifically, when the second device information is not included in the first device information, a more detailed analysis process will be performed. Among them, first obtain the node where the second target object storage device is located, and then obtain the number of all object storage devices under the node and the status of each object storage device (online or offline). Then analyze the measurement values (such as quantity, proportion, etc.) of the second target object storage device in the object storage device set. Finally, based on these measurement values, find the corresponding second fault scenario from the preset fault scenarios, and use it as the corresponding fault scenario for the second device information. Specifically, an intelligent prediction model can be constructed through machine learning or deep learning algorithms to automatically predict and recommend fault scenarios based on historical data and real-time monitored measurement values. Fault scenarios can also be determined by other means, which are not specifically limited here and can be implemented by those skilled in the art.
[0073] Specifically, in the above step S2022, determining a second fault scenario corresponding to the metering value of the second target object storage device from the preset fault scenarios, and using the second fault scenario as the corresponding fault scenario of the second device information includes:
[0074] Step a1: determine the ratio between the number of second target object storage devices and the total number of object storage devices in the object storage device set.
[0075] The total number of object storage devices in the object storage device set may represent the number of all object storage devices in the object storage device set. After determining the number of second target object storage devices in the object storage device set, the ratio between the number of second target object storage devices and the total number may be determined. For example, if the number of second target object storage devices is 3 and the total number is 6, then the ratio is 50%; for another example, if the number of second target object storage devices is 6 and the total number is 20, then the ratio is 30%.
[0076] Step a2, detecting whether the ratio exceeds a preset ratio.
[0077] The preset ratio can represent a preset ratio for defining the fault scenario matching. The preset ratio can be 70%, 75%, etc., which is not specifically limited here. Specifically, after determining the ratio between the number of the second target object storage devices and the total number of object storage devices in the object storage device set, by detecting whether the ratio exceeds the preset ratio, two situations can be obtained: one: the ratio exceeds the preset ratio; the other: the ratio does not exceed the preset ratio. For different situations, the fault scenarios corresponding to different situations can be matched.
[0078] Step a3: if the ratio exceeds the preset ratio, a second fault scenario corresponding to the preset ratio is determined from the preset fault scenarios, and the second fault scenario is used as the corresponding fault scenario of the second device information.
[0079] If the ratio exceeds the preset ratio, the second fault scenario corresponding to the preset ratio is used as the corresponding fault scenario of the second device information. The second fault scenario can be a fault scenario that is preset and matches the preset ratio, that is, as long as the ratio exceeds the preset ratio, the fault scenario of the second device information is the second fault scenario. For example: it has been detected that osd.0 to osd.4 and osd.10 and osd.11 are offline. Assuming that the osd being traversed is osd.0, it is queried through osd.0 that the osd belongs to the host_1 node, and then the status and number of osds under it are obtained through the node. It can be seen that there are 6 osds in total, of which osd.0 to osd.4 are offline, 5 / 6×100%=83%>70%, which meets the judgment condition, and the reconstruction time interval of osd.0 is set to a preset value such as 60 minutes.
[0080] Step a4: if the ratio does not exceed the preset ratio, a third fault scenario corresponding to the ratio is determined from the preset fault scenarios, and the second fault scenario is used as the corresponding fault scenario of the second device information.
[0081] If the ratio does not exceed the preset ratio, the fault scenario below the preset ratio is used as the corresponding fault scenario of the second device information. For example: it has been detected that osd.0 to osd.4 and osd.10 and osd.11 are offline. Assuming that the osd being traversed is osd.0, it is queried through osd.0 that the osd belongs to the host_1 node, and then the status and number of osds under it are obtained through the node. It can be seen that there are 3 osds in total, of which osd.0 to osd.4 are offline, 3 / 6×100%=50%<70%, which meets the judgment condition, and the reconstruction time interval of osd.0 is set to the preset value such as 10 minutes.
[0082] Figure 3 is a mapping table between the node and the second target faulty device provided by this embodiment. Figure 3 As shown, node 1 (i.e. Figure 3 host-1 in the node 1, node 1 includes: osd.0 to osd.5; node 2 (also Figure 3 host—2) osd.6 to osd.11; node 3 (i.e. Figure 3host—3) in includes: osd.12 to osd.17. Among them, for node 1, osd.0 to osd.4 are offline, so the corresponding ratio is 5 / 6×100%≈83.3%, and the second fault scenario corresponding to the preset ratio is used as the corresponding fault scenario of the second device information. For node 2, osd.10 to osd.11 are offline, so the corresponding ratio is 2 / 6×100%≈33.3%, and the third fault scenario corresponding to the preset ratio is used as the corresponding fault scenario of the second device information. For node 3, there is no offline osd, so there is no fault.
[0083] Step S203: Determine the reconstruction time interval of the second device information based on the corresponding fault scenario. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0084] The method for determining the reconstruction time interval provided in the embodiment of the present application can quickly and accurately locate the corresponding fault scenario of the second device information by directly determining the first fault scenario corresponding to the first device information from the preset fault scenario if the first device information includes the second device information. If the first device information does not include the second device information, the fault scenario of the second device is indirectly determined by analyzing the object storage device set of the node where the second device is located and its measurement value, thereby covering more types of fault conditions and improving the comprehensiveness and accuracy of the determined corresponding fault scenario.
[0085] Furthermore, by determining and calculating the proportion of the second target object storage device in the object storage device set, the fault scenarios corresponding to different proportions can be determined, and the preset proportion is used as a dividing line to more finely divide the fault scenarios, thereby determining the accuracy of the fault scenarios.
[0086] In an optional implementation, in the above step S2022, determining a second failure scenario corresponding to the measurement value of the second target object storage device from preset failure scenarios, and using the second failure scenario as the corresponding failure scenario of the second device information includes:
[0087] Step b1, determining the target number of second target object storage devices.
[0088] The target number refers to the number of second target object storage devices in the object storage device set; wherein the target number may be 2, 3, or 4, etc., which is not specifically limited here. Specifically, the target number of second target object storage devices may be determined by a detection function of a cluster monitor, or by other number detection functions, which is not specifically limited here and may be implemented by those skilled in the art.
[0089] Step b2: Detect whether the target quantity of the second target storage object device is within a preset quantity range.
[0090] The preset quantity range refers to a preset quantity range used to define the processing method. Among them, the preset quantity range can be (0~10) or (0~11), etc., which is not specifically limited here. After determining the target quantity of the second target storage object device, by detecting whether the target quantity is within the preset quantity range, two situations can be obtained; one: the target quantity is within the preset quantity range; the second: the target quantity is not within the preset quantity range. Different processing methods can be matched for different situations. For example: when the target quantity is within the preset quantity range, the fault scenario corresponding to the second device information can be directly determined by comparing the quantity; for another example: when the target quantity does not process the preset quantity range, the fault scenario corresponding to the second device information can be determined by the proportion of the second target object device to the total object devices.
[0091] Step b3: If the target number of the second target storage object device is not within the preset number range, execute the above steps a1 to a4.
[0092] The target number not being within the preset number range can be used as the first condition in this step. When the first condition is met, the ratio exceeding the preset ratio can be used as the second condition. When the second condition is met, the second fault scenario is used as the corresponding fault scenario of the second device information. When the second condition is not met, the third fault scenario corresponding to the ratio is used as the corresponding fault scenario of the second device information. For the specific process, please refer to the above steps a1 to a4, which will not be described in detail here. For example: the preset number range is (0-10), the target number is 12, then the target number is not within the preset number range, the total number of object storage device sets is 24, then the ratio is 12 / 24×100%≈50%, the second condition is not met, then the third fault scenario corresponding to the ratio is used as the corresponding fault scenario of the second device information. For another example: the preset number range is (0-10), the target number is 12, then the target number is not within the preset number range, the total number of object storage device sets is 15, then the ratio is 12 / 15×100%≈80%, the second condition is met, then the second fault scenario is used as the corresponding fault scenario of the second device information.
[0093] Step b4: if the target number of the second target storage object device is within the preset number range, detect whether the target number is a set value; if the target number is greater than the set value, determine a third fault scenario corresponding to the set value from the preset fault scenarios.
[0094] The set value may represent a pre-set value used to define the matching of the fault scenario. The set value may be 6, 7, etc., which are not specifically limited here. Specifically, when the target number of the second target storage object device is within the preset number range, it is detected whether the target number is the set value. If the target number is greater than the set value, a third fault scenario corresponding to the set value is determined from the preset fault scenarios, and a corresponding reconstruction time interval (such as 5 minutes) can be matched through the third fault scenario.
[0095] Step b5: If the target number is not greater than the set value, a third fault scenario corresponding to the target number is determined from the preset fault scenarios.
[0096] If the target number is not greater than the set value, it indicates that there are more valid devices in the object storage device set, and the third fault scenario corresponding to the target number can be used as the fault scenario corresponding to the second device information. For example: if the target number is not greater than the set value, it indicates that there are more valid devices in the object storage device set, and it can be determined as a disk failure scenario, and the disk reconstruction time interval of the second target object storage device is set to the preset 10 minutes.
[0097] The method for determining the reconstruction time interval provided in the embodiment of the present application realizes a hierarchical response to the change in the number of devices by introducing two different thresholds (preset number range and set value). When the number of devices is not within the preset number range, a more comprehensive check (steps a1 to a4) is performed; and when the number of devices is within the preset number range and reaches the set value, a relatively lightweight fault scenario determination is triggered to avoid waste of resources and overreaction.
[0098] In an optional implementation, the types of the storage pool include: a replica mode and an erasure coding mode; wherein, in the above step S201, matching the first device information from the object storage device status list based on a matching rule corresponding to the type of the storage pool includes:
[0099] Step c1: when the number of online object storage devices in the object storage device status list reaches a maximum value, information of the online object storage devices is recorded.
[0100] An online object storage device refers to an object storage device that is currently in normal working condition and can respond to read and write requests. Among them, the information of the online object storage device recorded in this step refers to the information of the online object storage device when the number of online object storage devices reaches the maximum value. More specifically, the information of the online object storage device is the information recorded last time when it was detected that the currently remaining osd of a certain PG is close to the super fault domain. For example: it is currently detected that the currently remaining osd of a certain PG is close to the super fault domain, and 5s ago, the number of online object storage devices in the object storage device status list reached the maximum value, then the information of the online object storage device is recorded.
[0101] Step c2: when the storage pool type is the copy mode and any object storage device is detected to be offline, detect whether the number of currently online object storage devices in the object storage device status list is greater than a first preset number.
[0102] As can be seen from the above, the replica mode means that each placement group in the storage pool exists in several object storage devices, and the business data on them is exactly the same and is a copy of each other. Among them, if the storage pool is in replica mode, when there is only one current member left in the placement group, it is in a state close to exceeding the fault domain, because at this time the placement group is still readable and writable, but if the remaining member also fails, the data is lost, and it is judged that the placement group exceeds the fault domain. The first preset number can represent the number of placement groups when it reaches the critical value of exceeding the fault domain. When the type of the storage pool is replica mode, whenever there is an object storage device offline, it is necessary to detect whether the number of current online object storage devices in the object storage device status list is greater than the first preset number. Among them, when the number of current online object storage devices in the object storage device status list is greater than the first preset number, the fault domain of the storage pool has not been reached. When the number of current online object storage devices in the object storage device status list is not greater than the first preset number, the fault domain of the storage pool has been reached.
[0103] Step c3: if the number of current online object storage devices is not greater than the first preset number, determine information that does not belong to the current online object storage devices from the maximum number of online object storage devices determined based on the object storage device status list.
[0104] When the number of current online object storage devices in the object storage device status list is not greater than the first preset number, the fault domain of the storage pool is reached. It is then necessary to compare the online object storage device information when the last object storage device status list reached the maximum number with the information of the current online object storage device to determine the offline object storage device, that is, the first target object storage device.
[0105] Step c4: when the storage pool type is erasure coding mode and any object storage device is detected to be offline, detect whether the number of currently online object storage devices in the object storage device status list is greater than a second preset number.
[0106] The storage pool in the erasure code mode may include a storage pool in the K+M mode, which is in a state of being close to exceeding the fault domain when there are K online object storage devices remaining; wherein K refers to the number of data blocks, and M refers to the number of check blocks. Because the erasure algorithm requires at least K copies to calculate the complete data, when there are K members remaining, it is still readable and writable, but if a failure occurs, the complete data cannot be calculated, data loss occurs, and the fault domain is exceeded. The second preset number can represent the number of data blocks. Therefore, when any object storage device is detected to be offline, it is necessary to detect whether the number of current online object storage devices in the object storage device status list is greater than the second preset number. Among them, when the number of current online object storage devices in the object storage device status list is greater than the second preset number, the fault domain of the storage pool has not been reached. When the number of current online object storage devices in the object storage device status list is not greater than the first preset number, the fault domain of the storage pool has been reached.
[0107] Step c5: if the number of current online object storage devices is not greater than the second preset number, determine information that does not belong to the current online object storage devices from the maximum number of online object storage devices determined based on the object storage device status list.
[0108] When the number of current online object storage devices in the object storage device status list is not greater than the first preset number, when the fault domain of the storage pool is reached, it is necessary to compare the online object storage device information when the object storage device status list reached the maximum number last time with the information of the current online object storage device to determine the offline object storage device, that is, the first target object storage device. Taking a storage pool in 4+2 erasure coding mode as an example, the object storage devices when the group is full of members are (osd.0, osd.10, osd.20, osd.30, osd.40, osd.50), which have been recorded. At this time, osd.10 is offline due to a fault, but it does not meet the adjacent super fault domain. If osd.20 is also offline, there are only 4 members left. After comparison, osd.10 and osd.20 need to be recorded.
[0109] The method for determining the reconstruction time interval provided in the embodiment of the present application determines different matching rules by the type of storage pool, which can improve the flexibility and applicability of the matching rules. When it is detected that the object storage device is offline, it is determined whether to trigger the fault handling process by comparing whether the number of current online devices is greater than the number of corresponding matching rules, thereby improving the accuracy of triggering the fault handling process.
[0110] In order to accurately determine the automatic reconstruction time of the storage pool, in an optional implementation, the method further includes:
[0111] Step d1, obtaining the most recent offline time of the second target object storage device.
[0112] In the timer function of the cluster monitor, the second target object storage device is detected periodically (e.g., every 5 seconds), and the time of the first detection is recorded. Each offline second target object storage device records an offline time. When the second target object storage device is detected to be online, the recorded offline time is deleted. Therefore, in this way, the most recent offline time of the second target object storage device can be determined.
[0113] Step d2: Determine the storage pool reconstruction time based on the sum of the reconstruction time interval and the most recent offline time.
[0114] In the storage system, in order to maintain data redundancy and accessibility, reconstruction operations (such as RAID reconstruction, data redistribution, etc.) are automatically performed according to the reconstruction time interval. This reconstruction time interval can be fixed or dynamically adjusted according to the fault scenario. It is not specifically limited here and can be implemented by those skilled in the art.
[0115] After determining the last offline time and reconstruction time interval of the second target object storage device, the storage pool reconstruction time can be determined by the sum of the reconstruction time interval and the last offline time. For example, if the last offline time is 12:15 and the reconstruction time interval is 10 minutes, then the storage pool reconstruction time is 12:25.
[0116] Step d3: if the current offline time is the storage pool reconstruction time, the second target object storage device is kicked out of the storage pool, and automatic reconstruction of the storage pool is triggered.
[0117] The current offline time refers to the multiple offline times continuously recorded by the second target storage device after the most recent offline time. For example: the most recent offline time is 12:15, and the current offline time can be 12:16, 12:17, 12:18, until the storage pool reconstruction time is reached. Herein, it is determined whether the current offline time of the second target object storage device is the storage pool reconstruction time. If the current offline time of the second target object storage device is the storage pool reconstruction time, the second target object storage device is kicked out of the storage pool, triggering automatic reconstruction of the storage pool. At the same time, the offline time recorded by the second target object storage device is deleted.
[0118] It should be noted that, after the automatic reconstruction of the storage pool is triggered, the above steps S201 to S203 need to be executed again to trigger a cyclic execution process.
[0119] The method for determining the reconstruction time interval provided in the embodiment of the present application determines the reconstruction time by calculating the sum of the most recent offline time and the reconstruction time interval, ensuring that the storage pool is reconstructed only when the second target object device really needs to be replaced, thereby avoiding resource waste and performance degradation caused by frequent reconstruction.
[0120] In an optional embodiment, the above method further includes at least one of the following:
[0121] Step e1: when the storage pool type is the copy mode, if the number of current online object storage devices is greater than a first preset number, the offline object storage devices are deleted.
[0122] The object storage device can periodically report the placement group status to the cluster monitor, which will carry the object storage device information of the placement group. When the cluster monitor processes the placement group status reported by the object storage device periodically, it adds the object storage device information when each object storage device set is full, and deletes the recorded offline members that have not been kicked out of the storage pool. At this time, the data is in a safe redundant state. When the storage pool type is the copy mode, if there is an object storage device failure and offline, and the number of currently online object storage devices is greater than the first preset number, the offline object storage device will be deleted.
[0123] Step e2, when the storage pool type is erasure coding mode, if the number of current online object storage devices is greater than the second preset number, delete the offline object storage devices. If there is a placement group in a certain replication mode storage pool, the information of the object storage device status list of the placement group when it is full is (osd.0, osd.10, osd.20), assuming that osd.10 fails and is offline, the object storage device status list of the placement group is updated to (osd.0, osd.20).
[0124] When the storage pool type is erasure coding mode, if there is an object storage device that fails and goes offline, and the number of currently online object storage devices is greater than the second preset number, the offline object storage device is deleted. If there is a placement group in the storage pool (2+1) in erasure coding mode, the information of the object storage device status list of the placement group when it is full is (osd.0, osd.10, osd.20, osd.30), assuming that osd.10 fails and goes offline, the object storage device status list of the placement group is updated to (osd.0, osd.20, osd.30).
[0125] The method for determining the reconstruction time interval provided in the embodiment of the present application improves the availability and fault tolerance of data by maintaining multiple data. When the number of online object storage devices is greater than the first preset number, it means that even if some devices are offline, the remaining devices can still provide sufficient data, so the offline devices can be safely deleted without affecting the availability and integrity of the data, while optimizing resource utilization and improving the overall performance of the system.
[0126] Figure 4 is a method for determining a reconstruction time interval according to an embodiment of the present invention, combined with Figure 4 As shown, the method includes:
[0127] Step f1, start.
[0128] Step f2, obtaining a list of object storage device states of the object storage device reporting the placement group.
[0129] Step f3, determining whether the object storage device status list is full.
[0130] Step f4: if the object storage device status list is full, record the object storage device information when each object storage device status list is full.
[0131] Step f5: If the object storage device status list is not full, determine whether the fault scenario is a scenario close to a super fault domain.
[0132] Step f6: if the fault scenario is not a scenario close to a super fault domain, delete the second target object storage device.
[0133] Step f7: if the fault scenario is close to a super fault domain scenario, determine information that does not belong to the current online object storage device from the maximum number of online object storage devices determined based on the object storage device status list.
[0134] Step f8, end.
[0135] The method for determining the reconstruction time interval provided in the embodiment of the present application improves the availability and fault tolerance of data by maintaining multiple data. When the number of online object storage devices is greater than the first preset number, it means that even if some devices are offline, the remaining devices can still provide sufficient data. Therefore, the offline devices can be safely deleted without affecting the availability and integrity of the data, while optimizing resource utilization and improving the overall performance of the system. In addition, when it is detected that the object storage device is offline, it is determined whether to trigger the fault handling process by comparing whether the current number of online devices is greater than the number of corresponding matching rules, thereby improving the accuracy of triggering the fault handling process.
[0136] Figure 5is a method for determining a reconstruction time interval according to an embodiment of the present invention, combined with Figure 5 As shown, the method includes:
[0137] Step g1, obtaining the node corresponding to the second target object storage device.
[0138] Step g2, obtain the number of all object storage devices under the node.
[0139] Step g3, traverse and record each object storage device to determine the number of object storage devices that are offline and have not been kicked out of the storage pool.
[0140] Step g4, calculating the ratio of the number of object storage devices that are offline but not kicked out of the storage pool to the number of all object storage devices.
[0141] Step g5, setting the reconstruction time interval according to the ratio (please refer to the above steps a1 to a4 for details).
[0142] The method for determining the reconstruction time interval provided in an embodiment of the present application determines the failure scenario of the second device by analyzing the number of all object storage devices in the node where the second device is located and the number of object storage devices that are offline and have not been kicked out of the storage pool, thereby improving the comprehensiveness and accuracy of the corresponding failure scenario determined.
[0143] In this embodiment, a device for determining a reconstruction time interval is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0144] This embodiment provides a device for determining a reconstruction time interval, such as Figure 6 As shown, including:
[0145] The first determination module 601 is used to determine the first device information that matches the first target state in the object storage device state list based on the matching rule corresponding to the type of the storage pool; wherein the first target state is a state in which the first target object storage device is offline but has not been kicked out of the storage pool; the second determination module 602 is used to determine the corresponding fault scenario of the second device information based on the inclusion relationship between the first device information and the second device information; the third determination module 603 is used to determine the reconstruction time interval of the second device information based on the corresponding fault scenario.
[0146] In some optional embodiments, the second determination module 602 includes: a first determination unit, which is used to determine, from preset fault scenarios, a first fault scenario corresponding to the first device information if the first device information includes the second device information, and use the first fault scenario as the corresponding fault scenario for the second device information; a second determination unit, which is used to determine, if the first device information does not include the second device information, a set of object storage devices running on the node where the second device information is located; determine the measurement value of the second target object storage device included in the object storage device set; determine, from preset fault scenarios, a second fault scenario corresponding to the measurement value of the second target object storage device, and use the second fault scenario as the corresponding fault scenario for the second device information.
[0147] In an optional embodiment, the second determination unit includes: a first determination subunit, used to determine the ratio between the number of second target object storage devices and the total number of object storage devices in the object storage device set; a detection subunit, used to detect whether the ratio exceeds a preset ratio; a second determination subunit, used to determine a second fault scenario corresponding to the preset ratio from the preset fault scenarios if the ratio exceeds the preset ratio, and use the second fault scenario as the corresponding fault scenario for the second device information; a third determination subunit, used to determine a third fault scenario corresponding to the ratio from the preset fault scenarios if the ratio does not exceed the preset ratio, and use the second fault scenario as the corresponding fault scenario for the second device information.
[0148] In an optional implementation, the type of the storage pool includes: a replica mode and an erasure code mode; wherein the first determination module 601 includes: a recording unit, used to record information of online object storage devices when the number of online object storage devices in the object storage device status list reaches a maximum value; a first detection unit, used to detect whether the number of current online object storage devices in the object storage device status list is greater than a first preset number when the type of the storage pool is the replica mode and any object storage device is detected to be offline; a third determination unit, used to determine information that does not belong to the current online object storage device from the maximum number of online object storage devices determined based on the object storage device status list if the number of current online object storage devices is not greater than the first preset number; a second detection unit, used to detect whether the number of current online object storage devices in the object storage device status list is greater than a second preset number when the type of the storage pool is the erasure code mode and any object storage device is detected to be offline; a fourth determination unit, used to determine information that does not belong to the current online object storage device from the maximum number of online object storage devices determined based on the object storage device status list if the number of current online object storage devices is not greater than the second preset number.
[0149] In some optional embodiments, the above-mentioned device also includes: an acquisition module, used to obtain the last offline time of the second target object storage device; a fourth determination module, used to determine the storage pool reconstruction time based on the sum of the reconstruction time interval and the last offline time; a trigger module, used to kick the second target object storage device out of the storage pool if the current offline time is the storage pool reconstruction time, and trigger the automatic reconstruction of the storage pool.
[0150] In some optional embodiments, the above-mentioned device also includes: a first deletion module, which is used to delete the offline object storage device when the storage pool type is a copy mode and the number of current online object storage devices is greater than a first preset number; a second deletion module, which is used to delete the offline object storage device when the storage pool type is an erasure code mode and the number of current online object storage devices is greater than a second preset number.
[0151] In some optional implementations, the second determination unit includes: an acquisition subunit, used to acquire a mapping relationship between the node and the second target object storage device; and a fourth determination subunit, used to determine the node where the second device information is located based on the mapping relationship.
[0152] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0153] The device for determining the reconstruction time interval in this embodiment is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0154] The embodiment of the present invention also provides a computer device having the above Figure 6 The apparatus for determining the reconstruction time interval is shown.
[0155] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0156] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0157] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0158] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0159] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0160] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0161] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0162] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0163] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining a reconstruction time interval, It is characterized in that The method comprises: Based on the matching rule corresponding to the type of the storage pool, determine the first device information that matches the first target state in the object storage device state list; wherein the first target state is a state in which the first target object storage device is offline but not kicked out of the storage pool; Based on the inclusion relationship between the first device information and the second device information, determining a corresponding fault scenario of the second device information; wherein the second device information indicates a second target object storage device that is currently offline but has not been kicked out of the storage pool; Based on the corresponding fault scenario, a reconstruction time interval for the second device information is determined.
2. The method for determining the reconstruction time interval according to claim 1, It is characterized in that The determining, based on the inclusion relationship between the first device information and the second device information, a corresponding fault scenario of the second device information includes at least one of the following: If the first device information includes the second device information, determining a first fault scenario corresponding to the first device information from preset fault scenarios, and using the first fault scenario as the corresponding fault scenario of the second device information; If the second device information is not included in the first device information, determining the object storage device set running on the node where the second device information is located; determining the measurement value of the second target object storage device included in the object storage device set; A second failure scenario corresponding to the measurement value of the second target object storage device is determined from the preset failure scenarios, and the second failure scenario is used as the corresponding failure scenario of the second device information.
3. The method for determining the reconstruction time interval according to claim 2, It is characterized in that The determining, from the preset fault scenarios, a second fault scenario corresponding to the metering value of the second target object storage device, and using the second fault scenario as a corresponding fault scenario of the second device information includes: Determining a ratio between the number of the second target object storage devices and the total number of object storage devices in the object storage device set; detecting whether the ratio exceeds a preset ratio; If the ratio exceeds the preset ratio, determining a second fault scenario corresponding to the preset ratio from the preset fault scenarios, and using the second fault scenario as the corresponding fault scenario of the second device information; If the ratio does not exceed the preset ratio, a third fault scenario corresponding to the ratio is determined from the preset fault scenarios, and the second fault scenario is used as the corresponding fault scenario of the second device information.
4. The method for determining the reconstruction time interval according to any one of claims 1 to 3, It is characterized in that The types of the storage pool include: a replica mode and an erasure code mode; wherein the matching rule corresponding to the type of the storage pool is based on the matching of the first device information from the object storage device status list, including: When the number of online object storage devices in the object storage device status list reaches a maximum value, recording information of the online object storage devices; When the type of the storage pool is a copy mode and any object storage device is detected to be offline, detecting whether the number of currently online object storage devices in the object storage device status list is greater than a first preset number; If the number of the current online object storage devices is not greater than a first preset number, determining information that does not belong to the current online object storage devices from the maximum number of online object storage devices determined based on the object storage device status list; When the type of the storage pool is the erasure coding mode and any object storage device is detected to be offline, detecting whether the number of currently online object storage devices in the object storage device status list is greater than a second preset number; If the number of the current online object storage devices is not greater than a second preset number, information that does not belong to the current online object storage devices is determined from the maximum number of online object storage devices determined based on the object storage device status list.
5. The method for determining the reconstruction time interval according to any one of claims 1 to 3, It is characterized in that The method further comprises: Obtaining the most recent offline time of the second target object storage device; Determine a storage pool reconstruction time based on the sum of the reconstruction time interval and the most recent offline time; If the current offline time is the reconstruction time of the storage pool, the second target object storage device is kicked out of the storage pool, and automatic reconstruction of the storage pool is triggered.
6. The method for determining the reconstruction time interval according to claim 4, It is characterized in that The method further comprises at least one of the following: When the type of the storage pool is a copy mode, if the number of the current online object storage devices is greater than the first preset number, deleting the offline object storage devices; When the type of the storage pool is the erasure coding mode, if the number of the current online object storage devices is greater than the second preset number, the offline object storage devices are deleted.
7. The method for determining the reconstruction time interval according to claim 2, It is characterized in that The determining the node where the second device information is located includes: Acquire a mapping relationship between the node and the second target object storage device; Based on the mapping relationship, determine the node where the second device information is located.
8. A device for determining a reconstruction time interval, It is characterized in that The device comprises: A first determination module is used to determine, based on a matching rule corresponding to a storage pool type, first device information that matches a first target state in an object storage device state list; wherein the first target state is a state in which the first target object storage device is offline but has not been kicked out of the storage pool; A second determination module, configured to determine a corresponding fault scenario of the second device information based on an inclusion relationship between the first device information and the second device information; A third determination module is used to determine a reconstruction time interval of the second device information based on the corresponding fault scenario.
9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for determining the reconstruction time interval according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for determining a reconstruction time interval according to any one of claims 1 to 7.
