Storage point processing method, device and equipment, medium and product

By receiving the global preservation point in a distributed database and updating the corresponding savings point in the local preservation point linked list, the maintenance cost of the computing node to all data nodes is increased. Distributed transactions.

CN119336453AActive Publication Date: 2025-01-21WUHAN DAMENG DATABASE
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411435707.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-21
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

In a distributed database, the operation of computing nodes mapping save points to all data nodes leads to an increase in the maintenance cost of distributed transactions and causes local save points to accumulate, affecting the processing efficiency of data nodes.

Method used

By receiving global savepoints, find and update the first and second local savepoints in the local savepoint chain to avoid the accumulation of local savepoints. Specific steps include receiving the first and second global save points, finding matching or nearest local save points, and updating the local save point list based on these save points.

Benefits of technology

This method effectively avoids the accumulation of local preservation points, reduces the maintenance cost of distributed transactions, and improves the processing efficiency of data nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336453A_ABST
    Figure CN119336453A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a storage point processing method and device, equipment, a medium and a product, and the method comprises the steps: receiving a global storage point which comprises a first global storage point and a second global storage point; searching a first local saving point corresponding to the first global saving point in a local saving point linked list, wherein the first local saving point is a local saving point whose mark number is matched with the first specific mark number or a local saving point whose mark number is greater than the first specific mark number and is closest to the first specific mark number; searching a second local saving point corresponding to the second global saving point in a local saving point linked list, wherein the second local saving point is a local saving point whose label is matched with a second specific label or a local saving point whose label is located between the first specific label and the second specific label and is closest to the second specific label; the local storage point linked list is updated according to the first local storage point and the second local storage point, so that the accumulation phenomenon of the local storage points is avoided, and the maintenance cost of distributed transactions is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of database technology, and in particular to a save point processing method, apparatus, device, medium and product. Background Art

[0002] In a distributed database, the client only connects to a computing node (CN) to operate a distributed transaction. The operations of starting, rolling back, and setting save points of distributed transactions are expected to be transparent to the client, that is, the client can operate the computing node in a stand-alone manner. To this end, the save point Sn (called the global save point) on the computing node needs to be mapped to the local save point Sn_Lm of the data node (DN), which means that the global save point with the label n from the computing node corresponds to the local save point with the label m on the data node.

[0003] Assume that a distributed database has 1 computing node and 4 data nodes. Now connect the computing nodes to execute savepoint and Structured Query Language (SQL) operations. Each SQL may only involve some related data nodes, and the savepoint operation is fully broadcast to all data nodes for complete mapping. This ensures that when the computing node rolls back to the global savepoint Sn, each data node can find the corresponding Sn_Lm, and the SQL modification under its jurisdiction must be consistent with the global savepoint, so as to correctly complete the savepoint local rollback function of the distributed transaction. Although the above scheme can ensure the correctness of the function, the operation of mapping savepoints from computing nodes to all data nodes seriously increases the maintenance cost of distributed transactions; at the same time, it also causes the local savepoints mapped to the data nodes to accumulate, affecting the processing efficiency of the data nodes. Summary of the invention

[0004] The embodiments of the present disclosure provide a savepoint processing method, apparatus, device, medium and product, which avoid the accumulation of local savepoints and reduce the maintenance cost of distributed transactions.

[0005] In a first aspect, a savepoint processing method is provided, comprising:

[0006] receiving a global save point, wherein the global save point includes a first global save point and a second global save point, the first global save point corresponds to a first specific number, the second global save point corresponds to a second specific number, and the first specific number of the first global save point is greater than the second specific number corresponding to the second global save point;

[0007] Searching the local savepoint linked list for a first local savepoint corresponding to the first global savepoint, the first local savepoint being a local savepoint whose label matches the first specific label or a local savepoint whose label is greater than the first specific label and is closest to the first specific label;

[0008] Searching the local save point linked list for a second local save point corresponding to the second global save point, where the second local save point is a local save point whose label matches the second specific label or a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label;

[0009] The local savepoint linked list is updated according to the first local savepoint and the second local savepoint.

[0010] In a second aspect, a save point processing device is provided, comprising:

[0011] a savepoint receiving module, configured to receive a global savepoint, wherein the global savepoint includes a first global savepoint and a second global savepoint, the first global savepoint corresponds to a first specific number, the second global savepoint corresponds to a second specific number, and the first specific number of the first global savepoint is greater than the second specific number corresponding to the second global savepoint;

[0012] A first search module is used to search a local save point chain list for a first local save point corresponding to the first global save point, where the first local save point is a local save point whose label matches the first specific label or a local save point whose label is greater than the first specific label and is closest to the first specific label;

[0013] a second search module, configured to search the local save point linked list for a second local save point corresponding to the second global save point, wherein the second local save point is a local save point whose label matches the second specific label or a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label;

