CN117827385A - Transaction management method for database cluster, readable storage medium and computer device - Google Patents

Transaction management method for database cluster, readable storage medium and computer device Download PDF

Info

Publication number
CN117827385A
CN117827385A CN202311865070.9A CN202311865070A CN117827385A CN 117827385 A CN117827385 A CN 117827385A CN 202311865070 A CN202311865070 A CN 202311865070A CN 117827385 A CN117827385 A CN 117827385A
Authority
CN
China
Prior art keywords
transaction
node
information
synchronized
target
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
CN202311865070.9A
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.)
Beijing Kingbase Information Technologies Co Ltd
Original Assignee
Beijing Kingbase Information Technologies 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 Beijing Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202311865070.9A priority Critical patent/CN117827385A/en
Publication of CN117827385A publication Critical patent/CN117827385A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a transaction management method, a readable storage medium and computer equipment of a database cluster, wherein the transaction management method comprises the following steps: generating or updating a transaction synchronization information table under the condition that the target transaction processing request is finished in the execution of the node; wherein, the transaction synchronization information table stores at least transaction information generated according to the target transaction request; judging whether the transaction information to be synchronized exists in the transaction synchronization information table or not under the condition that the generation or updating of the transaction synchronization information table is completed, and synchronously acquiring or processing other transaction requests; the information to be synchronously processed is stored in a global transaction state table of other nodes of the database cluster according to the transaction clock of the node. The technical scheme of the invention can solve the problem of low working efficiency when each node in the database cluster executes the transaction.

Description

