CN114443768A - Main/standby switching method and device of distributed database and readable storage medium - Google Patents

Main/standby switching method and device of distributed database and readable storage medium Download PDF

Info

Publication number
CN114443768A
CN114443768A CN202210099404.5A CN202210099404A CN114443768A CN 114443768 A CN114443768 A CN 114443768A CN 202210099404 A CN202210099404 A CN 202210099404A CN 114443768 A CN114443768 A CN 114443768A
Authority
CN
China
Prior art keywords
data node
data
switching
standby
main
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210099404.5A
Other languages
Chinese (zh)
Inventor
裴晨光
周家晶
苗浩
吕苏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Unionpay Co Ltd
Original Assignee
China Unionpay Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN202210099404.5A priority Critical patent/CN114443768A/en
Publication of CN114443768A publication Critical patent/CN114443768A/en
Priority to PCT/CN2022/126078 priority patent/WO2023142543A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1435Saving, restoring, recovering or retrying at system level using file system or storage system metadata
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support

Abstract

The invention provides a method, a device and a system for switching between a main database and a standby database of a distributed database and a readable storage medium, wherein the distributed database comprises one or more agents and a plurality of data nodes connected with the agents, and the method comprises the following steps: when the first data node is down, performing active-standby switching on the first data node; in the process of switching the main data node and the standby data node, the agent switches and routes the transaction originally routed to the first data node to the second data node; and after the main/standby switching of the first data node is completed, the agent switches and routes the transaction routed to the second data node to the first data node. By using the method, the transaction failure condition in the process of switching the main database and the standby database can be reduced.

Description