[0014] An updating module is used to update the local save point linked list according to the first local save point and the second local save point.

[0015] In a third aspect, an electronic device is provided, including:

[0016] one or more processors;

[0017] a storage device for storing one or more programs,

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the save point processing method as described in the first aspect above.

[0019] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the save point processing method as described in the first aspect is implemented.

[0020] In a fifth aspect, a computer program product is provided, the computer program product comprising a computer program, the computer program implementing the save point processing method as described in the first aspect above when executed by a processor

[0021] The embodiments of the present disclosure disclose a savepoint processing method, apparatus, device, medium and product, including: receiving a global savepoint, wherein the global savepoint includes a first global savepoint and a second global savepoint, the first global savepoint corresponds to a first specific label, the second global savepoint corresponds to a second specific label, and the first specific label of the first global savepoint is greater than the second specific label corresponding to the second global savepoint; searching a local savepoint linked list for a first local savepoint corresponding to the first global savepoint, the first local savepoint being a local savepoint whose label matches the first specific label or a local savepoint whose label is greater than the first specific label and is closest to the first specific label; searching the local savepoint linked list for a second local savepoint corresponding to the second global savepoint, the second local savepoint being a local savepoint whose label matches the second specific label or a local savepoint whose label is between the first specific label and the second specific label and is closest to the second specific label; and updating the local savepoint linked list according to the first local savepoint and the second local savepoint. This technical solution uses the first global save point to determine the first local save point, uses the second global save point to determine the second local save point, and updates the current save point linked list according to the first local save point and the second local save point, thereby avoiding the accumulation of local save points and reducing the maintenance cost of distributed transactions.

[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the embodiments of the present disclosure. Other features of the embodiments of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 is a flow chart of a save point processing method provided in the first embodiment of the present disclosure;

[0025] Figure 2 is a schematic diagram of a save point processing process provided by the first embodiment of the present disclosure;

[0026] Figure 3 is a structural schematic diagram of a save point processing device provided in Embodiment 2 of the present disclosure;

[0027] Figure 4 It is a structural diagram of an electronic device provided in Embodiment 3 of the present disclosure. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solutions of the embodiments of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only embodiments of a part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the embodiments of the present disclosure.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0030] Embodiment 1

[0031] Figure 1This is a flowchart of a save point processing method provided in the first embodiment of the present disclosure. This embodiment is applicable to the case of processing save points. The method can be executed by a save point processing device. The save point processing device can be implemented in the form of hardware and / or software. The save point processing device can be configured in an electronic device, and the electronic device includes but is not limited to a computer, a terminal, a server and other devices with data processing capabilities. Figure 1 As shown, the method includes:

[0032] S110. Receive global save points, wherein the global save points include a first global save point and a second global save point, the first global save point corresponds to a first specific number, the second global save point corresponds to a second specific number, and the first specific number of the first global save point is greater than the second specific number corresponding to the second global save point.

[0033] In this embodiment, the computing node can broadcast a global save point to the relevant data nodes. The global save point can be a save point created by the computing node (CN) in the context of a distributed transaction. This save point is global because it is for the entire distributed transaction and is not limited to a specific data node. The global save point includes a first global save point and a second global save point. The first global save point corresponds to a first specific number, and the second global save point corresponds to a second specific number. The first specific number of the first global save point is greater than the second specific number corresponding to the second global save point.

[0034] It should be noted that the relevant data nodes can be the data nodes associated with the SQL instructions. The computing nodes can also send SQL instructions to the relevant data nodes when broadcasting the global save points to the relevant data nodes, thereby avoiding the maintenance cost of distributed transactions caused by the computing nodes mapping save points to all data nodes.

[0035] Exemplarily, the first global save point may be represented as Sc, and the second global save point may be represented as Sp, wherein the first specific number may be represented as c, the second specific number may be represented as p, and c is greater than p. That is, it can be understood that the computing node may send the latest first global save point Sc and the second latest second global save point Sp located before the first global save point Sc to the relevant data nodes.

[0036] S120. Search the local save point linked list for a first local save point corresponding to the first global save point, where the first local save point is a local save point whose label matches the first specific label or a local save point whose label is greater than the first specific label and is closest to the first specific label.

[0037] It can be known that after receiving the first global save point and the second global save point, the relevant data node can search the local save point linked list for the first local save point corresponding to the first global save point, wherein the first local save point is a local save point whose number matches the first specific number or a local save point whose number is greater than the first specific number and is closest to the first specific number.