Transaction management method for database cluster, readable storage medium and computer device
Technical Field
The present invention relates to the field of database technologies, and in particular, to a method for transaction management of a database cluster, a readable storage medium, and a computer device.
Background
In the decentralized database cluster, two methods exist for synchronizing transaction information among nodes, wherein the first synchronization method is to acquire corresponding transaction information from other nodes when the transactions are interacted, for example, when the visibility of the transaction is judged on one node. The method has the defects that the corresponding transaction information needs to be acquired from other nodes every time the node performs visibility judgment, so that the communication overhead of the database cluster is overlarge and the performance is reduced.
The second synchronization method is that the node actively synchronizes the transaction information to other nodes after the transaction is completed and submitted by the node. The method has the advantages that transaction information of all nodes is arranged on each node, and when visibility judgment is carried out, the transaction information is not required to be acquired from other nodes, so that the communication overhead of a database cluster can be reduced; the disadvantage is that after the execution of the transaction is finished, the node needs to wait for the synchronization of the transaction information to other nodes before executing the next transaction, which results in an increase in the execution time of the transaction and a decrease in the efficiency of executing the transaction.
Disclosure of Invention
In view of the above problems, the present invention provides a transaction management method, a readable storage medium, and a computer device for a database cluster, which can solve the problem of low working efficiency when each node in the database cluster executes a transaction.
Furthermore, the technical scheme of the invention can also reduce the times of cross-node data transmission when the transaction synchronization is carried out.
Furthermore, the technical scheme of the invention can also solve the problem of synchronous blockage of transaction commit caused by the globally unique transaction clock.
Specifically, in a first aspect, the present invention provides a transaction management method for a database cluster, including:
generating or updating a transaction synchronization information table under the condition that the target transaction processing request is finished in the execution of the node; wherein, the transaction synchronization information table stores at least transaction information generated according to the target transaction request;
judging whether the transaction information to be synchronized exists in the transaction synchronization information table or not under the condition that the generation or updating of the transaction synchronization information table is completed, and synchronously acquiring or processing other transaction requests; wherein,
the transaction information to be synchronized is stored in a global transaction state table of other nodes of the database cluster according to the transaction clock of the node.
Further, the determining whether the transaction information to be synchronized exists in the transaction synchronization information table includes:
judging whether the number of the transaction processing information stored in the transaction synchronous information table is larger than or equal to a preset number;
if yes, judging that the to-be-synchronized transaction information exists in the transaction synchronization information table.
Further, the determining whether the transaction information to be synchronized exists in the transaction synchronization information table includes:
judging whether the interval duration of the information synchronization with the last time is greater than or equal to the preset interval duration;
if yes, judging whether transaction processing information is stored in the transaction synchronization information table;
if yes, judging that the to-be-synchronized transaction information exists in the transaction synchronization information table.
Further, after the determining whether the transaction processing information to be synchronized exists in the transaction synchronization information table, the method further includes:
and if the transaction information to be synchronized exists in the transaction synchronization information table, broadcasting the transaction information to be synchronized to other nodes.
Further, the execution of the target transaction request at the node includes:
if the transaction between the nodes is required to be judged, transaction processing information corresponding to the transaction to be judged is obtained from a local global transaction state table.
Further, the execution of the target transaction request at the node further includes:
after the target transaction is started, the local global transaction state table is recorded into a local cache.
Further, the transaction processing information comprises a commit logical clock stamp of the target transaction, the oldest still running transaction when the target transaction is started, and the latest completed transaction when the target transaction is ended.
Further, the target transaction request is executed at the node, including:
the target transaction is aborted or the target transaction is committed at the present node.
In a second aspect, the present invention also provides a machine-readable storage medium, having stored thereon a machine-executable program which, when executed by a processor, implements a transaction management method according to any one of the database clusters described above.
In a third aspect, the present invention further provides a computer device, including a memory, a processor, and a machine executable program stored in the memory and running on the processor, where the processor implements the transaction management method of any of the foregoing database clusters when executing the machine executable program.
According to the technical scheme, under the condition that the target transaction request is executed at the node, the transaction synchronization information table is generated or updated so as to store the transaction information generated by the target transaction request in the transaction synchronization information table of the node, and the transaction information does not need to be immediately synchronized to other nodes. In the process of judging whether the transaction synchronization information table has the transaction information to be synchronized, other transaction requests can be synchronously acquired or processed without waiting for synchronizing the transaction information to be synchronized to other nodes, so that the working efficiency of the node for processing the transaction is improved.
Further, in the technical scheme of the invention, after the node synchronizes the information of the transaction to be synchronized to other nodes, the other nodes store the information of the transaction to be synchronized into the global transaction state table of the other nodes according to the transaction clock of the node. Therefore, in the process of judging the transaction among the nodes, each node can obtain the transaction information of other nodes from the corresponding global transaction state table, so that the working efficiency of executing the transaction is further improved. In the global transaction state table, the transaction information is stored according to the transaction clock of the corresponding node, so that the relative order of the transaction information on the corresponding node is ensured, and the problem of synchronous blocking of transaction submission caused by the global unique transaction clock is avoided.
The above, as well as additional objectives, advantages, and features of the present invention will become apparent to those skilled in the art from the following detailed description of a specific embodiment of the present invention when read in conjunction with the accompanying drawings.
Drawings
Some specific embodiments of the invention will be described in detail hereinafter by way of example and not by way of limitation with reference to the accompanying drawings. The same reference numbers will be used throughout the drawings to refer to the same or like parts or portions. It will be appreciated by those skilled in the art that the drawings are not necessarily drawn to scale. In the accompanying drawings:
FIG. 1 is a schematic flow chart of a transaction process according to one embodiment of the invention;
FIG. 2 is a schematic flow diagram of transaction information synchronization in accordance with one embodiment of the invention;
FIG. 3 is a schematic flow chart of a transaction process according to another embodiment of the invention;
FIG. 4 is a schematic flow chart diagram of transaction information synchronization in accordance with another embodiment of the invention;
FIG. 5 is a schematic illustration of a machine-readable storage medium according to one embodiment of the invention;
FIG. 6 is a schematic diagram of a computer device according to one embodiment of the invention.
Detailed Description
A transaction management method, a readable storage medium, and a computer device of a database cluster according to an embodiment of the present invention are described below with reference to fig. 1 to 6. In the description of the present embodiment, it should be understood that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature, i.e. one or more such features. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise. When a feature "comprises or includes" a feature or some of its coverage, this indicates that other features are not excluded and may further include other features, unless expressly stated otherwise.
In the description of the present embodiment, a description referring to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., 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, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The database cluster comprises a centralized database cluster and an decentralized database cluster, wherein the centralized database cluster is characterized in that a main node and a plurality of standby nodes are arranged in the database cluster, a transaction is executed by the main node when a transaction operation instruction is received, and the transaction is synchronized to the standby nodes after the execution of the transaction is ended. The centralized database cluster has the advantages that the transaction can be managed simply and conveniently by the master node, and the disadvantage is that the master node becomes a central hot spot, so that the resources of the master node are tense, and the performance of the database cluster is affected. And the existence of the master node also can lead to weakening of the risk resistance of the database cluster, and if the master node receives an external attack, the whole database cluster can not continue to operate.
The de-centralized database cluster has no master node, so that the problems of reduced performance and reduced safety of the database cluster caused by the master node can be avoided, but the problem of performance of transaction information synchronization exists in transaction management. The transaction synchronization method of the decentralised database cluster comprises an active synchronization method and a passive synchronization method, wherein the passive synchronization method is that when nodes perform transaction interactions such as visibility judgment, corresponding transaction information is acquired from other nodes according to the requirements of the transactions; the active synchronization method is that after the node executes the completed transaction and submits the transaction at the node, the transaction information is actively synchronized to other nodes.
The active synchronization method has the defects that the communication overhead of the database cluster is overlarge, and the passive synchronization method has the defects that the execution time of the transaction is increased, so that the working efficiency of the database cluster is reduced.
The transaction management method of the database is applied to a decentralised database cluster, and the architecture adopted by the database cluster comprises but is not limited to a share-disk architecture or a share-noticing architecture. The transaction management method of the database is an improvement on the basis of the active synchronous method and is used for solving the problem of high cost of database trunking communication.
As shown in fig. 1 and fig. 2, fig. 1 illustrates steps of executing a target transaction in a method for managing transactions of a database cluster in an embodiment of the present invention, and fig. 2 illustrates steps of synchronizing transaction information in the method for managing transactions of the database cluster in the embodiment. The transaction management method of the embodiment is applied to each node in the database cluster and is used for improving the working efficiency of executing the transaction by each node. The transaction management method of the database cluster of the present embodiment will be described in detail with reference to the flow shown in fig. 1 and 2, and it should be noted that the numbers of the steps of the present embodiment are not limited to the execution sequence.
As shown in fig. 1, the steps of executing the target transaction in the transaction management method of the database cluster of the present embodiment include:
step S102: judging whether the target transaction request is executed at the node or not;
if yes, go to step S104;
step S104: and generating or updating a transaction synchronization information table according to the transaction information generated by the target transaction request.
As shown in fig. 2, the steps of transaction information synchronization in the transaction management method of the database cluster of the present embodiment include:
step S106: judging whether the transaction information to be synchronized exists in the transaction synchronization information table or not under the condition that the generation or updating of the transaction synchronization information table is completed;
if yes, go to step S108;
step S108: and synchronizing the to-be-synchronized transaction information in the transaction synchronization information table to other nodes.
In this embodiment, the transaction synchronization information table is used to store transaction information, and the generating or updating of the transaction information generated according to the target transaction request in step S104 includes:
if the node already has the transaction synchronization information table, storing the transaction information generated by the target transaction request into the transaction synchronization information table of the node so as to update the transaction synchronization information table;
if the node does not have the transaction synchronization information table, the transaction synchronization information table is generated, and the transaction information generated by the target transaction request is stored in the transaction synchronization information table of the node.
Through the above step S104, the transaction processor processes the target transaction according to the target transaction request, and after the target transaction request is executed at the node, the transaction information generated by the target transaction request may be stored in the transaction synchronization information table of the node.
In the step S106, whether the transaction information to be synchronized exists in the transaction synchronization information table may be determined according to whether the node satisfies a preset condition, that is, if the node satisfies the preset condition, the transaction information to be synchronized exists in the transaction synchronization information table; if the node does not meet the preset condition, the transaction processing information to be synchronized exists in the transaction synchronization information table.
In the embodiment, in the process of determining whether the transaction synchronization information table includes the to-be-synchronized transaction information in the step S106, the node may synchronously acquire or process other transaction requests, thereby reducing transaction blocking and improving the working efficiency of executing the transaction.
In the above step S108, the transaction synchronizer is started to synchronize the to-be-synchronized transaction information in the transaction synchronization information table of the present node to other nodes. And after the transaction information to be synchronized in the transaction synchronization information table of the node is sent to other nodes, the other nodes can store the transaction information to be synchronized in the global transaction state tables of the other nodes according to the transaction clock of the node.
Correspondingly, after receiving the transaction information to be synchronized from other nodes, the node stores the transaction information to be synchronized in a global transaction state table of the node according to the transaction clock of the corresponding node according to the transaction information to be synchronized.
Although the transaction synchronization information of each node is recorded on the local node according to the global unique transaction clock of the database cluster, so that the transaction submission of each node can be strictly ordered, the global unique transaction clock can cause synchronous blocking of the transaction submission, namely, the node does not allow other transactions to be submitted in the process of submitting one of the transactions according to the global unique transaction clock, and the other transactions are allowed to be submitted after the transaction submission is completed.
In this embodiment, after the node receives the transaction information to be synchronized from other nodes, the transaction information to be synchronized does not need to be converted from the transaction clock of the corresponding node to the global unique transaction clock, but only needs to record the transaction information to be synchronized in the global transaction state table according to the transaction clock of the corresponding node, so that each transaction information to be synchronized is strictly ordered according to the transaction clock of the corresponding node, but not strictly ordered according to the global unique transaction clock, thereby avoiding the problem of synchronization blocking caused when different nodes submit transactions, and improving the working efficiency of the database.
In summary, in the technical solution provided in this embodiment, when the execution of the target transaction request at the node ends, the transaction synchronization information table is generated or updated, so that the transaction information generated by the target transaction request is stored in the transaction synchronization information table of the node, and it is not necessary to immediately synchronize the transaction information to other nodes. In the process of judging whether the transaction synchronization information table has the transaction information to be synchronized, other transaction requests can be synchronously acquired or processed without waiting for synchronizing the transaction information to be synchronized to other nodes, so that the working efficiency of the node for processing the transaction is improved.
Further, in the technical solution of this embodiment, after the present node synchronizes the transaction information to be synchronized to other nodes, the other nodes store the transaction information to be synchronized to the global transaction state table of the other nodes according to the transaction clock of the present node, so as to ensure that each transaction information is relatively orderly on the corresponding node, and avoid the problem of transaction commit synchronization blocking caused by the global unique transaction clock.
In some embodiments of the present invention, the method for determining whether the transaction information to be synchronized exists in the transaction synchronization information table in step S106 includes the following steps:
judging whether the quantity of transaction processing information stored in the transaction synchronization information table of the node is larger than or equal to a preset quantity;
if yes, judging that the transaction processing information to be synchronized exists in the transaction synchronization information table of the node.
By means of the technical scheme of the embodiment, when the number of the transaction information stored in the transaction synchronization information table of the node is larger than or equal to the preset number, the transaction information in the transaction synchronization information table of the node can be synchronized to other nodes, so that batch synchronization of the transaction information is achieved, the number of times of transaction synchronization among the nodes is reduced, and the working efficiency of the database cluster for the transaction synchronization is improved.
In some embodiments of the present invention, the method for determining whether the transaction information to be synchronized exists in the transaction synchronization information table in step S106 includes the following steps:
judging whether the interval duration synchronized with the last transaction processing information is greater than or equal to the preset interval duration;
if yes, judging whether transaction processing information is stored in a transaction synchronous information table;
if yes, judging that the transaction information to be synchronized exists in the transaction synchronization information table.
In this embodiment, the synchronization of the transaction information is to synchronize the transaction information to be synchronized in the transaction synchronization information table to other nodes in step S108.
By means of the technical scheme of the embodiment, when the interval time length of executing the transaction information synchronization with the node last time is longer than or equal to the preset time length, the transaction information in the transaction synchronization information table of the node can be synchronized to other nodes, and therefore timeliness of the transaction information synchronization is improved.
In some embodiments of the present invention, when the number of transaction information stored in the transaction synchronization information table is greater than or equal to a preset number, or when the interval time with the last transaction information synchronization is greater than or equal to a preset interval time, the transaction information in the transaction synchronization information table of the node is synchronized to other nodes, so that the timeliness and reliability of the transaction information synchronization are improved while the number of times of the transaction synchronization between the nodes is reduced.
In some embodiments of the present invention, the synchronizing the transaction information to be synchronized in the transaction synchronization information table to other nodes in step S108 includes: the transaction information to be synchronized is broadcast to other nodes.
The broadcast is a communication mode of unilateral transmission and multiparty reception, has the advantages of wide coverage range and high information propagation speed, and is unilateral information propagation without acquiring a communication receipt from a receiver.
In the database cluster, the node only needs to send the transaction information data stored in the transaction synchronization information table of the node to other nodes, and does not need to wait for the synchronization of other nodes to complete. Therefore, the technical scheme of the embodiment can improve the working efficiency of transaction processing.
In some embodiments of the present invention, a method for executing a target transaction request at a node includes:
if the transaction between the nodes is required to be judged, transaction processing information corresponding to the transaction to be judged is obtained from a local global transaction state table.
In this embodiment, the inter-node transaction determination includes visibility determination, and since the latest transaction information of each node in the database cluster is stored in the global transaction state table, in the process of performing inter-node transaction determination, only the transaction information corresponding to the transaction to be determined needs to be obtained from the global transaction state table of the node, and no information needs to be obtained from other nodes, so that the working efficiency of inter-node transaction determination can be improved, and the working efficiency of executing the transaction can be further improved.
In some embodiments of the invention, the execution of the target transaction request at the present node further comprises:
after the target transaction is started, the local global transaction state table is recorded into a local cache.
In the process of processing the target transaction, the transaction processing information recorded in the global transaction state table needs to be acquired when the inter-node transaction judgment is carried out. In this embodiment, after the target transaction is started, the global transaction state table of the node is recorded in the cache of the local node, so that in the process of judging the transaction between the nodes, the required transaction information can be quickly obtained from the cache, so as to achieve the purpose of improving the execution efficiency of the target transaction.
In some embodiments of the present invention, the transaction information generated according to the target transaction request in step S104 includes a commit logical clock stamp of the target transaction, the oldest still running transaction at the start of the target transaction, and the last completed transaction at the end of the target transaction.
In this embodiment, the transaction number that is oldest and still running when the target transaction starts and the transaction number that has been completed last when the target transaction ends are used to assist in inter-node transaction determination.
Taking the inter-node transaction judgment as a visibility judgment example, if whether the transaction to be judged is visible or not is to be determined, a logic clock stamp submitted by the transaction to be judged needs to be acquired, but if the transaction to be judged is later than the oldest transaction number still running, the transaction to be judged is submitted, so that the transaction to be judged is visible; similarly, if the transaction number of the transaction with judgment is earlier than the latest completed transaction, the transaction to be judged is not visible.
By the technical scheme of the embodiment, the transaction to be judged can be rapidly judged in the process of judging the transaction among the nodes, so that the working efficiency of executing the target transaction is improved.
In some embodiments of the present invention, the determining in step S102 whether the target transaction request is executed at the node includes:
judging whether the target transaction is abandoned or whether the target transaction is submitted at the node;
if the target transaction is abandoned or submitted at the node, the target transaction processing request is judged to be finished at the node.
In this embodiment, the target transaction is aborted, that is, the target transaction is aborted and rolled back, and since the target task is not being executed continuously after being aborted, it is determined that the target transaction is finished executing at the node when the target transaction is aborted.
After the target transaction is completed at the node, the target transaction is submitted at the node, and then is synchronized to other nodes so as to carry out global synchronous submission. In this embodiment, when the target transaction is submitted to be completed at the node, it is determined that the execution of the target transaction at the node is finished, and the next transaction can be continuously executed without continuously waiting for global synchronous submission of the target transaction, thereby improving the working efficiency of the node for executing the transaction.
In this embodiment, the execution state of the target transaction can be accurately obtained by discarding the target transaction and completing and submitting the execution of the target transaction at the node as a judgment condition for ending the execution of the target transaction at the node.
In some embodiments of the present invention, the transaction management method of the database cluster of the present invention includes a step of executing a target transaction on a node, and a step of synchronizing transaction information, wherein the step of executing the target transaction is as shown in fig. 3, and includes the steps of:
step S202: starting a target transaction according to the target transaction processing request;
step S204: after the target transaction is started, recording a global transaction state table of the node in a cache of the node;
step S206: judging whether inter-node transaction judgment is needed;
if yes, go to step S208; if not, executing step S210;
step S208: acquiring transaction processing information corresponding to the transaction to be judged from the cache, and judging the transaction among nodes according to the transaction processing information;
step S210: judging whether the target transaction is abandoned or submitted at the node;
if yes, go to step S212;
step S212: and generating or updating a transaction synchronization information table according to the transaction information generated by the target transaction request.
The step of synchronizing transaction information is shown in fig. 4 and includes:
step S302: judging whether the quantity of transaction processing information stored in the transaction synchronization information table of the node is larger than or equal to a preset quantity;
if not, executing step S304; if yes, go to step S308;
step S304: judging whether the interval duration synchronized with the last transaction processing information is greater than or equal to the preset interval duration;
if yes, go to step S306; if not, returning to the step S302;
step S306: judging whether transaction processing information is stored in a transaction synchronization information table;
if yes, go to step S308; if not, returning to the step S302;
step S308: broadcasting the information to be synchronized in the transaction synchronization information table to other nodes.
In this embodiment, the step of synchronizing the transaction information further includes: after receiving the transaction information to be synchronized from other nodes, the node stores the transaction information to be synchronized in a global transaction state table of the node according to the transaction clock of the corresponding node according to the transaction information to be synchronized, so that the problem of synchronous blocking caused by different nodes when submitting the transaction is avoided, and the working efficiency of a database is improved.
In the process of determining whether the transaction synchronization information table has the information to be synchronized in the step S214, the node may synchronously acquire or process other transaction requests, thereby reducing transaction blocking and improving the working efficiency of executing the transaction.
An embodiment of the invention also provides a machine-readable storage medium and a computer device. FIG. 5 is a schematic diagram of a machine-readable storage medium 830 according to one embodiment of the invention; fig. 6 is a schematic diagram of a computer device 900 according to one embodiment of the invention. The machine-readable storage medium 830 has stored thereon a machine-executable program 840, which when executed by a processor, implements the transaction management method for a database cluster of any of the embodiments described above.
Computer device 900 may include a memory 920, a processor 910, and a machine executable program 840 stored on memory 920 and running on processor 910, and processor 910 implements the transaction management methods of the database clusters of any of the embodiments described above when executing machine executable program 840.
It should be noted that the logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any machine-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
For the purposes of this description of the embodiment, a machine-readable storage medium 830 can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the machine-readable medium may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
The computer device 900 may be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smartphone. In some examples, computer device 900 may be a cloud computing node. Computer device 900 may be described in the general context of computer-system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. Computer device 900 may be implemented in a distributed cloud computing environment where remote processing devices coupled via a communications network perform tasks. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
Computer device 900 may include a processor 910 adapted to execute stored instructions, a memory 920 providing temporary storage for the operation of the instructions during operation. Processor 910 may be a single core processor, a multi-core processor, a computing cluster, or any number of other configurations. Memory 920 may include Random Access Memory (RAM), read only memory, flash memory, or any other suitable storage system.
Processor 910 may be connected by a system interconnect (e.g., PCI-Express, etc.) to an I/O interface (input/output interface) adapted to connect computer device 900 to one or more I/O devices (input/output devices). The I/O devices may include, for example, a keyboard and a pointing device, which may include a touch pad or touch screen, among others. The I/O device may be a built-in component of the computer device 900 or may be a device externally connected to the computing device.
The processor 910 may also be linked by a system interconnect to a display interface suitable for connecting the computer device 900 to a display device. The display device may include a display screen as a built-in component of the computer device 900. The display device may also include a computer monitor, television, projector, or the like, that is externally connected to the computer device 900. Further, a network interface controller (network interface controller, NIC) may be adapted to connect the computer device 900 to a network through a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an internet small computer system interface, etc.) to transfer data. The network may be a cellular network, a radio network, a Wide Area Network (WAN), a Local Area Network (LAN), or the internet, among others. The remote device may be connected to the computing device through a network.
By now it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been shown and described herein in detail, many other variations or modifications of the invention consistent with the principles of the invention may be directly ascertained or inferred from the present disclosure without departing from the spirit and scope of the invention. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.

