Main controller determination method and device and computer equipment
By detecting the abnormal controller in the disk array and determining an odd number of consensus disk groups, the problem that the main controller in the prior art cannot maintain high availability is solved, and fast main controller determination and disk array coordination in abnormal situations are achieved.
Patent Information
- Application Number
- CN202311773452.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-06-24
AI Technical Summary
The master controller determined in the prior art cannot effectively maintain high availability of disk arrays, especially when abnormal controllers occur.
After detecting an abnormal controller in the target disk array, obtain a consensus disk group with an odd number of disks, and determine the main controller based on the consensus disk group and the normal controller to coordinate the working roles of each controller.
This method enables the master controller to be quickly and consistently determined when an abnormal controller occurs, thereby maintaining high availability and load balancing of the disk array.
Smart Images

Figure CN120196570A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technologies, and in particular, to a method, an apparatus, and a computer device for determining a main controller. Background Art
[0002] Using multiple controllers in a disk array can improve the reliability and processing capacity of the disk array storage system.
[0003] In the related art, when each controller in the disk array is in a normal service state, multiple controllers work in a load balancing mode to provide high data read and write capabilities. Once an abnormal controller appears, a main controller is required to coordinate the working roles of each controller. For example, how to take over the work of the abnormal controller, or how to resume the load balancing working mode when the abnormal controller returns to normal, etc.
[0004] However, the main controller determined in the related art cannot maintain the high availability of the disk array. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method, an apparatus, and a computer device for determining a main controller. The main controller determined by using this method can maintain the high availability of the disk array.
[0006] In a first aspect, an embodiment of this application provides a method for determining a main controller, including:
[0007] When it is detected that there is an abnormal controller in the target disk array, obtain a consensus disk group in the target disk array with an odd total number of disks;
[0008] Determine the main controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
[0009] In the technical solution provided by the embodiment of this application, when it is detected that there is an abnormal controller in the target disk array, a consensus disk group with an odd total number of disks in the target disk array is obtained, and then the main controller in the target disk array is determined according to the consensus disk group and the normal controllers in the target disk array. In this method, by selecting an odd number of disks from multiple disks in the target disk array as the consensus disk group, a consistent decision on how to determine the main controller can be obtained through these odd-numbered disks, that is, a consensus main controller is determined from multiple normal controllers under the principle of the minority obeying the majority. In this way, the working roles of each controller can be coordinated through this consensus main controller to maintain the high availability of the disk array.
[0010] In one of the embodiments, the method further includes:
[0011] Detect an abnormal controller in the target disk array through the backplane of the control box of the target disk array; and / or,
[0012] Detect an abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array.
[0013] In the technical solution provided by the embodiments of the present application, an abnormal controller in the target disk array is detected through the backplane of the control box of the target disk array; and / or, an abnormal controller in the target disk array is detected through the heartbeat information sent between the controllers in the target disk array. In this method, two feasible ways to detect an abnormal controller in the target disk array are provided. On the one hand, detection is performed through the detection unit in the backplane of the control box of the target disk array, and a faulty controller can be quickly identified. On the other hand, by maintaining network heartbeats between the controllers, backup detection of faults can be performed.
[0014] In one embodiment, detecting an abnormal controller in the target disk array through the backplane of the control box of the target disk array includes:
[0015] Obtain the level information of each controller in the target disk array through the backplane of the control box;
[0016] For any controller, if the level information of the controller is not within the preset range, determine that the controller is an abnormal server.
[0017] In the technical solution provided by the embodiments of the present application, the level information of each controller in the target disk array is obtained through the backplane of the control box. For any controller, if the level information of the controller is not within the preset range, determine that the controller is an abnormal server. In this method, the power consumption of each controller is detected through the devices integrated in the backplane of the control box, so as to judge whether the service status of the controller is normal, that is, the level information of each controller is obtained through the backplane of the control box, and according to the level information of each controller, it is judged whether there is an abnormal controller.
[0018] In one embodiment, detecting an abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array includes:
[0019] For any controller, if the heartbeat information of the controller is not received by the peer controller within the preset time, determine that the controller is an abnormal controller.
[0020] In the technical solution provided by the embodiments of the present application, for any controller, if the heartbeat information of the controller is not received by the peer controller within a preset time, the controller is determined to be an abnormal controller. In this method, when two controllers send heartbeat information to each other, it can be determined whether the two controllers are in a normal service state by whether the two controllers receive the heartbeat information sent by the other party within a preset time.
[0021] In one embodiment, determining the primary controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array includes:
[0022] Obtain the quantization value of the data processing efficiency of each normal controller accessing each disk;
[0023] Determine the primary controller from each normal controller according to the quantization value of the data processing efficiency of each normal controller accessing each disk.
[0024] In the technical solution provided by the embodiments of the present application, by obtaining the quantization value of the data processing efficiency of each normal controller accessing each disk, and then determining the primary controller from each normal controller according to the quantization value of the data processing efficiency of each normal controller accessing each disk. In this method, an optional way to quickly determine the primary controller is provided. The primary controller is elected by the way that each normal controller accesses each disk in the consensus disk group, that is, by obtaining the quantization value of the data processing efficiency of each normal controller accessing each disk, analyzing and processing the quantization value of the data processing efficiency of each normal controller, so as to determine the primary controller from each normal controller.
[0025] In one embodiment, the method further includes:
[0026] When it is detected that there is a faulty disk in the consensus disk group, obtain a replacement disk from the remaining disks of the target disk array;
[0027] Replace the faulty disk with the replacement disk to obtain an updated consensus disk group.
[0028] In the technical solution provided by the embodiments of the present application, when it is detected that there is a faulty disk in the consensus disk group, obtain a replacement disk from the remaining disks of the target disk array, and then replace the faulty disk with the replacement disk to obtain an updated consensus disk group. In this method, an optional way to update the consensus disk group is provided. When there is a faulty disk in the consensus disk group, it will affect the accuracy of determining the primary controller, so it is necessary to update the faulty disk in the consensus disk group to improve the accuracy of determining the primary controller.
[0029] In one embodiment, the method further includes:
[0030] When the main controller is determined, the main controller evenly distributes the data processing tasks of the abnormal controller to the main controller and the slave controller; the slave controller represents the controller other than the main controller among the normal controllers.
[0031] In the technical solution provided by the embodiment of the present application, when the main controller is determined, the main controller evenly distributes the data processing tasks of the abnormal controller to the main controller and the slave controller, and the slave controller represents the controller other than the main controller among the normal controllers. In this method, after the main controller is determined, the main controller can coordinate the work of each controller to maintain the normal processing of each data processing task in the disk array, that is, the main controller needs to evenly distribute the data processing tasks of the abnormal controller to the normal controllers, and the normal controllers continue to process the data processing tasks originally belonging to the abnormal controller.
[0032] In one embodiment, the method further includes:
[0033] When it is detected that the abnormal controller has recovered to the normal state, send the current main controller to the controller that has recovered to the normal state;
[0034] Through the current main controller, distribute the original data processing tasks of the controller that has recovered to the normal state to the controller that has recovered to the normal state.
[0035] In the technical solution provided by the embodiment of the present application, when it is detected that the abnormal controller has recovered to the normal state, send the current main controller to the controller that has recovered to the normal state, and then through the current main controller, distribute the original data processing tasks of the controller that has recovered to the normal state to the controller that has recovered to the normal state. In this method, if it is detected that the abnormal controller has recovered to the normal state, it can apply to the main controller to join and continue to process the data processing tasks originally belonging to the abnormal controller, that is, when the abnormal controller recovers to the normal state, the working mode of the disk array storage system is restored to the load balancing working mode.
[0036] In a second aspect, the embodiment of the present application further provides a main controller determination device, including:
[0037] A disk acquisition module, configured to acquire a consensus disk group with an odd total number of disks in the target disk array when it is detected that there is an abnormal controller in the target disk array;
[0038] A main controller determination module, configured to determine the main controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
[0039] In a third aspect, an embodiment of the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps in any one of the embodiments in the first aspect are implemented.
[0040] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps in any one of the embodiments in the first aspect are implemented.
[0041] In a fifth aspect, an embodiment of the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any one of the embodiments in the first aspect are implemented.
[0042] In the above main controller determination method, device, and computer device, when it is detected that there is an abnormal controller in the target disk array, a consensus disk group with an odd total number of disks in the target disk array is obtained, and then based on the consensus disk group and the normal controllers in the target disk array, the main controller in the target disk array is determined. In this method, by selecting an odd number of disks from multiple disks in the target disk array as the consensus disk group, a consistent decision on how to determine the main controller can be obtained through these odd-numbered disks, that is, a consensus main controller is determined from multiple normal controllers under the principle of the minority obeying the majority. In this way, the work roles among the controllers can be coordinated by the consensus main controller to maintain the high availability of the disk array. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 It is the internal structure diagram of a computer device in an embodiment;
[0045] Figure 2 It is the flowchart of the main controller determination method in an embodiment;
[0046] Figure 3 It is the flowchart of detecting an abnormal controller in an embodiment;
[0047] Figure 4 It is the flowchart of determining the main controller in an embodiment;
[0048] Figure 5 Schematic flowchart of updating a consensus disk group in an embodiment;
[0049] Figure 6 Schematic flowchart of restoring the load balancing working mode in an embodiment;
[0050] Figure 7 Schematic flowchart of a master controller determination method in another embodiment;
[0051] Figure 8 Schematic structural diagram of a master controller determination device in an embodiment. Detailed implementation manners
[0052] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The master controller determination method provided by the embodiments of the present application can be applied to a computer device. The computer device can be a server, and its internal structural diagram can be as Figure 1 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store master controller determination data. The input / output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals through a network connection. When the computer program is executed by the processor, a master controller determination method is implemented. Those skilled in the art can understand that Figure 1 the structure shown in
[0054] merely shows the block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0055] When all controllers in the disk array are in the normal service state, multiple controllers work in the load balancing mode to provide high data read and write capabilities. Once an abnormal controller appears, a primary controller is required to coordinate the working roles of each controller. For example, how to take over the work of the abnormal controller, or how to resume the load balancing working mode when the abnormal controller returns to normal, etc.
[0056] In the related art, the methods for selecting a primary controller include at least the following three:
[0057] (1) Through the network message interaction between controllers, heartbeat information is sent to each other, the states of each controller and the status of the backend storage resources are synchronized, and comprehensive judgment and decision-making are carried out. This method can solve the abnormal judgment in most cases. However, when there is a large-scale network failure or downtime in the system, the state judgment of each controller will not be able to proceed.
[0058] (2) Also through the network message interaction between controllers, and at the same time based on the distributed consistency algorithm, the primary controller is elected. This method can solve the problem of quickly and correctly reaching an agreement on the value of a certain data within the cluster in a distributed system where machine downtime or network anomalies may occur, and ensure that the consistency of the entire system will not be damaged regardless of any anomalies. However, this selection algorithm itself requires the number of participating nodes to be odd, while the controllers of the disk array are generally configured in pairs, such as two controllers or four controllers, etc.
[0059] (3) Add a hardware-assisted decision-making module in the disk array frame. According to information such as the electrical level of the controller, the state of the controller is determined, and then the primary controller is determined according to the state of each controller. This method requires adding hardware to assist in judging the state of the controller, which increases the hardware failure points and does not have scalability. When both the auxiliary hardware and network communication fail, the system decision will be incorrect.
[0060] Based on this, the present application proposes a method for determining a primary controller. By selecting an odd number of disks from multiple disks of the target disk array as a consensus disk group, a consistent decision can be obtained through these odd-numbered disks on how to determine the primary controller, that is, a consensus primary controller is determined from multiple normal controllers under the principle of the minority obeying the majority. In this way, the working roles between each controller can be coordinated through the consensus primary controller to maintain the high availability of the disk array.
[0061] It should be noted that the beneficial effects or technical problems solved by the embodiments of the present application are not limited to this one, and there may also be other implicit or related problems. For specific details, please refer to the description of the following embodiments.
[0062] The following uses specific embodiments to elaborate in detail on the technical solution of the present application and how the technical solution of the present application solves the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0063] In an exemplary embodiment, as Figure 2 shown, a method for determining a master controller is provided. Taking the example that this method is applied to a computer device, it includes the following steps 201 to step 202. Among them:
[0064] S201, when it is detected that there is an abnormal controller in the target disk array, obtain a consensus disk group with an odd number of disks in the target disk array.
[0065] A disk array is composed of many independent disks combined into a disk group with a huge capacity. The target disk array refers to the disk array for which the master controller needs to be determined.
[0066] The controller of a disk array is the brain of the disk array, including a central processing unit (CPU), a cache, and a fiber channel, etc., mainly used to implement data storage and forwarding and the management of the entire disk array.
[0067] In practical applications, using multiple controllers in a disk array can improve the reliability and processing power of the disk array storage system. When there are multiple controllers in the target disk array for processing data, it is necessary to detect in real time whether each controller is in a normal service state. Optionally, a status monitoring device can be used to monitor the status of each controller in the target disk array. If the status monitoring device determines that a certain controller is in an abnormal state, then determine that controller as an abnormal controller.
[0068] When it is detected that there is an abnormal controller in the target disk array, it is necessary to obtain a certain odd number of disks as a consensus disk group.
[0069] In one embodiment, obtaining the consensus disk group in the target disk array can be randomly selecting an odd number of disks and taking the selected multiple disks as the consensus disk group, or using a certain selection logic to select an odd number of disks and taking the selected multiple disks as the consensus disk group.
[0070] For example, for all the disks in the target disk array, the current disk usage rate of each disk can be obtained, and an odd number of disks can be selected according to the current disk usage rate of each disk. For example, according to the current disk usage rate of each disk, the disks are sorted in ascending order, and the first three disks are selected as the consensus disk group.
[0071] It should be noted that the number of disks in the consensus disk group is variable and can be determined according to actual requirements. When determining the primary controller each time, the specific number of disks in the consensus disk group can be the same as or different from that of the previous time, which is not limited herein.
[0072] S202. Determine the primary controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
[0073] When there is an abnormal controller in the target disk array, it is necessary to select a controller from the normal controllers in the target disk array as the primary controller to direct the behavior of each controller in the system.
[0074] Based on the obtained consensus disk group and the normal controllers in the target disk array, the primary controller can be determined from the normal controllers.
[0075] Exemplarily, the primary controller can be determined from each normal controller by accessing each disk in the consensus disk group through each normal controller. For example, each normal controller can write data to each disk, and the primary controller is determined from each normal controller according to the speed of writing data to each disk by each normal controller.
[0076] In the method for determining the primary controller provided by the embodiments of the present application, when it is detected that there is an abnormal controller in the target disk array, a consensus disk group with an odd total number of disks in the target disk array is obtained, and then the primary controller in the target disk array is determined according to the consensus disk group and the normal controllers in the target disk array. In this method, by selecting an odd number of disks from multiple disks in the target disk array as the consensus disk group, a consistent decision on how to determine the primary controller can be obtained through these odd-numbered disks, that is, a consensus primary controller is determined from multiple normal controllers under the principle of the minority obeying the majority. In this way, the working roles of each controller can be coordinated by the consensus primary controller to maintain the high availability of the disk array.
[0077] The need to determine the primary controller is because there is a controller with an abnormal service state in the target disk array, and a primary controller is needed to direct the behavior of each controller in the system. To determine whether there is an abnormal controller in the target disk array, it is necessary to detect the controllers in the target disk array. Based on this, in an exemplary embodiment, how to detect the abnormal controller in the target disk array may include the following steps:
[0078] Detect the abnormal controller in the target disk array through the control frame backplane of the target disk array; and / or, detect the abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array.
[0079] Among them, the control frame refers to the frame that houses the controller, provides storage services externally, and is the core component in the storage system. The control frame adopts a component modular design and usually includes a system chassis, a controller (including a fan module), a baseband processing unit, a power module, a management module, an interface module, etc. The control frame backplane is the printed circuit board of the control frame, which is used to support the interconnection between devices and provide power and data signals for the supported devices.
[0080] The heartbeat information refers to a data packet with a pre-defined format, which is used to determine whether the other party (device, process, or other network element, etc.) is operating normally.
[0081] In the embodiments of the present application, there are two ways to detect abnormal controllers in the target disk array. A detection unit for detecting the service status of the controller can be integrated on the control frame backplane. By using the detection unit to detect each controller in the target disk array, the detection unit can obtain the status information of each controller, and determine whether there is an abnormal controller according to the status information of each controller.
[0082] In addition, each controller can send heartbeat information to each other to determine whether the peer controller is in a normal state. Optionally, the heartbeat information sending period and the custom heartbeat information content can be preset in advance. When the heartbeat information sending period is satisfied, each controller sends heartbeat information to each other. Taking two controllers as a group, for a certain controller, if the controller does not receive the heartbeat information from the peer controller, it means that the service status of the peer controller is abnormal, that is, the peer controller is an abnormal controller.
[0083] It should be noted that in the embodiments of the present application, whether an abnormal controller is detected through the first method or the second method, a determination request for the main controller needs to be issued.
[0084] In the main controller determination method provided by the embodiments of the present application, an abnormal controller in the target disk array is detected through the control frame backplane of the target disk array; and / or, an abnormal controller in the target disk array is detected through the heartbeat information sent between each controller in the target disk array. In this method, two feasible ways to detect abnormal controllers in the target disk array are provided. On the one hand, by using the detection unit in the control frame backplane of the target disk array for detection, the faulty controller can be quickly identified. On the other hand, by maintaining network heartbeats between each controller, a fallback detection of the fault can be performed.
[0085] Generally, a complex programmable logic device is integrated in the control box backplane, which can detect whether the power consumption of each controller is normal, so as to determine whether the controller is in a normal working state. Based on this, in an exemplary embodiment, as Figure 3 shown, by means of the control box backplane of the target disk array, detecting abnormal controllers in the target disk array includes steps 301 to 302. Among them:
[0086] S301, obtaining the level information of each controller in the target disk array through the control box backplane.
[0087] Among them, the level refers to the logarithm of the ratio of two powers or voltages, and sometimes can also be used to represent the logarithm of the ratio of two currents.
[0088] In the embodiment of the present application, a complex programmable logic device is integrated in the control box backplane, which can detect whether the power consumption of each controller is normal, that is, the complex programmable logic device in the control box backplane can obtain the level information of each controller in the target disk array in real time.
[0089] S302, for any controller, if the level information of the controller is not within the preset range, determine that the controller is an abnormal server.
[0090] After obtaining the level information of each controller, the level information of each controller can be compared with the preset range. If the level information is not within the preset range, it means that there is an abnormality in the controller. For any controller, if the level information of the controller is not within the preset range, determine that the controller belongs to an abnormal controller.
[0091] In the main controller determination method provided by the embodiment of the present application, the level information of each controller in the target disk array is obtained through the control box backplane. For any controller, if the level information of the controller is not within the preset range, determine that the controller is an abnormal server. In this method, the power consumption of each controller is detected through the device integrated in the control box backplane, so as to judge whether the service state of the controller is normal, that is, the level information of each controller is obtained through the control box backplane, and according to the level information of each controller, it is judged whether there is an abnormal controller.
[0092] Heartbeat information is sent between two devices to judge whether the other device is in a normal working state by whether the heartbeat information of the other device is received. Based on this, in an exemplary embodiment, by sending heartbeat information between the controllers in the target disk array, detecting abnormal controllers in the target disk array may include the following steps:
[0093] For any controller, if the heartbeat information of the controller is not received by the peer controller within the preset time, determine that the controller is an abnormal controller.
[0094] Take two controllers as a group. If one controller is the local controller, then the other controller is the peer controller.
[0095] In the embodiments of the present application, take any two controllers as a group, and the two controllers send heartbeat information to each other. For any one of the controllers, if the heartbeat information of the controller is not received by the peer controller within the preset time, it is determined that the controller is an abnormal controller.
[0096] In the master controller determination method provided by the embodiments of the present application, for any controller, if the heartbeat information of the controller is not received by the peer controller within the preset time, it is determined that the controller is an abnormal controller. In this method, when the two controllers send heartbeat information to each other, it can be determined whether the two controllers are in the normal service state by whether the two controllers receive the heartbeat information sent by the other party within the preset time.
[0097] After obtaining the consensus disk group, the master controller can be elected by the way that each normal controller accesses each disk in the consensus disk group. Based on this, in an exemplary embodiment, as Figure 4 shown, determining the master controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array includes the following steps 401 to 402. Wherein:
[0098] S401, obtain the data processing efficiency quantization value of each normal controller accessing each disk.
[0099] Among them, accessing the disk can be understood as the controller writing data on the disk. The data processing efficiency quantization value refers to the write data efficiency score of the controller, which can be expressed as a percentage. The larger the value, the higher the data processing efficiency.
[0100] Exemplarily, a write data instruction can be sent to each normal controller. After each controller receives the write data instruction, it writes data to each disk in the consensus disk group within the preset time. After completion, the data processing efficiency of each normal controller is quantified to obtain the data processing efficiency quantization value of each normal controller accessing each disk.
[0101] S402, determine the master controller from each normal controller according to the data processing efficiency quantization value of each normal controller accessing each disk.
[0102] After obtaining the data processing efficiency quantization value of each normal controller accessing each disk, the master controller can be determined from each normal controller based on each data processing efficiency quantization value.
[0103] Optionally, the data processing efficiency quantization values of each normal controller accessing each disk can be input into a pre-trained main controller determination model. The main controller determination model analyzes the data processing efficiency quantization values of each normal controller accessing each disk to obtain the main controller. Among them, the main controller determination model can be a pre-trained neural network model. Optionally, the main controller determination model can be constructed by network models such as an error backpropagation neural network, a recurrent neural network, a deep neural network, and a convolutional neural network.
[0104] Optionally, a preset analysis and processing logic can be adopted to analyze and process the data processing efficiency quantization values of each normal controller accessing each disk, so as to determine the main controller from each normal controller. For example, for any normal controller, the data processing efficiency quantization values of the normal controller accessing each disk can be summed and averaged to obtain the comprehensive data processing efficiency quantization value of the normal controller; furthermore, according to the comprehensive data processing efficiency quantization values of each normal controller, the normal controller with the largest comprehensive data processing efficiency quantization value can be used as the main controller.
[0105] In the main controller determination method provided in the embodiments of the present application, by obtaining the data processing efficiency quantization values of each normal controller accessing each disk, and then determining the main controller from each normal controller according to the data processing efficiency quantization values of each normal controller accessing each disk. In this method, an optional way to quickly determine the main controller is provided. The main controller is elected by the way that each normal controller accesses each disk in the consensus disk group, that is, by obtaining the data processing efficiency quantization values of each normal controller accessing each disk, analyzing and processing the data processing efficiency quantization values of each normal controller, so as to determine the main controller from each normal controller.
[0106] If there is a faulty disk in the consensus disk group, it will affect the accuracy of the main controller determination. That is, when there is a faulty disk, it is necessary to update the faulty disk in the consensus disk group. Based on this, in an exemplary embodiment, an optional way to update the consensus disk group is provided, including the following steps 501 to 502. Among them:
[0107] S501, in the case of detecting that there is a faulty disk in the consensus disk group, obtain a replacement disk from the remaining disks of the target disk array.
[0108] If it is detected that there is a faulty disk in the consensus disk group, it is necessary to obtain a disk to replace the faulty disk from the remaining disks of the target disk array.
[0109] Optionally, for the selection of the replacement disk, any disk can be randomly selected as the replacement disk, or a certain selection logic can be adopted to select the replacement disk.
[0110] For example, for the remaining disks in the target disk array, the current disk utilization rate of each remaining disk can be obtained, and the disk with a low current disk utilization rate can be used as a replacement disk.
[0111] It should be noted that the number of replacement disks can be the same as or different from the number of failed disks. If the number of selected replacement disks is different from the number of failed disks, the total number of replacement disks and normal disks still needs to be odd.
[0112] S502: Replace the failed disks with the replacement disks to obtain an updated consensus disk group.
[0113] After obtaining the replacement disks, replace the failed disks in the consensus disk group with the obtained replacement disks, that is, an updated consensus disk group is obtained.
[0114] In the master controller determination method provided by the embodiments of the present application, when it is detected that there are failed disks in the consensus disk group, replacement disks are obtained from the remaining disks of the target disk array, and then the replacement disks are used to replace the failed disks to obtain an updated consensus disk group. In this method, an optional way to update the consensus disk group is provided. When there are failed disks in the consensus disk group, it will affect the accuracy of master controller determination, so the failed disks in the consensus disk group need to be updated to improve the accuracy of master controller determination.
[0115] After determining the master controller, the master controller can coordinate the work of each controller. Based on this, in an exemplary embodiment, an optional way to allocate tasks by the master controller is provided, which may include the following steps:
[0116] When the master controller is determined, the data processing tasks of the abnormal controller are evenly distributed to the master controller and the slave controllers by the master controller.
[0117] In the embodiments of the present application, the slave controller refers to a controller other than the master controller among the normal controllers.
[0118] After determining the master controller, the master controller needs to re-allocate the data processing tasks after the failure scenario.
[0119] When the master controller is determined, the master controller obtains the data processing tasks of the abnormal controller and evenly distributes the data processing tasks of the abnormal controller to the master controller and the slave controllers, that is, the master controller evenly distributes the data processing tasks of the abnormal controller to the normal controllers, and the normal controllers continue to process the data processing tasks originally belonging to the abnormal controller.
[0120] It should be noted that if the original master controller fails in the election, an exit operation needs to be performed to facilitate the new master controller to reallocate the data processing tasks. For the newly elected master controller, it will reallocate the data processing tasks.
[0121] In the master controller determination method provided by the embodiments of the present application, when the master controller is determined, the master controller evenly distributes the data processing tasks of the abnormal controller to the master controller and the slave controllers. The slave controllers refer to the controllers among the normal controllers other than the master controller. In this method, after the master controller is determined, the master controller can coordinate the work of each controller to maintain the normal processing of each data processing task in the disk array. That is, the master controller needs to evenly distribute the data processing tasks of the abnormal controller to the normal controllers, and the normal controllers continue to process the data processing tasks originally belonging to the abnormal controller.
[0122] After the abnormal controller returns to the normal state, it can apply to the master controller to join and continue to process the data processing tasks originally belonging to the abnormal controller. That is, when the abnormal controller returns to normal, the system is restored to the load balancing working mode. Based on this, in an exemplary embodiment, as Figure 6 shown, an optional method for restoring the working mode of the disk array storage system to the load balancing working mode is provided, including step 601 to step 602. Among them:
[0123] S601, when it is detected that the abnormal controller has returned to the normal state, send the current master controller to the controller that has returned to the normal state.
[0124] In the embodiments of the present application, if the abnormal controller returns to the normal state, it can participate in the subsequent election of the master controller. If there is still a master controller currently and there is no need for a re-election, the current master controller can be informed to the controller that has returned to the normal state, so as to determine through the current master controller whether to allocate back the data processing tasks originally belonging to the abnormal controller.
[0125] S602, through the current master controller, allocate the original data processing tasks of the controller that has returned to the normal state to the controller that has returned to the normal state.
[0126] If the current master controller determines that the controller that has returned to the normal state can continue to process the tasks, it can allocate back the original data processing tasks of the controller that has returned to the normal state to the controller that has returned to the normal state for processing to achieve the purpose of balance.
[0127] In the main controller determination method provided by the embodiments of the present application, when it is detected that an abnormal controller has recovered to the normal state, the current main controller is sent to the controller that has recovered to the normal state. Then, through the current main controller, the original data processing tasks of the controller that has recovered to the normal state are assigned to the controller that has recovered to the normal state. In this method, if it is detected that an abnormal controller has recovered to the normal state, it can apply to the main controller to join and continue to process the data processing tasks originally belonging to the abnormal controller. That is, when the abnormal controller recovers to the normal state, the working mode of the disk array storage system is restored to the load balancing working mode.
[0128] In addition, in an exemplary embodiment, the present application also provides an alternative example of the main controller determination method, as Figure 7 shown, which may include the following steps:
[0129] S701, detecting an abnormal controller in the target disk array through the control frame backplane of the target disk array; and / or, detecting an abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array.
[0130] S702, when it is detected that there is an abnormal controller in the target disk array, obtaining a consensus disk group with an odd total number of disks in the target disk array.
[0131] S703, obtaining the data processing efficiency quantization values of each normal controller accessing each disk.
[0132] S704, determining the main controller from each normal controller according to the data processing efficiency quantization values of each normal controller accessing each disk.
[0133] The processes of S701 - S704 above can refer to the description of the method embodiments above. Their implementation principles and technical effects are similar and will not be elaborated here.
[0134] It should be understood that although the steps in the flowcharts involved in the above - mentioned embodiments are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above - mentioned embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0135] Based on the same inventive concept, an embodiment of the present application further provides a main controller determination device for implementing the main controller determination method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the main controller determination device provided below can refer to the limitations on the main controller determination method in the foregoing, and will not be repeated here.
[0136] In an exemplary embodiment, as Figure 8 shown, a main controller determination device 1 is provided, including: a disk acquisition module 10 and a main controller determination module 20, where:
[0137] The disk acquisition module 10 is configured to, when detecting an abnormal controller in the target disk array, acquire a consensus disk group with an odd number of disks in the target disk array;
[0138] The main controller determination module 20 is configured to determine the main controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
[0139] In one of the embodiments, the above main controller determination device 1 further includes:
[0140] An abnormal controller detection module, configured to detect an abnormal controller in the target disk array through the control frame backplane of the target disk array; and / or, detect an abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array.
[0141] In one of the embodiments, the above abnormal controller detection module is further configured to:
[0142] Acquire the level information of each controller in the target disk array through the control frame backplane; for any controller, if the level information of the controller is not within the preset range, determine that the controller is an abnormal server.
[0143] In one of the embodiments, the above abnormal controller detection module is further configured to:
[0144] For any controller, if the heartbeat information of the controller is not received by the peer controller within the preset time, determine that the controller is an abnormal controller.
[0145] In one of the embodiments, the above main controller determination module 20 is further configured to:
[0146] Acquire the data processing efficiency quantization values of each normal controller accessing each disk; determine the main controller from each normal controller according to the data processing efficiency quantization values of each normal controller accessing each disk.
[0147] In one embodiment, the above-mentioned main controller determination device 1 further includes:
[0148] A replacement disk acquisition module, configured to acquire a replacement disk from the remaining disks of the target disk array when it is detected that there is a faulty disk in the consensus disk group;
[0149] A disk group update module, configured to replace the faulty disk with the replacement disk to obtain an updated consensus disk group.
[0150] In one embodiment, the above-mentioned main controller determination device 1 further includes:
[0151] A first allocation module, configured to, when the main controller is determined, evenly allocate the data processing tasks of the abnormal controller to the main controller and the slave controllers through the main controller; the slave controller represents a controller other than the main controller among the normal controllers.
[0152] In one embodiment, the above-mentioned main controller determination device 1 further includes:
[0153] A controller sending module, configured to send the current main controller to the controller that has returned to the normal state when it is detected that the abnormal controller has returned to the normal state;
[0154] A second allocation module, configured to allocate the original data processing tasks of the controller that has returned to the normal state to the controller that has returned to the normal state through the current main controller.
[0155] Each module in the above-mentioned main controller determination device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0156] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0157] When it is detected that there is an abnormal controller in the target disk array, acquire a consensus disk group with an odd total number of disks in the target disk array;
[0158] Determine the main controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
[0159] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0160] Detect an abnormal controller in the target disk array through the backplane of the control frame of the target disk array; and / or, detect an abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array.
[0161] In one embodiment, when the processor executes the logic in the computer program to detect an abnormal controller in the target disk array through the backplane of the control frame of the target disk array, the following steps are specifically implemented:
[0162] Obtain the level information of each controller in the target disk array through the backplane of the control frame; for any controller, if the level information of the controller is not within the preset range, determine that the controller is an abnormal server.
[0163] In one embodiment, when the processor executes the logic in the computer program to detect an abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array, the following steps are specifically implemented:
[0164] For any controller, if the heartbeat information of the controller is not received by the peer controller within the preset time, determine that the controller is an abnormal controller.
[0165] In one embodiment, when the processor executes the logic in the computer program to determine the primary controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array, the following steps are specifically implemented:
[0166] Obtain the quantization value of the data processing efficiency of each normal controller accessing each disk; determine the primary controller from each normal controller according to the quantization value of the data processing efficiency of each normal controller accessing each disk.
[0167] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0168] In the case of detecting a faulty disk in the consensus disk group, obtain a replacement disk from the remaining disks of the target disk array; replace the faulty disk with the replacement disk to obtain an updated consensus disk group.
[0169] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0170] In the case of determining the primary controller, evenly distribute the data processing tasks of the abnormal controller to the primary controller and the slave controllers through the primary controller; the slave controllers refer to the controllers other than the primary controller among the normal controllers.
[0171] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0172] When it is detected that an abnormal controller has recovered to the normal state, send the current master controller to the controller that has recovered to the normal state; through the current master controller, allocate the original data processing tasks of the controller that has recovered to the normal state to the controller that has recovered to the normal state.
[0173] For the computer device provided above, the principles and specific processes in implementing each embodiment can be referred to the descriptions in the embodiments of the master controller determination method in the foregoing embodiments, and will not be elaborated here.
[0174] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0175] When it is detected that there is an abnormal controller in the target disk array, obtain a consensus disk group with an odd total number of disks in the target disk array;
[0176] Determine the master controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] Detect the abnormal controller in the target disk array through the control frame backplane of the target disk array; and / or, detect the abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array.
[0179] In one of the embodiments, when the logic of detecting the abnormal controller in the target disk array through the control frame backplane of the target disk array in the computer program is executed by the processor, the following steps are specifically implemented:
[0180] Obtain the level information of each controller in the target disk array through the control frame backplane; for any controller, if the level information of the controller is not within the preset range, determine that the controller is an abnormal server.
[0181] In one of the embodiments, when the logic of detecting the abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array in the computer program is executed by the processor, the following steps are specifically implemented:
[0182] For any controller, if the heartbeat information of the controller is not received by the peer controller within the preset time, determine that the controller is an abnormal controller.
[0183] In one of the embodiments, when the logic of determining the master controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array in the computer program is executed by the processor, the following steps are specifically implemented:
[0184] Obtain the quantization value of the data processing efficiency of each normal controller accessing each disk; determine the master controller from each normal controller according to the quantization value of the data processing efficiency of each normal controller accessing each disk.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0186] In the case of detecting a faulty disk in the consensus disk group, obtain a replacement disk from the remaining disks of the target disk array; replace the faulty disk with the replacement disk to obtain an updated consensus disk group.
[0187] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0188] In the case of determining the master controller, evenly distribute the data processing tasks of the abnormal controller to the master controller and the slave controllers through the master controller; the slave controllers refer to the controllers other than the master controller among the normal controllers.
[0189] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0190] When detecting that an abnormal controller has recovered to the normal state, send the current master controller to the controller that has recovered to the normal state; through the current master controller, allocate the original data processing tasks of the controller that has recovered to the normal state to the controller that has recovered to the normal state.
[0191] For the computer-readable storage medium provided above, the principles and specific processes in implementing each embodiment can be referred to the descriptions in the embodiments of the master controller determination method in the foregoing embodiments, and will not be elaborated here.
[0192] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0193] In the case of detecting an abnormal controller in the target disk array, obtain a consensus disk group with an odd total number of disks in the target disk array;
[0194] Determine the master controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
[0195] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0196] Detect the abnormal controller in the target disk array through the control box backplane of the target disk array; and / or, detect the abnormal controller in the target disk array through the heartbeat information sent between each controller in the target disk array.
[0197] In one embodiment, when the logic for detecting an abnormal controller in a target disk array through the backplane of a control box of a computer program is executed by a processor, the following steps are specifically implemented:
[0198] Obtain the level information of each controller in the target disk array through the backplane of the control box; for any controller, if the level information of the controller is not within a preset range, determine that the controller is an abnormal server.
[0199] In one embodiment, when the logic for detecting an abnormal controller in a target disk array through heartbeat information sent between controllers in the target disk array of a computer program is executed by a processor, the following steps are specifically implemented:
[0200] For any controller, if the heartbeat information of the controller is not received by the peer controller within a preset time, determine that the controller is an abnormal controller.
[0201] In one embodiment, when the logic for determining a primary controller in a target disk array according to a consensus disk group and normal controllers in the target disk array is executed by a processor, the following steps are specifically implemented:
[0202] Obtain the data processing efficiency quantization values of each normal controller for accessing each disk; determine the primary controller from the normal controllers according to the data processing efficiency quantization values of each normal controller for accessing each disk.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0204] In the case of detecting a faulty disk in the consensus disk group, obtain a replacement disk from the remaining disks of the target disk array; replace the faulty disk with the replacement disk to obtain an updated consensus disk group.
[0205] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0206] In the case of determining a primary controller, evenly distribute the data processing tasks of the abnormal controller to the primary controller and the slave controllers through the primary controller; the slave controllers represent the controllers other than the primary controller among the normal controllers.
[0207] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0208] When it is detected that an abnormal controller has recovered to the normal state, send the current master controller to the controller that has recovered to the normal state; through the current master controller, allocate the original data processing tasks of the controller that has recovered to the normal state to the controller that has recovered to the normal state.
[0209] For the computer program product provided above, the principles and specific processes in implementing the embodiments can be referred to the descriptions in the embodiments of the master controller determination method in the foregoing embodiments, and will not be elaborated here.
[0210] It should be noted that the data involved in this application (including but not limited to the data for analysis, stored data, displayed data, etc.) are all information and data that have been authorized or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0211] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0212] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0213] The above-described embodiments merely represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for determining a main controller, characterized in that, The method includes: When detecting that there is an abnormal controller in the target disk array, obtaining a consensus disk group in the target disk array where the total number of disks is odd; Determining the primary controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
2. The method according to claim 1, wherein The method further includes: Detecting the abnormal controller in the target disk array through the control frame backplane of the target disk array; and / or, Detecting the abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array.
3. The method according to claim 2, wherein The detecting the abnormal controller in the target disk array through the control frame backplane of the target disk array includes: Obtaining the level information of each controller in the target disk array through the control frame backplane; For any controller, if the level information of the controller is not within the preset range, determining that the controller is an abnormal server.
4. The method according to claim 2, wherein The detecting the abnormal controller in the target disk array through the heartbeat information sent between the controllers in the target disk array includes: For any controller, if the heartbeat information of the controller is not received by the peer controller within the preset time, determining that the controller is an abnormal controller.
5. The method according to any one of claims 1-4, characterized in that, The determining the primary controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array includes: Obtaining the quantization value of the data processing efficiency of each normal controller accessing each of the disks; Determining the primary controller from the normal controllers according to the quantization values of the data processing efficiency of each normal controller accessing each of the disks.
6. The method according to any one of claims 1-4, characterized in that The method further includes: When detecting that there is a faulty disk in the consensus disk group, obtaining a replacement disk from the remaining disks in the target disk array; Replacing the faulty disk with the replacement disk to obtain an updated consensus disk group.
7. The method according to any one of claims 1 to 4, characterized in that The method further includes: When the primary controller is determined, evenly distributing the data processing tasks of the abnormal controller to the primary controller and the slave controllers through the primary controller; the slave controllers refer to the controllers other than the primary controller among the normal controllers.
8. The method according to any one of claims 1 to 4, characterized in that, The method further includes: When detecting that the abnormal controller has recovered to the normal state, sending the current primary controller to the controller that has recovered to the normal state; Through the current primary controller, distributing the original data processing tasks of the controller that has recovered to the normal state to the controller that has recovered to the normal state.
9. A main controller determination device, characterized in that, The device includes: A disk obtaining module, configured to obtain a consensus disk group in the target disk array where the total number of disks is odd when detecting that there is an abnormal controller in the target disk array; A primary controller determining module, configured to determine the primary controller in the target disk array according to the consensus disk group and the normal controllers in the target disk array.
10. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.