[0038] The local savepoint linked list includes multiple local savepoints, each local savepoint corresponds to a label, and each label includes the label of the global savepoint corresponding to the local savepoint, an underscore, and the label of the local savepoint in the local savepoint linked list. Exemplarily, the first global savepoint can be represented as Sc, and the first local savepoint can be represented as Sc_Lm, where c is the label of the first global savepoint, and m can be the label of the local savepoint in the local savepoint linked list (only as a reference, not indicating that the local savepoint labels are equal), and it can be considered that Sc matches Sc_Lm.

[0039] Specifically, the first local save point corresponding to the first global save point is searched in the local save point linked list. If the local save point corresponding to the first global save point exists in the local save point linked list, it is determined as the first local save point. If the local save point corresponding to the first global save point does not exist, the local save point with a label greater than the first specific label is determined as the first local save point.

[0040] Exemplarily, the first global save point can be represented as Sc, and if Sc_Lm exists, Sc_Lm can be determined as the first local save point matching Sc. If Sc_Lm does not exist, the local save point Sn_Lm with a number greater than c and closest to c can be determined as the first local save point (m is only used as a reference and does not mean that the local save point numbers are equal), where n>c.

[0041] S130. Search the local save point linked list for a second local save point corresponding to the second global save point, where the second local save point is a local save point whose label matches the second specific label or a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label.

[0042] In this embodiment, after receiving the second global save point, the relevant data node can search the local save point linked list for the second local save point corresponding to the second global save point. The second local save point is a local save point whose label matches the second specific label or a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label. Exemplarily, the second global save point can be represented as Sp, and if Sp_Lm exists, Sp_Lm can be determined as the second local save point matching Sp. If Sp_Lm does not exist, the local save point Sq_Lm located between the first specific label c and the second specific label p and closest to p can be determined as the second local save point matching Sp, where c>q>p.

[0043] S140: Update the local save point linked list according to the first local save point and the second local save point.

[0044] In this embodiment, after the first local save point and the second local save point are determined, the local save point linked list may be updated according to the first local save point and the second local save point.

[0045] Specifically, after the first local save point is determined, the local save points in the local save point linked list that are located after the first local save point can be cleared; after the first local save point and the second local save point are determined, the other local save points in the local save point linked list that are located between the first local save point and the second local save point can be cleared to avoid local save point accumulation.

[0046] This embodiment provides a savepoint processing method, including: receiving a global savepoint, wherein the global savepoint includes a first global savepoint and a second global savepoint, the first global savepoint corresponds to a first specific label, the second global savepoint corresponds to a second specific label, and the first specific label of the first global savepoint is greater than the second specific label corresponding to the second global savepoint; searching a local savepoint linked list for a first local savepoint corresponding to the first global savepoint, the first local savepoint being a local savepoint whose label matches the first specific label or a local savepoint whose label is greater than the first specific label; searching the local savepoint linked list for a second local savepoint corresponding to the second global savepoint, the second local savepoint being a local savepoint whose label matches the second specific label or a local savepoint whose label is between the first specific label and the second specific label; and updating the local savepoint linked list according to the first local savepoint and the second local savepoint, thereby avoiding the phenomenon of accumulation of local savepoints and reducing the maintenance cost of distributed transactions.

[0047] As an optional implementation manner of this embodiment, the savepoint processing method provided in this embodiment, after updating the local savepoint linked list according to the first local savepoint and the second local savepoint, the method further includes:

[0048] 1) accepting a rollback request, wherein the rollback request includes a target global save point, and the target global save point corresponds to a target label;

[0049] In this embodiment, when executing a local rollback of a distributed transaction, a computing node may send a rollback request to a target data node, and the target data node may accept the rollback request sent by the computing node. The rollback request may include a target global save point, the target global save point corresponds to a target label, the target global save point may be a global save point corresponding to the rollback request, and the target label may be a label corresponding to the target global save point. Exemplarily, the target global save point may be represented as Sr, and the target label may be r.

[0050] 2) when there is a first target local savepoint whose label matches the target label in the local savepoint linked list, executing the rollback request to roll back to the first target local savepoint;

[0051] It can be known that when there is a first target local save point whose label matches the target label in the local save point linked list, the rollback request can be executed and rolled back to the first target local save point; wherein the first target local save point can be a mapping of the target global save point on the data node. Exemplarily, when there is a local save point Sr_Lm in the local save point linked list, it can be considered that Sr_Lm matches the target label r (m is the label of the local save point in the same data node in the local save point linked list, and does not participate in the process of matching the label with the target label). Therefore, Sr_Lm can be confirmed as the first target local save point. After the first target local save point is determined, a local rollback can be directly executed and rolled back to the first target local save point Sr_Lm.

[0052] 3) When the first target local save point does not exist in the local save point linked list, determine a second target local save point that is located after the target number and closest to the target number.