Main/standby switching method and device of distributed database and readable storage medium
Technical Field
The invention belongs to the field of databases, and particularly relates to a method and a device for switching a main database and a standby database and a readable storage medium.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
The database stores data in a multi-copy mode, and the standby database is automatically switched to the main database when the main database is abnormally shut down, so that service is recovered. The main library is judged to be abnormal and needs to be confirmed for many times, so that misjudgment caused by network jitter is avoided. The RTO of industry mainstream databases such as DB2, TDSQL, golden DB, GuassDB, etc. is basically between 10 and 60 seconds, and all transactions routed to this instance during the active-standby switching period fail, for example: for a centralized database, all transactions routed to that instance will fail; for a distributed database, transactions routed to that node will all fail. In some key business scenarios or systems that are sensitive to success rate, a transaction failure of ten to tens of seconds can also cause significant losses.
Therefore, how to perform the active-standby switching of the database nodes is an urgent problem to be solved.
Disclosure of Invention
In view of the problems in the prior art, a method, an apparatus, and a computer-readable storage medium for switching between a main database and a standby database are provided.
The present invention provides the following.
In a first aspect, a method for switching between a master database and a standby database of a distributed database is provided, where the distributed database includes one or more agents and a plurality of data nodes connected to the agents, and the method includes: when the first data node is down, performing active-standby switching on the first data node; in the process of switching the main data node and the standby data node of a first data node, an agent switches and routes a transaction originally routed to the first data node to a second data node; and after the main/standby switching of the first data node is completed, the agent switches and routes the transaction routed to the second data node to the first data node.
In an embodiment, the method further comprises: when the agent continuously detects that the preset response error corresponding to the first data node exceeds the preset number, and/or detects that the duration of the preset response error corresponding to the first data node reaches the preset duration, determining that the first data node is down; and the preset response error is used for indicating the downtime of the database.
In an embodiment, the method further comprises: and after the main/standby switching of the first data node is completed, if the statement of the first data node is not hit in the routing process, the statement is rerouted to the second data node.
In an embodiment, the method further comprises: and after the main/standby switching of the first data node is completed, the data in the second data node is migrated back to the first data node.
In an embodiment, the method further comprises: when the data in the second data node is migrated back to the first data node, if the statement of the routing to the first data node misses the data, the statement is rerouted to the second data node.
In an embodiment, the business transaction is composed of two transactions with strong relevance, wherein an insert statement is in the transaction 1, a query statement and/or an update statement is in the transaction 2, and when the primary/standby switching of the first data node is completed, if the query statement and/or the update statement routed to the first data node miss data, the statement is rerouted to the second data node.
In an embodiment, the second data node is a redundant data node in the distributed database, and is in an idle state when the first data node is not down.
In a second aspect, a device for switching between master and slave distributed databases is provided, where a distributed database includes one or more agents and a plurality of data nodes connected to the agents, and the device includes: the main/standby switching module is used for switching the main/standby of the first data node when the first data node is down; the routing switching module is used for enabling the agent to switch and route the transaction originally routed to the first data node to the second data node in the process of performing main-standby switching on the first data node; and after the main/standby switching of the first data node is completed, enabling the agent to switch and route the transaction routed to the second data node to the first data node.
In a third aspect, a device for switching between active and standby distributed databases is provided, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform: the method of the first aspect.
In a fourth aspect, there is provided a computer readable storage medium storing a program which, when executed by a multicore processor, causes the multicore processor to perform the method of the first aspect.
One advantage of the foregoing embodiment is that the number of failed transactions during the active-standby switching of the database can be reduced.
Other advantages of the present invention will be explained in more detail in conjunction with the following description and the accompanying drawings.
It should be understood that the above description is only an overview of the technical solutions of the present invention, so as to clearly understand the technical means of the present invention, and thus can be implemented according to the content of the description. In order that the manner in which the above recited and other objects, features and advantages of the present invention are obtained will be readily understood, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
Drawings
The advantages and benefits described herein, as well as other advantages and benefits, will be apparent to those of ordinary skill in the art upon reading the following detailed description of the exemplary embodiments. The drawings are only for purposes of illustrating exemplary embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like elements throughout. In the drawings:
fig. 1 is a schematic structural diagram of a hardware operating environment of a method for switching between a main and a standby distributed databases according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a main/standby switching method of a distributed database according to an embodiment of the present invention;
FIG. 3 is a block diagram of a distributed database according to an embodiment of the present invention;
FIG. 4 is a transaction composition diagram of a business transaction according to an embodiment of the invention;
fig. 5 is a schematic structural diagram of a main/standby switching device of a distributed database according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a main/standby switching device of a distributed database according to another embodiment of the present invention.
In the drawings, like or corresponding reference characters designate like or corresponding parts.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the description of the embodiments of the present application, it is to be understood that terms such as "including" or "having" are intended to indicate the presence of the features, numbers, steps, actions, components, parts, or combinations thereof disclosed in the specification, and are not intended to preclude the presence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.
Unless otherwise stated, "/" indicates an OR meaning, e.g., A/B may indicate A or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, "a plurality" means two or more unless otherwise specified.
All code in this application is exemplary and variations will occur to those skilled in the art based upon the programming language used, the specific needs and personal habits without departing from the spirit of the application.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 1 is a schematic structural diagram of a hardware operating environment of a main/standby switching method of a distributed database. The main/standby switching device based on the distributed database in the embodiment of the invention can be a terminal device such as a PC, a portable computer and the like.
As shown in fig. 1, the active/standby switching device of the distributed database may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the master-slave switching device architecture of the distributed database shown in fig. 1 does not constitute a limitation of the master-slave switching device of the distributed database, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an information transfer program based on a block chain. The operating system is a program for managing and controlling hardware and software resources of the main/standby switching device of the distributed database, and supports the operation of the main/standby switching program of the distributed database and other software or programs.
In the main/standby switching device of the distributed database shown in fig. 1, the user interface 1003 is mainly used to receive requests, data, and the like sent by the first terminal, the second terminal, and the monitoring terminal; the network interface 1004 is mainly used for connecting the background server and performing data communication with the background server; and processor 1001 may be configured to invoke a master-slave switching procedure of the distributed database stored in memory 1005, and perform the following operations:
when the first data node is down, performing active-standby switching on the first data node; in the process of switching the main data node and the standby data node, the agent switches the transaction originally routed to the first data node to a second data node; and after the main-standby switching of the first data node is completed, the agent routes the transaction switching loop routed to the second data node to the first data node.
Therefore, the number of transaction failures during the primary-standby switching period of the database can be reduced.
Fig. 2 is a schematic flowchart of a main/standby switching method for a distributed database according to an embodiment of the present application, in which from a device perspective, an execution subject may be one or more electronic devices; from the program perspective, the execution main body may accordingly be a program loaded on these electronic devices. In this embodiment, the execution subject of the method may be the processor in the embodiment shown in fig. 1.
Fig. 3 is an architecture diagram of a distributed database including a plurality of agents, such as agent 1, agent 2, and a plurality of data nodes, including a first data node, a second data node, etc., according to an embodiment of the present application. In this embodiment, the first data node may be a common node operating in a distributed database. The second data node may be a redundant node specifically set in the distributed database to be dedicated to a temporary standby node when the first data node is down. Alternatively, the second data node may also be a regular node running in the distributed database, rather than just being temporarily standby.
The method illustrated in fig. 2 is further described below in conjunction with fig. 3, and may include the steps of:
202. and when the first data node is down, performing active-standby switching on the first data node.
In some embodiments, when determining whether the first data node is down, the first data node may be determined to be down again when the agent continuously detects that the preset acknowledgement errors corresponding to the first data node exceed the preset number of times and/or detects that the duration of the preset acknowledgement errors corresponding to the first data node reaches the preset duration, in order to avoid the overly sensitive switching behavior due to unavoidable network jitter. And the preset response error is used for indicating the downtime of the database.
For example, in a normal transaction situation, an application connects an agent to send a request (SQL statement), the agent identifies a sub-library field in the SQL statement, obtains data node information according to a built-in algorithm, forwards the SQL statement to a corresponding data node, for example, a first data node, and then the first data node returns a response to the agent, and the agent sends the response to the application after processing the response. However, if the agent detects the response error, the agent further identifies whether the response error is a specific error reporting code, and specifically identifies whether the response error is a logical error reporting of the SQL statement, if so, the exception is considered as a database crash, and the response error is the preset response error. And then, when detecting that the error reporting number of the preset response error report for the first data node reaches the preset number in a short time or the error reporting duration reaches the preset duration, determining that the first data node is down. Thereby, too sensitive switching behavior can be avoided.
204. In the process of switching the main data node and the standby data node, the agent switches the transaction originally routed to the first data node to a second data node; therefore, the follow-up transaction can be continuously carried out in the process of switching the main data node and the standby data node of the down first data node.
206. And after the main-standby switching of the first data node is completed, the agent routes the transaction switching loop routed to the second data node to the first data node.
In some embodiments, after the active-standby switching of the first data node is completed, if the statement of the first data node is not hit in the routing process, the statement is rerouted to the second data node. The second data node temporarily takes the role of the first data node in the process of primary-standby switching, so that the data in the period is stored internally, however, the subsequent transaction after the route is switched back to the first data node is still possibly related to the data in the period, and therefore, the transaction failure can be avoided by adopting the method.
In some embodiments, after the active-standby switching of the first data node is completed, the data in the second data node may be directly migrated back to the first data node. Therefore, the integrity of the data in the first data node can be ensured, and the follow-up frequent rerouting to the second data node to acquire the data is avoided.
Optionally, the data in the second data node may also continue to remain in the second data node without being migrated to the first data node.
In some embodiments, when data within the second data node is migrated back to the first data node, if the statement misses the data as routed to the first data node, the statement is rerouted to the second data node. It can be understood that a period of time is required for migrating the data in the second data node back to the first data node, and in this process, in order to avoid a transaction error, the above method may be adopted until the data migration is completed.
In some embodiments, a business transaction may consist of two transactions with strong association, referring to FIG. 4, where within transaction 1 is an insert (Insect) statement and within transaction 2 is a query (Select) statement and/or an Update (Update) statement, since transactions 1 and 2 have strong association and there is a time t between transactions 1 and 2. Thus, if transaction 1 occurs at the primary-to-backup switch of the first data node, and transaction 2 occurs after the primary-to-backup switch of the first data node, then the query (Select) statement and/or Update (Update) statement of transaction 2 is likely to fail to hit the data. Therefore, when the active/standby switching of the first data node is completed, if the query (Select) statement and/or Update (Update) of the first data node miss data, the statement is rerouted to the second data node.
In the description of the present specification, reference to the description of the terms "some possible implementations," "some embodiments," "examples," "specific examples," or "some examples," or the like, means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
With regard to the method flow diagrams of embodiments of the present application, certain operations are described as different steps performed in a certain order. Such flow diagrams are illustrative and not restrictive. Certain steps described herein may be grouped together and performed in a single operation, may be divided into multiple sub-steps, and may be performed in an order different than that shown herein. The various steps shown in the flowcharts may be implemented in any way by any circuit structure and/or tangible mechanism (e.g., by software running on a computer device, hardware (e.g., logical functions implemented by a processor or chip), etc., and/or any combination thereof).
Based on the same technical concept, an embodiment of the present invention further provides a device for switching between a master and a slave of a distributed database, which is used to execute the method for switching between a master and a slave of a distributed database provided in any of the embodiments above, where the distributed database includes one or more agents and a plurality of data nodes connected to the agents. Fig. 5 is a schematic structural diagram of an active/standby switching device of a distributed database according to an embodiment of the present invention.
As shown in fig. 5, the apparatus 500 includes:
the active-standby switching module 501 is configured to, when a first data node is down, perform active-standby switching on the first data node;
a route switching module 502, configured to, in the process of performing the active/standby switching on the first data node, enable the agent to switch and route a transaction, which is originally routed to the first data node, to a second data node; and after the main-standby switching of the first data node is completed, enabling the agent to switch and route the transaction routed to the second data node to the first data node.
It should be noted that the apparatus in the embodiment of the present application may implement each process of the foregoing method embodiment, and achieve the same effect and function, which are not described herein again.
Fig. 6 is a device according to an embodiment of the present application, configured to execute a method for switching between active and standby of the distributed database shown in fig. 2, where the device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the above embodiments.
According to some embodiments of the present application, there is provided a non-volatile computer storage medium of a method for master-slave switching of a distributed database, having stored thereon computer-executable instructions configured to, when executed by a processor, perform: the method as described in the above example.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and computer-readable storage medium embodiments, the description is simplified because they are substantially similar to the method embodiments, and reference may be made to some descriptions of the method embodiments for their relevance.
The apparatus, the device, and the computer-readable storage medium provided in the embodiment of the present application correspond to the method one to one, and therefore, the apparatus, the device, and the computer-readable storage medium also have advantageous technical effects similar to those of the corresponding method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A method for switching between main and standby of a distributed database, wherein the distributed database comprises one or more agents and a plurality of data nodes connected with the agents, the method comprising:
when a first data node is down, performing active-standby switching on the first data node;
in the process of switching the main data node and the standby data node, the agent switches and routes the transaction originally routed to the first data node to a second data node; and (c) a second step of,
and after the master-slave switching of the first data node is completed, the agent switches and routes the transaction routed to the second data node to the first data node.
2. The method of claim 1, further comprising:
when the agent continuously detects that the preset response error corresponding to the first data node exceeds a preset number, and/or detects that the duration of the preset response error corresponding to the first data node reaches a preset duration, determining that the first data node is down; and the preset response error is used for indicating the downtime of the database.
3. The method of claim 1, further comprising:
and after the main/standby switching of the first data node is completed, if the statement of the first data node is routed to miss data, rerouting the statement to the second data node.
4. The method of claim 1, further comprising:
and after the master-slave switching of the first data node is completed, migrating the data in the second data node back to the first data node.
5. The method of claim 4, further comprising:
when the data in the second data node is migrated back to the first data node, if the statement of the second data node is not hit in the routing process, the statement is rerouted to the second data node.
6. The method of claim 3, wherein the business transaction is composed of two transactions with strong association, wherein the transaction 1 is an insert statement, the transaction 2 is a query statement and/or an update statement, and when the active/standby switch of the first data node is completed, if the query statement and/or the update statement routed to the first data node miss data, the statement is rerouted to the second data node.
7. The method of claim 1, further comprising:
the second data node is a redundant data node in the distributed database and is in an idle state under the condition that the first data node is not down.
8. A master/slave switching apparatus for a distributed database, wherein the distributed database includes one or more agents and a plurality of data nodes connected to the agents, the apparatus comprising:
the main/standby switching module is used for switching the main/standby of the first data node when the first data node is down;
a route switching module, configured to, during the active-standby switching process of the first data node, enable the proxy to switch and route a transaction, which is originally routed to the first data node, to a second data node; and after the main-standby switching of the first data node is completed, enabling the agent to switch and route the transaction routed to the second data node to the first data node.
9. A master-slave switching device of a distributed database is characterized by comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform: the method of any one of claims 1-7.
10. A computer-readable storage medium storing a program that, when executed by a multi-core processor, causes the multi-core processor to perform the method of any one of claims 1-7.
CN202210099404.5A 2022-01-27 2022-01-27 Main/standby switching method and device of distributed database and readable storage medium Pending CN114443768A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210099404.5A CN114443768A (en) 2022-01-27 2022-01-27 Main/standby switching method and device of distributed database and readable storage medium
PCT/CN2022/126078 WO2023142543A1 (en) 2022-01-27 2022-10-19 Active-standby switching method and apparatus for distributed database, and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210099404.5A CN114443768A (en) 2022-01-27 2022-01-27 Main/standby switching method and device of distributed database and readable storage medium

