A database high-availability cluster split-brain protection method, device and medium
By employing multi-dimensional state awareness and hierarchical response strategies, the split-brain problem in PostgreSQL high-availability clusters during network partitioning is resolved, achieving highly accurate leader election decisions and service continuity, and adapting to complex network environments.
Patent Information
- Application Number
- CN202610748380.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-07-07
AI Technical Summary
Existing PostgreSQL high-availability cluster solutions lack network topology awareness, communication quality quantification, state cross-validation, and hierarchical isolation strategies, making them prone to cluster split-brain, false failover, and data inconsistency issues when there are network partitions or communication anomalies.
A multi-dimensional state awareness mechanism is adopted, which performs weighted calculation and visibility consensus verification based on node state parameters in the regional, communication and time dimensions. Combined with a hierarchical response strategy, a new master node is elected to avoid accidental switching and data inconsistency.
It improves the accuracy of leader election decisions in network partitioning scenarios, reduces the risk of business interruption, ensures service continuity and data consistency, and adapts to complex network topologies.
Smart Images

Figure CN122348894A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database high availability cluster technology, and in particular to a method, device and medium for preventing split-brain attacks in database high availability clusters. Background Technology
[0002] In current PostgreSQL database high availability solutions, network communication is frequently disrupted due to issues such as operating system resource exhaustion, network communication failures, system crashes, and power outages. Existing high availability solutions automatically trigger a high availability cluster election mechanism in the event of a network failure communicating with the master node, which could potentially lead to a split-brain scenario within the high availability cluster.
[0003] The existing technical solutions have the following main technical defects: First, the traditional Quorum mechanism determines the majority based solely on the number of nodes, lacking network topology awareness. During network partitioning, it is easy to elect a master in a poor-quality partition, leading to service failure. Second, the binary reachability judgment method does not quantify communication indicators such as latency, packet loss rate, and bandwidth. When there is network jitter or intermittent failure, it is easy to misjudge and trigger invalid switching. Third, the Fencing mechanism is too aggressive, directly shutting down suspected faulty nodes without a gradual degradation strategy. When the network is unstable, it is easy to mistakenly kill normal nodes. Fourth, it lacks cross-validation of the original master state, relies on single-node probing during election, and lacks a multi-node consensus mechanism. After partition recovery, dual-master conflicts are likely to occur, leading to data inconsistency.
[0004] In summary, existing solutions are not suitable for complex network scenarios, pose a high risk of cluster split-brain, and make it difficult to guarantee system availability and business continuity. Summary of the Invention
[0005] This invention provides a method, device, and medium for preventing brain split in high-availability database clusters, which addresses the following technical problems: Existing PostgreSQL high-availability cluster solutions are prone to cluster brain split, false failover, and data inconsistency issues due to a lack of network topology awareness, communication quality quantification, state cross-validation, and hierarchical isolation strategies when there are network partitions or communication anomalies.
[0006] The embodiments of the present invention adopt the following technical solutions: On one hand, embodiments of the present invention provide a method for preventing brain split in a high-availability database cluster, the method comprising: after the current cluster triggers a leader election process, detecting the communicable nodes in the current cluster; Perform multi-dimensional quality sensing on the communicable nodes to obtain the corresponding node status parameters; The weighted values are obtained by performing a weighted calculation based on the node state parameters. If the weighted value reaches the first preset threshold, then visibility consensus verification is performed on each communicable node; After the visibility consensus verification is passed, candidate leader regions are determined based on the region-aware leader selection strategy; A new master node is elected in the candidate master region according to the hierarchical response strategy.
[0007] In one feasible implementation, after the current cluster triggers the leader election process, the communicable nodes in the current cluster are probed, specifically including: In a network partitioning scenario, a master node election process is triggered in the current cluster. The communication nodes in the current cluster are detected using a detection tool, and the status change trend of each communication node is tracked through a historical visibility sliding window.
[0008] In one feasible implementation, multi-dimensional quality sensing is performed on the communicable node to obtain corresponding node state parameters, specifically including: The node state parameters of each communicable node are described by a multidimensional state vector; wherein, the multidimensional state vector includes: a region dimension vector, a communication dimension vector, and a time dimension vector; The region dimension vector is used to describe the availability zone or data center identifier to which the node belongs; the communication dimension vector is used to describe the node's communication quality score; and the time dimension vector is used to describe the node's status change trend recorded in the historical visibility sliding window.
[0009] In one feasible implementation, a weighted calculation is performed based on the node state parameters to obtain a weighted value, specifically including: Based on Weighted_Quorum=Σ(node_weight×visibility_score), calculate the weighted value of the state parameters of all communicable nodes, Weighted_Quorum; Among them, node_weight = Base_Weight×(1 + Zone_Priority_Factor); Base_Weight is the base weight of a communicable node; Zone_Priority_Factor is the zone priority factor of a communicable node; and visibility_score is the visibility score of a communicable node.
[0010] In one feasible implementation, if the weighted value reaches a first preset threshold, then visibility consensus verification is performed on each communicable node, specifically including: The weighted value is compared with a first preset threshold. If the weighted value is less than the first preset threshold, the election ends. If the weighted value is greater than or equal to the first preset threshold, the original master node status is verified by a multi-node cross-validation method. By broadcasting a pre-election request to all visible nodes through each communicable node, the visibility status of each communicable node to the original master node is obtained, and the consistency of the last_visible_time timestamps reported by each communicable node is verified. The leader election process is only allowed when a majority of communicable nodes determine that the original master node is not visible.
[0011] In one feasible implementation, after the visibility consensus verification is passed, candidate leader selection regions are determined based on a region-aware leader selection strategy, specifically including: The communicable nodes are used as candidate nodes to obtain a candidate node set C, and the regional information Z of each candidate node is collected. Calculate the communication quality score Q for each candidate node based on the communication dimension vector in the node state parameters of each candidate node; The candidate node set C is grouped according to its region, resulting in Groups=GroupBy(C,Z); For each group, calculate the average communication quality Avg_Q(g) and the group weight Weight(g); where the group weight is the sum of the node weights of all candidate nodes in the group; Based on the average communication quality within the group and the group weight, the candidate primary selection region is determined: Candidate_Zones = {g | Weight(g)>= Quorum_Threshold}; where Quorum_Threshold is the first preset threshold.
[0012] In one feasible implementation, a new master node is elected in the candidate master region according to a hierarchical response strategy, specifically including: Detect whether there is a visible original master node in the candidate master selection area. If there is, elect the visible original master node as the new master node. If there is no visible original master node and there is only one candidate master region, then the node with the highest communication quality score in the candidate master region is elected as the new master node. If there is more than one candidate master region, compare the average communication quality within each candidate master region and select the node with the highest communication quality score in the region with the highest average communication quality within the group as the new master node. If the average communication quality difference within each candidate master region is lower than the second preset threshold, then the node with the highest communication quality score in the region with a larger group weight is selected as the new master node; the database deployed in the new master node is the master database.
[0013] In one feasible implementation, the hierarchical response strategy specifically includes: Level 1: The original primary database is healthy and reachable. At this time, the primary election process is not triggered, the status quo is maintained and the log is recorded. Level 2: The original master database latency increases but it is not lost. At this time, the master election process is not triggered, but the synchronous replication check is triggered to prepare the switchover plan and increase the detection frequency. Level 3: The original master database is unreachable but may be alive. At this time, the master election process is triggered, and isolation measures are implemented on the original master database to prohibit new connections, maintain the replication stream, and maintain read-only service. Level 4: Confirm the failure of the original master database. At this point, the master election process is triggered, and the PostgreSQL process of the original master database is gracefully shut down. Level 5: There is a risk of split-brain that cannot be handled gracefully, triggering the STONITH isolation mechanism to force a power outage on the current cluster.
[0014] On the other hand, embodiments of the present invention also provide a database high-availability cluster split-brain protection device, the device comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, enabling the at least one processor to execute the aforementioned database high-availability cluster split-brain protection method.
[0015] Finally, this embodiment of the invention also provides a storage medium, which is a non-volatile computer-readable storage medium storing at least one program, each program including instructions, which, when executed by a terminal, cause the terminal to execute the aforementioned database high-availability cluster split-brain protection method.
[0016] Compared with the prior art, the database high-availability cluster split-brain protection method, device and medium provided in this embodiment of the invention have the following beneficial effects: This invention introduces a multi-dimensional state awareness mechanism, which integrates three dimensions: region, communication quality, and historical visibility, to achieve refined evaluation of node state and significantly improve the accuracy of leader selection decisions in network partitioning scenarios.
[0017] Furthermore, this invention employs a weighted quorum mechanism to dynamically calculate node weights and visibility scores, replacing the traditional fixed-node-count determination. This adapts to complex network topologies and avoids service failures caused by poor-quality partitioned master elections. The region-aware master election algorithm designed in this invention prioritizes regions with high communication quality and high weights for deploying new master databases, ensuring continuous and effective service provision after master election and reducing the risk of business interruption.
[0018] Finally, this invention also constructs a visibility consensus verification mechanism, which accurately determines the original master database status through multi-node cross-validation and timestamp consistency verification, preventing split-brain scenarios caused by single-node misjudgments. It also establishes a tiered response strategy, performing isolation, degradation, and shutdown operations according to risk level, replacing the aggressive STONITH mechanism, reducing false positives on normal nodes, and improving service continuity in unstable network scenarios. Furthermore, it achieves quantitative assessment of communication quality, calculating a comprehensive score based on latency, packet loss rate, bandwidth, and historical stability to accurately identify network anomalies and avoid unnecessary failover. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart of a database high-availability cluster split-brain protection method provided in an embodiment of the present invention; Figure 2 An architecture diagram of a database high-availability cluster split-brain protection system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a database high-availability cluster split-brain protection device provided in an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0021] This invention provides a method for preventing split-brain attacks in a highly available database cluster, such as... Figure 1 As shown, the database high-availability cluster split-brain protection method specifically includes steps S101-S106: S101. After the leader election process is triggered in the current cluster, detect the communicable nodes in the current cluster; perform multi-dimensional quality perception on the communicable nodes and obtain the corresponding node status parameters.
[0022] Specifically, in a network partitioning scenario, if the original master database fails or malfunctions, a master node election process is triggered in the current cluster. The communicable nodes in the current cluster are detected using probing tools, and the status change trends of each communicable node are tracked using a historical visibility sliding window.
[0023] Furthermore, the node state parameters of each communicable node are described using multi-dimensional state vectors; these multi-dimensional state vectors include: a region dimension vector, a communication dimension vector, and a time dimension vector. The region dimension vector describes the availability zone or data center identifier to which the node belongs; the communication dimension vector describes the node's communication quality score; and the time dimension vector describes the node state change trend recorded in the historical visibility sliding window.
[0024] As a feasible implementation method, the multi-dimensional state-aware model constructed in this invention introduces a three-dimensional state vector to describe the node state: Zone dimension: the identifier of the availability zone / data center to which the node belongs, including AZ and Region levels; Quality dimension: communication quality score based on latency, packet loss rate, and bandwidth; Visibility dimension: historical visibility sliding window records to track the trend of node state changes.
[0025] S102. Perform a weighted calculation based on the node state parameters to obtain the weighted value. Specifically, calculate the weighted value of the state parameters of all communicable nodes according to Weighted_Quorum = Σ(node_weight × visibility_score). Where, node_weight = Base_Weight × (1 + Zone_Priority_Factor).
[0026] Base_Weight is the base weight of a communicable node; Zone_Priority_Factor is the zone priority factor of a communicable node; and visibility_score is the visibility score of a communicable node.
[0027] In one embodiment, Zone_Priority_Factor is the zone priority factor, which has a fixed initial value. If two nodes are in the same zone, the zone priority factor is increased by 0.2; if two nodes are in the same city but different zones, the zone priority factor is increased by 0.1; if two nodes are in different locations, the zone priority factor is decreased by 0.1.
[0028] S103. If the weighted value reaches the first preset threshold, then perform visibility consensus verification on each communicable node.
[0029] Specifically, the weighted value is compared with a first preset threshold. If the weighted value is less than the first preset threshold, the election ends. If the weighted value is greater than or equal to the first preset threshold, the original master node status is verified using a multi-node cross-validation method.
[0030] Furthermore, each communicable node broadcasts a pre-election request to all visible nodes to obtain the visibility status of each communicable node to the original master node, and verifies the consistency of the last_visible_time timestamps reported by each communicable node. Only when a majority of communicable nodes determine that the original master node is no longer visible is the master election process allowed.
[0031] As a feasible implementation, the original master database status is cross-verified by multiple nodes during the election process: the candidate master node broadcasts a "pre-election" request to all visible nodes, collecting the visibility status of each node to the original master database, including whether it is visible or not visible. Then, the consistency of the last_visible_time timestamps reported by each node is verified, allowing clock drift to be within the error range. The master election process is only allowed when a majority of nodes unanimously determine that the original master database is "not visible".
[0032] S104. After the visibility consensus verification is passed, candidate master election regions are determined based on the region-aware master election strategy; a new master node is elected in the candidate master election regions according to the hierarchical response strategy.
[0033] Specifically, communicable nodes are selected as candidate nodes to obtain a candidate node set C, and the regional information Z of each candidate node is collected. Based on the communication dimension vector in the node state parameters of each candidate node, the communication quality score Q of each candidate node is calculated.
[0034] Furthermore, the candidate node set C is grouped according to its region, resulting in the grouping result Groups=GroupBy(C, Z).
[0035] For each group, calculate the average communication quality within the group Avg_Q(g) = mean(Q[node] for nodein g) and the group weight Weight(g) = Σ(node weight).
[0036] Furthermore, based on the average communication quality within the group and the group weight, candidate primary regions are determined: Candidate_Zones = {g | Weight(g)>= Quorum_Threshold}; where Quorum_Threshold is the first preset threshold.
[0037] Furthermore, it checks whether there is a visible original master node in the candidate master region. If there is, the visible original master node is elected as the new master node. If there is no visible original master node and there is only one candidate master region, the node with the highest communication quality score in the candidate master region is elected as the new master node. If there is more than one candidate master region, the average communication quality within each candidate master region is compared, and the node with the highest communication quality score in the region with the highest average communication quality within the group is selected as the new master node. If the difference in the average communication quality within each candidate master region is lower than a second preset threshold, the node with the highest communication quality score in the region with a larger group weight is selected as the new master node. The database deployed in the new master node is the master database.
[0038] In one embodiment, if |Candidate_Zones| == 1, the node with the highest Q value in that region is selected as the master node; if |Candidate_Zones| > 1, the Avg_Q values of each region are compared, and the node with the highest Q value in the region with the best communication quality is selected as the master node; if the difference in Avg_Q between regions is < 10%, the node with the highest Q value in the region with a larger group weight is selected as the master node.
[0039] As a feasible implementation method, the hierarchical response strategy specifically includes: Level 1: The original primary database is healthy and reachable. At this time, the primary election process is not triggered, the status quo is maintained and the log is recorded. Level 2: The original master database latency increases but it is not lost. At this time, the master election process is not triggered, but the synchronous replication check is triggered to prepare the switchover plan and increase the detection frequency. Level 3: The original master database is unreachable but may be alive. At this time, the master election process is triggered, and isolation measures are implemented on the original master database to prohibit new connections, maintain the replication stream, and maintain read-only service. Level 4: Confirm the failure of the original master database. At this point, the master election process is triggered, and the PostgreSQL process of the original master database is gracefully shut down. Level 5: There is a risk of split-brain that cannot be handled gracefully, triggering the STONITH isolation mechanism to force a power outage on the current cluster.
[0040] In one embodiment, a tiered response strategy that performs differentiated processing based on risk level is shown in Table 1.
[0041] Table 1 Hierarchical Response Strategy
[0042] Figure 2 An architecture diagram of a database high-availability cluster split-brain protection system provided in this embodiment of the invention is shown below. Figure 2As shown, this invention introduces a multi-dimensional state awareness layer, expanding node status from a simple "on / off" state to a comprehensive evaluation encompassing regional location awareness, communication quality monitoring, and historical visibility tracking, significantly improving decision-making accuracy in network partitioning scenarios. The weighted Quorum mechanism integrated into the weighted computing engine further ensures that, while meeting consistency requirements, the partition with better network quality is prioritized as the master database location through a regional awareness master selection module, performing regional grouping, communication quality comparison, and optimal node selection, thus avoiding the problem of ineffective service after master selection. The visibility consensus verification mechanism avoids unnecessary failover through multi-node cross-validation and timestamp consistency checks. Finally, the tiered response decision-making replaces the aggressive STONITH mechanism with a progressive approach using isolation, degradation, and shutdown strategies, maintaining service continuity in unstable network scenarios. Overall, this invention significantly improves system availability and business continuity while ensuring data consistency.
[0043] In addition, embodiments of the present invention also provide a database high-availability cluster split-brain protection device, such as... Figure 3 As shown, the database high-availability cluster split-brain protection device specifically includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, so that at least one processor can perform the following: After the leader election process is triggered in the current cluster, the communicable nodes in the current cluster are detected. Perform multi-dimensional quality sensing on the communicable nodes to obtain the corresponding node status parameters; The weighted values are obtained by performing a weighted calculation based on the node state parameters. If the weighted value reaches the first preset threshold, then visibility consensus verification is performed on each communicable node; After the visibility consensus verification is passed, candidate leader regions are determined based on the region-aware leader selection strategy; A new master node is elected in the candidate master region according to the hierarchical response strategy.
[0044] Finally, this embodiment of the invention also provides a storage medium, which is a non-volatile computer-readable storage medium storing at least one program, each program including instructions that, when executed by a terminal, cause the terminal to perform: After the leader election process is triggered in the current cluster, the communicable nodes in the current cluster are detected. Perform multi-dimensional quality sensing on the communicable nodes to obtain the corresponding node status parameters; The weighted values are obtained by performing a weighted calculation based on the node state parameters. If the weighted value reaches the first preset threshold, then visibility consensus verification is performed on each communicable node; After the visibility consensus verification is passed, candidate leader regions are determined based on the region-aware leader selection strategy; A new master node is elected in the candidate master region according to the hierarchical response strategy.
[0045] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0046] The foregoing has described specific embodiments of the present invention. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0047] The above description is merely an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for preventing split-brain attacks in a high-availability database cluster, characterized in that, The method includes: After the leader election process is triggered in the current cluster, the communicable nodes in the current cluster are detected. Perform multi-dimensional quality sensing on the communicable nodes to obtain the corresponding node status parameters; The weighted values are obtained by performing a weighted calculation based on the node state parameters. If the weighted value reaches the first preset threshold, then visibility consensus verification is performed on each communicable node; After the visibility consensus verification is passed, candidate leader regions are determined based on the region-aware leader selection strategy; A new master node is elected in the candidate master region according to the hierarchical response strategy.
2. The method for preventing split-brain attacks in a high-availability database cluster according to claim 1, characterized in that, After the leader election process is triggered in the current cluster, the communicable nodes in the current cluster are detected, specifically including: In a network partitioning scenario, a master node election process is triggered in the current cluster. The communication nodes in the current cluster are detected using a detection tool, and the status change trend of each communication node is tracked through a historical visibility sliding window.
3. The method for preventing split-brain attacks in a high-availability database cluster according to claim 1, characterized in that, Multidimensional quality sensing is performed on the communicable nodes to obtain the corresponding node state parameters, specifically including: The node state parameters of each communicable node are described by a multidimensional state vector; wherein, the multidimensional state vector includes: a region dimension vector, a communication dimension vector, and a time dimension vector; The region dimension vector is used to describe the availability zone or data center identifier to which the node belongs; the communication dimension vector is used to describe the node's communication quality score; and the time dimension vector is used to describe the node's status change trend recorded in the historical visibility sliding window.
4. The method for preventing split-brain attacks in a high-availability database cluster according to claim 1, characterized in that, The weighted values are obtained by performing a weighted calculation based on the node state parameters, specifically including: Based on Weighted_Quorum=Σ(node_weight×visibility_score), calculate the weighted value of the state parameters of all communicable nodes, Weighted_Quorum; Among them, node_weight = Base_Weight×(1 + Zone_Priority_Factor); Base_Weight is the base weight of a communicable node; Zone_Priority_Factor is the zone priority factor of a communicable node; and visibility_score is the visibility score of a communicable node.
5. The method for preventing split-brain attacks in a high-availability database cluster according to claim 1, characterized in that, If the weighted value reaches a first preset threshold, then visibility consensus verification is performed on each communicable node, specifically including: The weighted value is compared with a first preset threshold. If the weighted value is less than the first preset threshold, the election ends. If the weighted value is greater than or equal to the first preset threshold, the original master node status is verified by a multi-node cross-validation method. By broadcasting a pre-election request to all visible nodes through each communicable node, the visibility status of each communicable node to the original master node is obtained, and the consistency of the last_visible_time timestamps reported by each communicable node is verified. The leader election process is only allowed when a majority of communicable nodes determine that the original master node is not visible.
6. The method for preventing split-brain attacks in a high-availability database cluster according to claim 1, characterized in that, After the visibility consensus verification is passed, candidate leader regions are determined based on a region-aware leader election strategy, specifically including: The communicable nodes are used as candidate nodes to obtain a candidate node set C, and the regional information Z of each candidate node is collected. Calculate the communication quality score Q for each candidate node based on the communication dimension vector in the node state parameters of each candidate node; The candidate node set C is grouped according to its region, resulting in Groups=GroupBy(C, Z); For each group, calculate the average communication quality Avg_Q(g) and the group weight Weight(g); where the group weight is the sum of the node weights of all candidate nodes in the group; Based on the average communication quality within the group and the group weight, the candidate primary selection region is determined: Candidate_Zones = {g| Weight(g)>= Quorum_Threshold}; where Quorum_Threshold is the first preset threshold.
7. The method for preventing brain split in a high-availability database cluster according to claim 1, characterized in that, According to the hierarchical response strategy, a new master node is elected in the candidate master region, specifically including: Detect whether there is a visible original master node in the candidate master selection area. If there is, elect the visible original master node as the new master node. If there is no visible original master node and there is only one candidate master region, then the node with the highest communication quality score in the candidate master region is elected as the new master node. If there is more than one candidate master region, compare the average communication quality within each candidate master region and select the node with the highest communication quality score in the region with the highest average communication quality within the group as the new master node. If the average communication quality difference within each candidate master region is lower than the second preset threshold, then the node with the highest communication quality score in the region with a larger group weight is selected as the new master node; the database deployed in the new master node is the master database.
8. A method for preventing split-brain attacks in a high-availability database cluster according to claim 7, characterized in that, The hierarchical response strategy specifically includes: Level 1: The original primary database is healthy and reachable. At this time, the primary election process is not triggered, the status quo is maintained and the log is recorded. Level 2: The original master database latency increases but it is not lost. At this time, the master election process is not triggered, but the synchronous replication check is triggered to prepare the switchover plan and increase the detection frequency. Level 3: The original master database is unreachable but may be alive. At this time, the master election process is triggered, and isolation measures are implemented on the original master database to prohibit new connections, maintain the replication stream, and maintain read-only service. Level 4: Confirm the failure of the original master database. At this point, the master election process is triggered, and the PostgreSQL process of the original master database is gracefully shut down. Level 5: There is a risk of split-brain that cannot be handled gracefully, triggering the STONITH isolation mechanism to force a power outage on the current cluster.
9. A database high-availability cluster split-brain protection device, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, enabling the at least one processor to perform a database high-availability cluster split-brain protection method according to any one of claims 1-8.
10. A storage medium, characterized in that, The storage medium is a non-volatile computer-readable storage medium that stores at least one program, each program including instructions that, when executed by a terminal, cause the terminal to perform a database high-availability cluster split-brain protection method according to any one of claims 1-8.