[0053] It should be explained that, on a data node that has a mapping relationship with a target global save point, there may be a local save point that matches the target global save point, so the first target local save point that matches the target global save point may not necessarily exist in the local save point linked list of the data node. Therefore, when there is no first target local save point whose label matches the target label in the local save point linked list, a second target local save point that is located after the target label and closest to the target label may be determined.

[0054] Exemplarily, the target global savepoint can be denoted as Sr, and the target label can be r. When Sr_Lm does not exist, the second target local savepoint with a label greater than r and closest to r can be confirmed. The second target local savepoint can be denoted as Sq_Lm. Because when Sr < Sq, rolling back Sr by the CN will definitely roll back Sq as well.

[0055] 4) After determining the second target local savepoint, execute the rollback request and roll back to the second target local savepoint.

[0056] Continuing with the above description, after the second target local savepoint is determined, the rollback request can be executed to roll back to the second target local savepoint. Specifically, when the first target local savepoint Sr_Lm does not exist, Sq_Lm with a label greater than r and closest to r can be determined to perform a local rollback. Because when Sr < Sq, rolling back Sr by the CN will definitely roll back Sq as well.

[0057] It should be noted that if the second target local savepoint does not exist, it can be considered that the first target local savepoint Sr and the subsequent savepoints are not mapped on this data node. Therefore, this data node does not need to perform a rollback.

[0058] As an optional implementation manner of this embodiment, updating the local savepoint linked list according to the first local savepoint and the second local savepoint further includes:

[0059] 1) After the first local savepoint is determined, clear the local savepoints in the local savepoint linked list that are after the first local savepoint;

[0060] In this embodiment, after the first local savepoint is determined, the local savepoints in the local savepoint linked list that are after the first local savepoint can be cleared. Exemplarily, since the computing node sends the first global savepoint as the latest global savepoint to the relevant data node, the first global savepoint can be denoted as Sc, and the global savepoints greater than Sc have been removed by the computing node. Therefore, the first local savepoint can be denoted as Sc_Lm, and the local savepoints in the local savepoint linked list that are after Sc_Lm can be cleared to achieve synchronous removal on the data node.

[0061] 2) After the first local savepoint and the second local savepoint are determined, clear the local savepoints in the local savepoint linked list that are between the first local savepoint and the second local savepoint.

[0062] In this embodiment, after the first local savepoint and the second local savepoint are determined, the local savepoints in the local savepoint linked list that are between the first local savepoint and the second local savepoint can be cleared.

[0063] Exemplarily, the first local save point may be represented as Sc_Lm, the second local save point may be represented as Sp_Lm, and other local save points between Sc_Lm and Sp_Lm in the local save point linked list may be cleared.

[0064] In one embodiment, searching the local savepoint linked list for the first local savepoint corresponding to the first global savepoint includes:

[0065] 1) searching the local savepoint chain list for a local savepoint that matches the first specific label;

[0066] In this embodiment, after receiving the global save point, a local save point matching the first specific label may be searched in the local save point linked list, wherein the first specific label may be the label of the first global save point in the global save points.

[0067] 2) if there is a local save point matching the first specific label, the local save point matching the first specific label is used as the first local save point;

[0068] It can be known that if there is a local save point matching the first specific label in the local save point list, it can be considered that the first global save point has a mapping in the local save point list, and the local save point matching the first characteristic label can be used as the first local save point, and the first local save point can be the mapping of the first global save point on the data node.

[0069] Specifically, since the local save points belonging to the same data node have the same label, when the label of the global save point corresponding to the local save point is consistent with the global save point, the local save point can be considered to match the global save point. Exemplarily, the first global save point can be represented as Sc, and the first specific label is c. If Sc_Lm exists in the local save point linked list, it can be considered that Sc_Lm matches Sc, and Sc_Lm can be used as the first local save point. Among them, c is the label of the first global save point corresponding to the local save point, and m can be the label of the local save point in the local save point linked list (only as a reference, not indicating that the labels are the same).

[0070] 3) If there is no local save point matching the first specific number, search the local save point linked list for a local save point whose number is greater than the first specific number and which is closest to the first specific number as the first local save point.

[0071] It can be known that if there is no local savepoint matching the first specific number in the local savepoint linked list, a local savepoint with a number greater than the first specific number can be searched in the local savepoint linked list. If there is a local savepoint with a number greater than the first specific number and closest to the first specific number in the local savepoint linked list, it can be used as the first local savepoint.

[0072] Exemplarily, the first global save point can be represented as Sc, and the first specific number is c. If Sc_Lm does not exist in the local save point list, then the local save point Sn_Lm with a number greater than c and closest to c can be searched in the local save point list, where n is greater than and closest to c. When it is determined that Sn_Lm exists, it can be considered that Sn on the computing node has been removed, and the relevant SQL modification is taken over by Sc. The corresponding data node should also remove Sn_Lm and subsequent save points and hand over the relevant modifications to Sc. Therefore, Sn_Lm can be directly replaced with Sc_Lm without changing the local save point number m, and Sn_Lm can be determined as the first local save point.

[0073] Optionally, updating the local savepoint linked list according to the first local savepoint and the second local savepoint may further include:

[0074] If the number is greater than the first specific number and the local save point closest to the first specific number does not exist, a local save point is set in the local save point linked list as the first local save point.

[0075] It should be noted that if there is no local save point in the local save point linked list whose number is greater than the first specific number and is closest to the first specific number, a local save point can be set in the local save point linked list (such as adding a new local save point), and the set save point will be used as the first local save point.

[0076] In one embodiment, searching the local savepoint linked list for the second local savepoint corresponding to the second global savepoint includes:

[0077] 1) searching the local savepoint chain list for a local savepoint that matches the second specific label;

[0078] In this embodiment, after the first local save point is determined, a second local save point matching the second specific label may be searched in the local save point linked list, wherein the second specific label may be the label of the second global save point in the global save points.

[0079] 2) if there is a local save point matching the second specific label, use the local save point matching the second specific label as the second local save point;

[0080] Specifically, if there is a local save point matching the second specific number in the local save point linked list, the local save point matching the second specific number may be used as the second local save point.

[0081] Exemplarily, the second global save point may be represented as Sp, and the second specific number may be represented as p. If Sp_Lm exists in the local save point linked list, it may be considered that Sp_Lm matches Sp, and Sp_Lm may be used as the second local save point.

[0082] 3) If there is no local save point matching the second specific label, search the local linked list for a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label as the second local save point.

[0083] Specifically, if there is no local save point matching the second specific label in the local save point linked list, a local save point with a label between the first specific label and the second specific label and closest to the second specific label can be searched from the local linked list as the second local save point.

[0084] Exemplarily, the first specific number may be represented as c, the second specific number may be represented as p, and c is greater than p. If Sp_Lm does not exist in the local savepoint linked list, the local savepoint linked list may be searched for a local savepoint Sq_Lm whose number is between c and p and closest to p, where c>q>p. If Sq_Lm exists, Sq_Lm may be used as the second local savepoint.

[0085] Optionally, searching the local savepoint linked list for a second local savepoint corresponding to the second global savepoint may further include:

[0086] If the label is between the first specific label and the second specific label and the local save point closest to the second specific label does not exist, there is no need to clear the local save point.

[0087] Specifically, if there is no local save point in the local save point linked list whose number is between the first specific number and the second specific number and is closest to the second specific number, it can be considered that there is no accumulation of local save points and there is no need to clear the local save points.

[0088] Figure 2 A schematic diagram of a save point processing process provided in this embodiment, such as Figure 2As shown, the data node can receive the global save point sent by the computing node, and the global save point includes the first global save point (Sc) and the second global save point (Sp). The data node can also accept the SQL instruction sent by the computing node, confirm whether the first local save point (Sc_Lm) exists in the local save point linked list, and if the first local save point (Sc_Lm) exists, remove the save point located after the first local save point (Sc_Lm) in the local save point linked list; if the first local save point (Sc_Lm) does not exist, it can be determined whether Sn_Lm (Sn_Lm is a local save point with a number greater than the first specific number (c) and closest to the first specific number (c)) exists. If Sn_Lm exists, Sn_Lm is used to replace the first local save point (Sc_Lm), and the save point located after the first local save point (Sc_Lm) in the local save point linked list is removed; if Sn_Lm does not exist, the local save point can be set as the first local save point (Sc_Lm). After the first local save point (Sc_Lm) is determined, it is also possible to confirm whether the second local save point (Sp_Lm) exists. If the second local save point (Sp_Lm) exists, other local save points between the second local save point (Sp_Lm) and the first local save point (Sc_Lm) can be directly removed, and the SQL instructions sent by the computing node are executed; if the second local save point (Sp_Lm) does not exist, it is possible to confirm whether Sq_Lm (Sq_Lm is a local save point whose number is between the first specific number (c) and the second specific number (p) and is closest to the second specific number (p)) exists. If Sq_Lm exists, Sq_Lm can be used to replace the second local save point (Sp_Lm), and other local save points between the second local save point (Sp_Lm) and the first local save point (Sc_Lm) can be removed; if Sq_Lm does not exist, it is considered that no local save point accumulation is currently generated, and the SQL instructions sent by the computing node can continue to be executed, thereby avoiding the phenomenon of local save point accumulation and reducing the maintenance cost of distributed transactions.

[0089] This embodiment also provides a technical solution for the application of the save point processing method. Table 1 is an application example of the save point processing method provided in this embodiment, as shown in Table 1.

[0090] Table 1 Application examples of savepoint processing methods

[0091]

[0092] The latest checkpoint set on the computing node CN can be denoted as Sc (the first global checkpoint, corresponding to the first specific label r), the second latest checkpoint set (i.e., the latest checkpoint set before Sc) can be denoted as Sp (the second global checkpoint, corresponding to the second specific label p), and the next checkpoint set after Sc can be denoted as Sn. Since the checkpoint labels are incremented, we have p < c < n. Correspondingly, the local checkpoints mapped by the aforementioned checkpoints on the data node DN are denoted as Sp_Lm (the second local checkpoint), Sc_Lm (the first local checkpoint), and Sn_Lm respectively. Here, the local checkpoint label m is only used as a placeholder and does not mean that the local labels are equal.

[0093] The overall idea of the solution is as follows:

[0094] Step 1. When the CN broadcasts an SQL instruction to the relevant DNs, it needs to send the labels of Sc and Sp in the current checkpoint linked list to the target DNs. The irrelevant DNs do not need to map this global checkpoint.

[0095] Step 2. When a DN receives an SQL instruction, it needs to first map the global checkpoint [Sp, Sc] to the local according to the following steps, and then execute the SQL instruction

[0096] a) Search for Sc_Lm in the local checkpoint linked list. If found, it means that Sc has been mapped locally and there is no need to add it again. However, if there is Sn_Lm (the local checkpoint with a label greater than the first specific label c and closest to the first specific label c), then Sn_Lm and the subsequent checkpoints need to be removed because Sc is the latest checkpoint sent by the CN, and the checkpoint Sn newer than it has been removed by the CN, so it also needs to be removed synchronously on the DN. For example, the execution process 8 of DN1 in Table 1.

[0097] b) If Sc_Lm is not found.

[0098] i) But Sn_Lm (i.e., the checkpoint set after Sc) is found, which means that Sn on the CN has been removed, and the relevant SQL modifications are taken over by Sc. Then the DN should also remove Sn_Lm and the subsequent checkpoints and hand over the relevant modifications to Sc for takeover. Therefore, Sn_Lm can be directly replaced by Sc_Lm without changing the local checkpoint label m. For example, the execution process 8 of DN2 in Table 1.

[0099] ii) If Sn_Lm is not found either, a corresponding new checkpoint Sc_Lm can be directly set on the DN. For example, the execution process 6 of DN1 in Table 1.

[0100] Step 3: Although Steps 1 and 2 can ensure that the latest global savepoint Sc can always be mapped to the DN that has executed the associated SQL, they cannot guarantee that when the savepoint is removed on the CN, its mapping on the DN can also be removed in a timely manner. For example, when the CN execution process 5-10 in Table 1 is executed, DN3 will receive the latest global savepoints S3 and S4 in sequence and set the local savepoints S3_L2 and S4_L3. The operation of the CN to remove S3 cannot be perceived by DN3. Therefore, when the CN repeatedly executes the process 5-10, it will cause the savepoints on DN3 to accumulate continuously. For this reason, the DN also needs to perform the cleanup of invalid savepoints according to the second latest savepoint Sp in [Sp, Sc] sent by the CN. The specific steps are as follows:

[0101] a) After adding Sc_Lm, continue to search for Sp_Lm. If found, remove the savepoints between Sp_Lm and Sc_Lm. For example, the DN3 execution process 10 in Table 1.

[0102] b) If Sp_Lm is not found, but Sq_Lm (the local savepoint with the label between the first specific label r and the second specific label q and closest to the second specific label q) is found, where q>p, it means that Sq has also been removed by the CN, and the relevant modifications are taken over by Sp. Therefore, the DN also needs to remove Sq_Lm and the savepoints between it and Sc_Lm and hand over the relevant SQL modifications to Sp for takeover. Therefore, without changing the local savepoint label m, Sq_Lm can be directly replaced by Sp_Lm, and at the same time, the savepoints between Sp_Lm and Sc_Lm are removed. For example, the DN4 execution process 10 in Table 1.

[0103] C) If Sq_Lm is not found either, it means that the savepoint removed by the CN has no mapping on this DN, and no cleanup needs to be performed.

[0104] Step 4: When the CN executes a distributed transaction partial rollback, it needs to broadcast the rollback request and the target savepoint Sr of the rollback to all associated DNs for local rollback. The DN processing steps are as follows:

[0105] a) If the DN can find the savepoint Sr_Lm (the first target local savepoint) that is the local mapping of Sr (the target global savepoint, r is the target label), it can directly perform a local rollback to Sr_Lm. For example, DN1 in Table 1 rolls back to S2.

[0106] b) Since the global savepoint has a mapping only on the associated DNs, there may not be a mapping of Sr on the DN. At this time, it is necessary to find Sq_Lm (the second target local savepoint) with a label greater than r and closest to r to perform a local rollback, because when Sr < Sq, the CN rollback of Sr will definitely roll back Sq as well. For example, DN1 in Table 1 rolls back to S1.

[0107] c) If Sq_Lm is not found on the DN, it means that Sr and its subsequent save points are not mapped on the DN, and the related SQL is not executed on the DN, so the DN does not need to be rolled back. For example, DN1 in Table 1 rolls back to S4.

[0108] The technical solution for save point processing of distributed transactions provided in this embodiment is that only the DN that executes the associated SQL needs to map the nearest global save point, which reduces the maintenance cost of distributed transactions; and the operation of removing the global save point on the CN needs to be notified to the associated DN to avoid accumulation of local save points mapped to the DN; the local rollback operation on the CN needs to be correctly reflected on all DNs, and the final rollback result should be the same as that of a stand-alone database.

[0109] Embodiment 2

[0110] Figure 3 is a schematic diagram of the structure of a save point processing device provided in the second embodiment of the present disclosure; Figure 3 As shown, the device includes: a save point receiving module 210, a first search module 220, a second search module 230, and an update module 240.

[0111] The save point receiving module 210 is used to receive a global save point, wherein the global save point includes a first global save point and a second global save point, the first global save point corresponds to a first specific number, the second global save point corresponds to a second specific number, and the first specific number of the first global save point is greater than the second specific number corresponding to the second global save point;

[0112] A first search module 220 is used to search the local save point linked list for a first local save point corresponding to the first global save point, where the first local save point is a local save point whose number matches the first specific number or a local save point whose number is greater than the first specific number and is closest to the first specific number;

[0113] A second search module 230 is used to search in the local save point linked list for a second local save point corresponding to the second global save point, where the second local save point is a local save point whose label matches the second specific label or a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label;

[0114] The updating module 240 is configured to update the local save point linked list according to the first local save point and the second local save point.

[0115] The second embodiment of the present disclosure provides a savepoint processing device, which avoids the accumulation of local savepoints and reduces the maintenance cost of distributed transactions.

[0116] Furthermore, the update module 240 is further configured to:

[0117] After the first local save point is determined, clearing the local save points in the local save point linked list that are located after the first local save point;

[0118] After the first local save point and the second local save point are determined, the local save points between the first local save point and the second local save point in the local save point linked list are cleared.

[0119] Furthermore, the first search module 220 is further configured to:

[0120] Searching the local savepoint linked list for a local savepoint matching the first specific label;

[0121] If there is a local save point matching the first specific label, use the local save point matching the first specific label as the first local save point;

[0122] If there is no local save point matching the first specific label, search the local save point linked list for a local save point with a label greater than the first specific label and closest to the first specific label as the first local save point.

[0123] Furthermore, the first search module 220 is further configured to:

[0124] If the number is greater than the first specific number and the local save point closest to the first specific number does not exist, a local save point is set in the local save point linked list as the first local save point.

[0125] Furthermore, the second search module 230 is further configured to:

[0126] Searching the local save point chain list for a local save point that matches the second specific label;

[0127] If there is a local save point matching the second specific label, use the local save point matching the second specific label as the second local save point;

[0128] If there is no local save point matching the second specific label, search the local linked list for a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label as the second local save point.

[0129] Furthermore, the second search module 230 is further configured to:

[0130] If the label is between the first specific label and the second specific label and the local save point closest to the second specific label does not exist, there is no need to clear the local save point.

[0131] Furthermore, the device also includes:

[0132] A receiving module, configured to receive a rollback request, wherein the rollback request includes a target global save point, and the target global save point corresponds to a target label;

[0133] an execution module, configured to execute the rollback request to roll back to the first target local save point when there is a first target local save point with a label matching the target label in the local save point linked list;

[0134] A second target local save point determination module, configured to determine a second target local save point that is located after the target number and closest to the target number when the first target local save point does not exist in the local save point linked list;

[0135] The rollback module is used to execute the rollback request and roll back to the second target local save point after determining the second target local save point.

[0136] The save point processing device provided in the embodiments of the present disclosure can execute the save point processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0137] Embodiment 3

[0138] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present disclosure described and / or claimed herein.

[0139] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0140] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0141] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microprocessor, etc. The processor 11 executes the various methods and processes described above, such as a save point processing method.

[0142] In some embodiments, the save point processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the save point processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the save point processing method in any other appropriate manner (e.g., by means of firmware).

[0143] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] The computer programs for implementing the methods of the embodiments of the present disclosure may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0145] In the context of the disclosed embodiments, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0146] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0147] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0148] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0149] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the embodiments of the present disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions of the embodiments of the present disclosure can be achieved, and this document does not limit this.