Publications (1)

Publication Number Publication Date
CN114443768A true CN114443768A (en) 2022-05-06

Family

ID=81370228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210099404.5A Pending CN114443768A (en) 2022-01-27 2022-01-27 Main/standby switching method and device of distributed database and readable storage medium

Country Status (2)

Country Link
CN (1) CN114443768A (en)
WO (1) WO2023142543A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142543A1 (en) * 2022-01-27 2023-08-03 中国银联股份有限公司 Active-standby switching method and apparatus for distributed database, and readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117093406B (en) * 2023-10-18 2024-02-09 浙江印象软件有限公司 Log center maintenance method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11243945B2 (en) * 2017-12-11 2022-02-08 International Business Machines Corporation Distributed database having blockchain attributes
CN112783982B (en) * 2021-02-07 2021-09-10 腾讯科技(深圳)有限公司 Data processing method, device, system, computer equipment and storage medium
CN113254536A (en) * 2021-06-09 2021-08-13 蚂蚁金服(杭州)网络技术有限公司 Database transaction processing method, system, electronic device and storage medium
CN114443768A (en) * 2022-01-27 2022-05-06 中国银联股份有限公司 Main/standby switching method and device of distributed database and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142543A1 (en) * 2022-01-27 2023-08-03 中国银联股份有限公司 Active-standby switching method and apparatus for distributed database, and readable storage medium