Claims (10)

1. A method for transaction management of a database cluster, comprising:
generating or updating a transaction synchronization information table under the condition that the target transaction processing request is finished in the execution of the node; wherein, the transaction synchronization information table stores at least transaction information generated according to the target transaction request;
judging whether the transaction information to be synchronized exists in the transaction synchronization information table or not under the condition that the generation or updating of the transaction synchronization information table is completed, and synchronously acquiring or processing other transaction requests; wherein,
the transaction information to be synchronized is stored in a global transaction state table of other nodes of the database cluster according to the transaction clock of the node.
2. The transaction management method of claim 1, wherein,
the judging whether the transaction processing information to be synchronized exists in the transaction synchronization information table comprises the following steps:
judging whether the number of the transaction processing information stored in the transaction synchronous information table is larger than or equal to a preset number;
if yes, judging that the to-be-synchronized transaction information exists in the transaction synchronization information table.
3. The transaction management method according to claim 1 or 2, wherein,
the judging whether the transaction processing information to be synchronized exists in the transaction synchronization information table comprises the following steps:
judging whether the interval duration synchronized with the last transaction processing information is greater than or equal to the preset interval duration;
if yes, judging whether transaction processing information is stored in the transaction synchronization information table;
if yes, judging that the to-be-synchronized transaction information exists in the transaction synchronization information table.
4. The transaction management method of claim 1, wherein,
after the judging whether the transaction processing information to be synchronized exists in the transaction synchronization information table, the method further comprises the following steps:
and if the transaction information to be synchronized exists in the transaction synchronization information table, broadcasting the transaction information to be synchronized to other nodes.
5. The transaction management method of claim 1, wherein,
the execution of the target transaction request at the node comprises the following steps:
if the transaction between the nodes is required to be judged, transaction processing information corresponding to the transaction to be judged is obtained from a local global transaction state table.
6. The transaction management method of claim 5, wherein,
the execution of the target transaction request at the node further comprises:
after the target transaction is started, the local global transaction state table is recorded into a local cache.
7. The transaction management method of claim 1, wherein,
the transaction information includes a commit logical clock stamp of the target transaction, the oldest still running transaction at the start of the target transaction, and the last completed transaction at the end of the target transaction.
8. The transaction management method of claim 1, wherein,
the target transaction request is executed at the node and is ended, including:
the target transaction is aborted or the target transaction is committed at the present node.
9. A machine-readable storage medium, having stored thereon a machine-executable program which, when executed by a processor, implements a method of transaction management of a database cluster according to any of claims 1-8.
10. A computer device comprising a memory, a processor and a machine executable program stored on the memory and running on the processor, and when the processor executes the machine executable program, implementing a method of transaction management of a database cluster according to any of claims 1-8.
CN202311865070.9A 2023-12-29 2023-12-29 Transaction management method for database cluster, readable storage medium and computer device Pending CN117827385A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311865070.9A CN117827385A (en) 2023-12-29 2023-12-29 Transaction management method for database cluster, readable storage medium and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311865070.9A CN117827385A (en) 2023-12-29 2023-12-29 Transaction management method for database cluster, readable storage medium and computer device

Publications (1)

Publication Number Publication Date
CN117827385A true CN117827385A (en) 2024-04-05

Family

ID=90509270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311865070.9A Pending CN117827385A (en) 2023-12-29 2023-12-29 Transaction management method for database cluster, readable storage medium and computer device

Country Status (1)

Country Link
CN (1) CN117827385A (en)

Similar Documents

Publication Publication Date Title
CN103036717A (en) Consistency maintenance system and methods for distributed-type data
CN113094430B (en) Data processing method, device, equipment and storage medium
CN112445626B (en) Data processing method and device based on message middleware
CN111897638A (en) Distributed task scheduling method and system
CN108881379B (en) Method and device for data synchronization between server clusters
CN111782235A (en) Data upgrading and querying method and device
CN110737510B (en) Block device management system
CN107025257B (en) Transaction processing method and device
CN112015595B (en) Master-slave database switching method, computing device and storage medium
CN113127564A (en) Parameter synchronization method and device
CN111245939B (en) Data synchronization method, device and system
CN108833147B (en) Configuration information updating method and device
CN117827385A (en) Transaction management method for database cluster, readable storage medium and computer device
CN114422537B (en) Multi-cloud storage system, multi-cloud data reading and writing method and electronic equipment
CN114205354B (en) Event management system, event management method, server, and storage medium
CN111367921A (en) Data object refreshing method and device
CN113783916B (en) Information synchronization method and device
CN115185787A (en) Method and device for processing transaction log
CN115277707A (en) Service processing method, device, electronic equipment and storage medium
CN113742376A (en) Data synchronization method, first server and data synchronization system
CN109582730B (en) Cache synchronization method, device, electronic equipment and computer readable storage medium
CN113783826A (en) Micro-service exception handling method and device
CN111866133A (en) Multi-source large-batch client data synchronization method and system
CN113448971A (en) Data updating method based on distributed system, computing node and storage medium
CN113761075A (en) Method, device, equipment and computer readable medium for switching databases

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