[0150] The above specific implementations do not constitute a limitation on the protection scope of the embodiments of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the embodiments of the present disclosure shall be included in the protection scope of the embodiments of the present disclosure.

[0151] The embodiments of the present disclosure also provide a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements the save point processing method provided in any embodiment of the present application.

[0152] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to write computer program codes for performing the operation of the disclosed embodiments, the programming languages ​​including object-oriented programming languages, such as Java, Smalltalk, C++, and also including conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).

[0153] Note that the above are only preferred embodiments of the embodiments of the present disclosure and the technical principles used. Those skilled in the art will understand that the embodiments of the present disclosure are not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present disclosure. Therefore, although the embodiments of the present disclosure are described in more detail through the above embodiments, the embodiments of the present disclosure are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present disclosure, and the scope of the embodiments of the present disclosure is determined by the scope of the attached claims.

Claims

1. A save point processing method, characterized in that: include: receiving a global save point, wherein the global save point includes a first global save point and a second global save point, the first global save point corresponds to a first specific number, the second global save point corresponds to a second specific number, and the first specific number of the first global save point is greater than the second specific number corresponding to the second global save point; Searching the local savepoint linked list for a first local savepoint corresponding to the first global savepoint, the first local savepoint being a local savepoint whose label matches the first specific label or a local savepoint whose label is greater than the first specific label and is closest to the first specific label; Searching the local save point linked list for a second local save point corresponding to the second global save point, where the second local save point is a local save point whose label matches the second specific label or a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label; The local savepoint linked list is updated according to the first local savepoint and the second local savepoint.

2. The method according to claim 1, characterized in that: Updating the local savepoint linked list according to the first local savepoint and the second local savepoint includes: After the first local save point is determined, clearing the local save points in the local save point linked list that are located after the first local save point; After the first local save point and the second local save point are determined, the local save points between the first local save point and the second local save point in the local save point linked list are cleared.

3. The method according to claim 1, characterized in that The searching the local savepoint linked list for the first local savepoint corresponding to the first global savepoint includes: Searching the local savepoint linked list for a local savepoint matching the first specific label; If there is a local save point matching the first specific label, use the local save point matching the first specific label as the first local save point; If there is no local save point matching the first specific label, search the local save point linked list for a local save point with a label greater than the first specific label and closest to the first specific label as the first local save point.

4. The method according to claim 3, characterized in that Also includes: If the number is greater than the first specific number and the local save point closest to the first specific number does not exist, a local save point is set in the local save point linked list as the first local save point.

5. The method according to claim 1, characterized in that The searching the local savepoint linked list for the second local savepoint corresponding to the second global savepoint includes: Searching the local save point chain list for a local save point that matches the second specific label; If there is a local save point matching the second specific label, use the local save point matching the second specific label as the second local save point; If there is no local save point matching the second specific label, searching the local linked list for a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label as the second local save point; If the label is between the first specific label and the second specific label and the local save point closest to the second specific label does not exist, there is no need to clear the local save point.

6. The method according to claim 1, characterized in that After updating the local savepoint linked list according to the first local savepoint and the second local savepoint, the method further includes: receiving a rollback request, the rollback request including a target global savepoint, the target global savepoint corresponding to a target label; When there is a first target local savepoint in the local savepoint linked list whose label matches the target label, executing the rollback request to roll back to the first target local savepoint; When the first target local save point does not exist in the local save point linked list, determining a second target local save point that is located after the target number and closest to the target number; After determining the second target local save point, executing the rollback request, and rolling back to the second target local save point.

7. A save point processing device, characterized in that: include: a savepoint receiving module, configured to receive a global savepoint, wherein the global savepoint includes a first global savepoint and a second global savepoint, the first global savepoint corresponds to a first specific number, the second global savepoint corresponds to a second specific number, and the first specific number of the first global savepoint is greater than the second specific number corresponding to the second global savepoint; A first search module is used to search a local save point chain list for a first local save point corresponding to the first global save point, where the first local save point is a local save point whose label matches the first specific label or a local save point whose label is greater than the first specific label and is closest to the first specific label; a second search module, configured to search the local save point linked list for a second local save point corresponding to the second global save point, wherein the second local save point is a local save point whose label matches the second specific label or a local save point whose label is between the first specific label and the second specific label and is closest to the second specific label; An updating module is used to update the local save point linked list according to the first local save point and the second local save point.

8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the save point processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the save point processing method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the save point processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for ensuring consistency of duplicated transactions and corresponding duplicating device

    CN110262929A

  • Data access method, device and equipment and storage medium

    CN110502535A

  • Flink self-starting method based on file storage system

    CN118605966A

  • Transaction savepoint management apparatus and method for distributed database

    US20210081429A1