Also Published As

Publication number Publication date
WO2023142543A1 (en) 2023-08-03

Similar Documents

Publication Publication Date Title
WO2019085875A1 (en) Configuration modification method for storage cluster, storage cluster and computer system
WO2023142543A1 (en) Active-standby switching method and apparatus for distributed database, and readable storage medium
US10884623B2 (en) Method and apparatus for upgrading a distributed storage system
CN102158540A (en) System and method for realizing distributed database
JP5093259B2 (en) Communication path strengthening method between BIOS and BMC, apparatus and program thereof
CN108628717A (en) A kind of Database Systems and monitoring method
JP2019185371A (en) Server switching program, server switching method, and server switching system
WO2020143410A1 (en) Data storage method and device, electronic device and storage medium
CN105069152B (en) data processing method and device
US20230098190A1 (en) Data processing method, apparatus, device and medium based on distributed storage
US9330153B2 (en) System, method, and computer readable medium that coordinates between devices using exchange of log files
JP2021135703A (en) Information processing system and method
CN112307045A (en) Data synchronization method and system
CN108733808B (en) Big data software system switching method, system, terminal equipment and storage medium
CN112199240A (en) Method for switching nodes during node failure and related equipment
CN111488247B (en) High availability method and equipment for managing and controlling multiple fault tolerance of nodes
CN111400273B (en) Database capacity expansion method and device, electronic equipment and machine-readable storage medium
CN110895545B (en) Shared data synchronization method and device
CN113596195B (en) Public IP address management method, device, main node and storage medium
CN114189429A (en) System, method, device and medium for monitoring server cluster faults
CN112084171A (en) Operation log writing method, device, equipment and medium based on Cassandra database
CN114510495B (en) Database service data consistency processing method and system
JP3494788B2 (en) Program execution management system and program execution management method
CN115982101B (en) Machine room data migration method and device based on multi-machine room copy placement strategy
CN109067611B (en) Method, device, storage medium and processor for detecting communication state between systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination