Distributed Transaction Management Device and Distributed Transaction Management Method

The distributed transaction management system addresses inconsistencies in two-phase commit processes by managing transaction logs through timely deletion and compression, ensuring data consistency and reducing storage requirements in cloud and container environments.

JP7701961B2Active Publication Date: 2025-07-02HITACHI LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2023160237
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2025-07-02
Estimated Expiration
2043-09-25

AI Technical Summary

Technical Problem

In distributed transaction systems, particularly in cloud or container environments, the two-phase commit process can lead to inconsistencies due to latency, causing the order of processing to reverse, resulting in increased storage requirements for transaction logs without a clear method to delete logs efficiently, especially in rollback scenarios.

Method used

A distributed transaction management system that includes a storage device and an information processing device to manage transaction logs by recording commit or rollback results, deleting logs upon receiving rollback completion notifications, and using transaction identifiers to compress logs, thereby reducing storage needs while maintaining consistency.

Benefits of technology

The system effectively prevents storage area increases in transaction logs while ensuring data consistency by managing logs through timely deletion and compression, addressing the inconsistencies and inefficiencies of traditional two-phase commit methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007701961000001
    Figure 0007701961000001
  • Figure 0007701961000002
    Figure 0007701961000002
  • Figure 0007701961000003
    Figure 0007701961000003
Patent Text Reader

Abstract

To provide a distributed transaction management device and a distributed transaction management method that can prevent an increase in a storage area of a transaction log while ensuring consistency of a distributed transaction.SOLUTION: A distributed transaction management device records a transaction settlement result log that indicates a settlement result of a transaction in a distributed transaction system. The distributed transaction management device deletes, when receiving a rollback processing completion notification from any one of a plurality of resource management units participating in the transaction, the rollback transaction conclusion result log.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a distributed transaction management apparatus and a distributed transaction management method.

Background Art

[0002] The adoption of the microservices architecture is starting. The microservices architecture is an architectural style in which a software system is constructed as a collection of small, independent services. Each service is responsible for a specific business function or set of functions and is executed as its own process. Enterprise systems are also starting to come within the scope of application of the microservices architecture, and data consistency under distributed transactions that guarantee the consistency of data update processing across multiple services is required. For this reason, the development of a distributed transaction control function for microservices is underway.

[0003] One of the typical specifications for distributed transactions is XA. In XA, it is possible to maintain data consistency between services by using a consensus protocol called two-phase commit. In this two-phase commit, when the transaction outcome is determined to be commit, the log is persisted (the log is saved to persistent storage), but when the transaction outcome is determined to be rollback, the log is not persisted. When a recovery request is made in a state where there is no log, it is determined to be a rollback. Patent Documents 1 and 2 disclose systems that execute transaction processing by two-phase commit.

Prior Art Documents

Patent Documents

[0004]

Patent Document 1

Patent Document 2

Summary of the Invention

Problems to be Solved by the Invention

[0005] In the case of the conventional two-phase commit, in a cloud or container environment, etc., due to latency, the order of processing (for example, the order between prepare vote and recovery request) may be reversed. In this case, the determination of rollback of the recovery request and the prepare vote for committability become inconsistent. In order to maintain the consistency of the transaction, even if a rollback is determined, it is necessary to persist the log.

[0006] On the other hand, the capacity of the storage used for log persistence is limited, and after the transaction processing is completed, it is necessary to delete the log from the storage to free up the storage area. In the conventional two-phase commit, in the case of rollback, the deletion process of this log itself was unnecessary, but in the case of persistence, this process becomes newly necessary.

[0007] Therefore, a distributed transaction system that deletes the transaction decision result log as follows can be considered.

[0008] This distributed transaction system includes a distributed transaction management unit and a plurality of databases. In the first phase, when the prepare is successful in all databases, the distributed transaction management unit records a commit in the transaction decision result log, and when the prepare is not successful in all databases, the distributed transaction management unit records a rollback in the transaction decision result log. In the second phase, the distributed transaction management unit instructs the database of the decision result (commit or rollback), and the database commits or rolls back. When the commit or rollback is completed in all databases, the distributed transaction management unit deletes the transaction decision result log to free up the storage area.

[0009] To delete the transaction settlement result log, it is necessary to confirm that "all databases have completed commit or rollback". For this purpose, the distributed transaction management unit needs to identify the databases participating in the transaction.

[0010] In the case of commit, since it is a prerequisite for all databases to report successful prepare to the distributed transaction management unit, the distributed transaction management unit knows all the databases participating in the transaction.

[0011] On the other hand, in the case of rollback, since the prepare success or failure itself may not reach the distributed transaction management unit due to timeout or the like, the distributed transaction management unit does not always know all the databases participating in the transaction.

[0012] For this reason, it becomes difficult to identify the timing to delete the transaction settlement result log without being able to confirm that rollback has been completed in all the databases participating in the transaction. As a result, the storage area for the transaction log increases.

[0013] Note that there is a method, such as in the prior art (Patent Document 1), of not recording rollback information. The prior art does not persist the log when the transaction settlement is determined to be rollback. The prior art determines rollback when a recovery request is made without a log. This method has no consistency problem when the commit process and the recovery process do not conflict. However, it is not suitable because it may conflict with the commit process and affect the consistency in a cloud or container environment with a large delay.

[0014] Therefore, one object of the present invention is to provide a distributed transaction management apparatus and a distributed transaction management method capable of preventing an increase in the storage area of the transaction log while ensuring the consistency of the distributed transaction.

Means for Solving the Problem

[0015] In order to solve the above problems, the distributed transaction management device of the present invention is applied to a distributed transaction system in a specific environment, and includes a storage device that records a transaction settlement result log indicating the settlement result of a transaction of the distributed transaction system, and an information processing device that manages the transaction settlement result log. In the distributed transaction management device, when the information processing device receives a rollback processing completion notification from any one of a plurality of resource management units participating in the transaction, the information processing device is configured to delete the transaction settlement result log of the rollback.

[0016] In order to solve the above problems, the distributed transaction management device of the present invention is applied to a distributed transaction system in a specific environment, and includes a storage device that records a transaction settlement result log indicating the settlement result of a transaction of the distributed transaction system, and an information processing device that manages the transaction settlement result log. In the distributed transaction management device, the information processing device is configured to delete the transaction settlement result log of the rollback after a certain period of time from the transaction settlement of the rollback due to a recovery request from a plurality of resource management units participating in the transaction.

[0017] The distributed transaction management device of the present invention is applied to a distributed transaction system, and includes a storage device that records a transaction settlement result log indicating the settlement result of a transaction in the distributed transaction system, and an information processing device that manages the transaction settlement result log. In the distributed transaction management device, the information processing device uses a transaction identification number having a magnitude relationship as a transaction identifier for identifying the transaction, converts a plurality of consecutive transaction identification numbers corresponding to a settled transaction into range information indicating the range of the plurality of consecutive transaction identification numbers, and associates used information indicating that it has been used with the converted range information, thereby compressing the transaction settlement result log to create a compressed log, and records the compressed log in the storage device.

[0018] The distributed transaction management method of the present invention is applied to a distributed transaction system in a specific environment, and includes a storage device that records a transaction settlement result log indicating the settlement result of a transaction in the distributed transaction system, and uses an information processing device that manages the transaction settlement result log. In the distributed transaction management method, when the information processing device receives a rollback processing completion notification from any one of a plurality of resource management units participating in the transaction, the information processing device deletes the transaction settlement result log of the rollback.

[0019] The distributed transaction management method of the present invention is applied to a distributed transaction system in a specific environment, and includes a storage device that records a transaction settlement result log indicating the settlement result of a transaction in the distributed transaction system, and uses an information processing device that manages the transaction settlement result log. In the distributed transaction management method, after a certain period of time from the transaction settlement of the rollback due to a recovery request from a plurality of resource management units participating in the transaction, the information processing device deletes the transaction settlement result log of the rollback.

[0020] The distributed transaction management method of the present invention is applied to a distributed transaction system, and includes a storage device for recording a transaction settlement result log indicating a settlement result of a transaction in the distributed transaction system, and uses an information processing device for managing the transaction settlement result log. In the distributed transaction management method, the information processing device uses a transaction identification number having a magnitude relationship as a transaction identifier for identifying the transaction, and converts a plurality of consecutive transaction identification numbers corresponding to a settled transaction into range information indicating a range of the plurality of consecutive transaction identification numbers, and associates used information indicating that it has been used with the converted range information, thereby compressing the transaction settlement result log to create a compressed log, and recording the compressed log in the storage device.

Effects of the Invention

[0021] According to the present invention, it is possible to prevent an increase in the storage area of the transaction log while guaranteeing the consistency of the distributed transaction.

Brief Description of the Drawings

[0022]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14A

Figure 14B

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19

Figure 20A

Figure 20B

Figure 21

Embodiments for Carrying Out the Invention

[0023] Hereinafter, each embodiment of the present invention will be described with reference to the drawings. In all the drawings of the embodiments, the same or corresponding parts may be denoted by the same reference numerals. In the following description, various types of information may be described using expressions such as "table", "record", "column", "row", etc., but the various types of information may be represented by data structures other than these. Further, when explaining identification information, expressions such as "identification number", "identifier", "name", etc. are used, but these can be replaced with each other. Further, in the following description, when explaining a process with a functional block as the subject, the subject of the process may be a CPU or a device instead of the functional block.

[0024] <<First Embodiment>> FIG. 1 is a system configuration diagram showing a configuration example of a distributed transaction management apparatus 100 (hereinafter referred to as "transaction management apparatus 100") according to a first embodiment of the present invention. As shown in FIG. 1, the system includes a transaction management apparatus 100 and computers (1) 200-1 to computers (N) 200-N. The transaction management apparatus 100 and the computers (1) 200-1 to computers (N) 200-N are communicably connected to each other via a network NW1. Hereinafter, when there is no need to particularly distinguish between the computers (1) 200-1 to computers (N) 200-N, they are referred to as "computers 200". The computers (1) 200-1 to computers (N) 200-N include resource management units (1) 211-1 to resource management units (N) 211-N. When there is no need to particularly distinguish between the resource management units (1) 211-1 to resource management units (N) 211-N, they are referred to as "resource management unit 211". The system may be a system of a microservices architecture.

[0025] FIG. 2 is a schematic configuration diagram showing a configuration example of the transaction management apparatus 100. As shown in FIG. 2, the transaction management apparatus 100 includes a non-volatile storage device 110 capable of reading and writing data, a memory 120 (e.g., RAM), a CPU 130, an input / output interface 140, and a network interface 150. These are communicably connected to each other via a bus 160.

[0026] An apparatus including the CPU 130, the storage device 110, the memory 120, the input / output interface 140, the network interface 150, and the bus 160 is also referred to as an "information processing apparatus" for convenience. The information processing apparatus may be a plurality of information processing apparatuses or a virtual information processing apparatus constructed on a cloud, or may be a virtual environment such as a container.

[0027] The memory device 110 holds (stores, memorizes) the program 111 and the log 112. The program 111 includes a transaction management unit 111a and a transaction start processing unit 111b.

[0028] The transaction management unit 111a executes the completion process (commit or rollback) of the transaction. Commit determines the success of the transaction and guarantees the data updated within the transaction. Rollback cancels the changes made by the transaction and restores the data updated within the transaction to the state before the update. The transaction start processing unit 111b assigns a transaction identifier (for example, a number for identifying the transaction (hereinafter, may also be referred to as "TR identification number")) for identifying the transaction and starts the transaction. Note that there may be a plurality of transaction start processing units 111b.

[0029] The transaction management unit 111a records the TR identification number, which is the transaction identifier, in the log 112 to manage the transaction.

[0030] In FIG. 2, the transaction management unit 111a and the transaction start processing unit 111b are included in one device, but each of the transaction management unit 111a and the transaction start processing unit 111b may be included in a separate device, for example, as in the third embodiment (FIG. 12) and the fourth embodiment (FIG. 18) described later.

[0031] The CPU 130 loads the program 111 stored in the memory device 110 into the memory 120. The CPU 130 realizes various functions of the transaction management unit 111a and the transaction start processing unit 111b by executing the program 111 loaded into the memory 120.

[0032] The log 112 includes logs (information) related to the transaction. Note that the details of the log 112 will be described later.

[0033] The program 111 executed by the CPU 130 is loaded into the memory 120, and the data used when the CPU 130 executes the program 111 is temporarily stored.

[0034] The input / output interface 140 is an interface for connecting operation devices such as a keyboard and a mouse, as well as a display and the like. The network interface 150 is an interface for connecting the transaction management device 100 to the network NW1.

[0035] FIG. 3 is a diagram for explaining an example of the log 112. The log 112 includes, as columns (columns) for storing information (values), a transaction identifier 112a, a settlement result 112b, and a list 112c of resource management identifiers.

[0036] In the log 112, information corresponding to each column regarding the settlement result of the transaction is stored as row unit information (records) in association with each other. Specifically, the transaction identifier 112a stores a TR identification number, which is a transaction identifier for identifying a transaction. The settlement result 112b stores a commit or rollback indicating the settlement result of the transaction. Hereinafter, the commit or rollback stored in the settlement result 112b may be referred to as the "settlement result log" or the "transaction settlement result log" for convenience. In the list 112c of resource management unit identifiers, when the corresponding settlement result is a commit, the identification information of the committed resource management unit 211 is stored. Even when the corresponding settlement result is a rollback, if the resource management unit 211 that participated in the transaction is known, the identification information of the known resource management unit 211 may be stored.

[0037] FIG. 4 is a schematic configuration diagram showing a configuration example of the computer 200. As shown in FIG. 4, the computer 200 includes a non-volatile storage device 210 capable of reading and writing data, a memory 220 (e.g., RAM), a CPU 230, an input / output interface 240, and a network interface 250. These are communicably connected to each other via a bus 260.

[0038] The device including the CPU 230, the storage device 210, the memory 220, the input / output interface 240, the network interface 250, and the bus 260 is also referred to as an "information processing device" for convenience. The information processing device may be a plurality of information processing devices or a virtual information processing device constructed on the cloud, or may be a virtual environment such as a container.

[0039] The storage device 210 holds (stores, stores) a resource management unit 211. The resource management unit 211 is composed of a database, a program for managing the database (such as operating the database), a program for providing a message queue system, a program for providing a file system, and the like. The resource management unit 211 executes data processing required by a transaction on the database, executes a message queue, searches for a data file, updates a data file, and the like.

[0040] The CPU 230 loads the program stored in the storage device 210 into the memory 220. The CPU 230 realizes the functions of the resource management unit 211 by executing the program loaded into the memory 220.

[0041] As described above, the program executed by the CPU 230 is loaded into the memory 220, and the data used when the CPU 230 executes the program is temporarily stored.

[0042] The input / output interface 240 is an interface for connecting operation devices such as a keyboard and a mouse, as well as a display and the like. The network interface 250 is an interface for connecting the computer 200 to the network NW1.

[0043] <Overview> First, to facilitate the understanding of the present invention, the problems of the present invention will be described. FIG. 5 is a sequence diagram for explaining the processes executed by the transaction management unit 111a, the resource management unit (1) 211-1, and the resource management unit (2) 211-2 of the reference example.

[0044] As shown in FIG. 5, in the two-phase commit transaction processing, when the system is in a specific environment, due to processing delays, communication delays, etc., in any of the plurality of resource management units 211 (in this example, the resource management unit (1) 211-1), the order of processing may be swapped. The swapping of the processing order means that the rollback process (S508) due to the recovery request occurs before the arrival of the transaction completion instruction (S511) based on the decision of the transaction based on the prepare success / failure vote.

[0045] Here, the specific environment is an environment in which a situation where no processing order swapping occurs can occur in a resource management unit 211 other than the resource management unit 211 where the processing order swapping first occurred, that is, the rollback process due to the recovery request occurs before the arrival of the transaction completion instruction based on the decision of the transaction based on the prepare success / failure vote. The specific environment is, for example, an environment where (1) the minimum value of the recovery process activation timeout time TR1 + the recovery request communication time < the maximum value of the prepare success / failure vote communication time TP, and (2) the maximum value of the prepare success / failure vote communication time TP < the processing delay time TR2 of the recovery process activation is satisfied.

[0046] "Recovery process activation timeout time TR1" is the judgment reference time for judging the activation of the recovery process. After the prepare success / failure vote, if there is no commit instruction from the transaction management unit 111a until the recovery process activation timeout time TR1 elapses, the resource management unit 211 activates the recovery process after the recovery process activation timeout time TR1 has elapsed. The timing at which the recovery process is activated after the recovery process activation timeout time TR1 has elapsed varies depending on the processing performance of each resource management unit 211 and the like.

[0047] "Minimum value of recovery request communication time" is the minimum value of the communication time from when the resource management unit 211 sends a recovery request (for example, S506) until the recovery request reaches the transaction management unit 111a. Note that since the "recovery request communication time" is not a fixed time by its nature and varies, it is a time with a range from the minimum value to the maximum value.

[0048] "Maximum value of prepare success / failure vote communication time TP" is the maximum value of the communication time from when the resource management unit 211 sends a prepare success / failure vote to the transaction management unit 111a (for example, S504) until it reaches the transaction management unit 111a. Note that since the "prepare success / failure vote communication time TP" is not a fixed time by its nature and varies, it is a time with a range from the minimum value to the maximum value.

[0049] "Processing delay time TR2 for recovery process activation" refers to the delay time from the time when the first recovery process is activated among multiple resource management units 211 to the time when the next recovery process is activated. That is, when the first recovery process is activated in any of the resource management units 211, it is the time (delay time) from the time when the recovery process is activated until the time when it is assumed that the recovery process will be activated in other resource management units 211. In this example, since the resource management unit (1) 211-1 activates the recovery process first (S505), the time from the time when the recovery process is activated in the resource management unit (1) 211-1 (S505) until the time when it is assumed that the recovery process will be activated in the resource management unit (2) 211-2 (not shown) is the "processing delay time TR2 for recovery process activation".

[0050] (1) holds, for example, it may occur that the arrival time of the first recovery request (S506) from any of the resource management units 211 (in this example, the resource management unit (1) 211-1) where the recovery process was first activated is earlier than the arrival time (S510) of the prepare success / failure vote of any of the resource management units 211 (in this example, the resource management unit (1) 211-1). Further, when (1) holds, after the transaction management unit 111a estimates that the transaction is to be rolled back (S507), it may occur that the transaction is finally decided to be committed by the transaction decision by the prepare success / failure vote (S510) (for example, when the communication time of the rollback instruction (S507) and the communication time of the commit instruction (S511) are minimized). Further, when (2) holds, the arrival time of the commit instruction (S511) at another resource management unit 211 (in this example, the resource management unit (2) 211-2) may be earlier than the assumed time when the recovery process is activated at another resource management unit (in this example, the resource management unit (2) 211-2), or the arrival time of the commit instruction (S511) at another resource management unit 211 (in this example, the resource management unit (2) 211-2) may be earlier than the arrival time of the rollback instruction at the resource management unit (2) 211-2 when the recovery process is also activated at the resource management unit (2) 211-2 (that is, a state may occur where the recovery process is also activated at the resource management unit (2) 211-2, but the rollback instruction is delayed). That is, when (2) holds, no reordering of processing occurs in another resource management unit (2) 211-2.

[0051] When the system is in a specific environment in this way, if reordering of processing occurs only in the resource management unit (1) 211-1 where the recovery process was first activated, the determination of rollback for the recovery request (S506) from the resource management unit (1) 211-1 and the prepare vote (S510) on being able to commit may be inconsistent, resulting in transaction inconsistency.

[0052] Specifically, when the system is in a specific environment, the transaction management unit 111a, the resource management unit (1) 211-1, and the resource management unit (2) 211-2 execute the processes of S501 to S513 described below in sequence.

[0053] S501: The transaction management unit 111a gives a prepare instruction to the resource management unit (1) 211-1 and the resource management unit (2) 211-2 participating in the transaction.

[0054] S502: In response to the prepare instruction from the transaction management unit 111a, the resource management unit (1) 211-1 executes a prepare process (that is, a process to put the transaction in a prepared state where it can be committed or rolled back).

[0055] S503: In response to the prepare instruction from the transaction management unit 111a, the resource management unit (2) 211-2 executes a prepare process.

[0056] S504: The resource management unit (1) 211-1 sends a prepare success / failure vote indicating either the success (prepare success) or failure (prepare failure) of the prepare process to the transaction management unit 111a.

[0057] S505: The resource management unit (1) 211-1 activates a recovery process. The recovery process is a process for restoring the integrity of the system when the transaction is interrupted midway or a failure occurs. For example, the recovery process is activated when no commit instruction is received from the transaction management unit 111a by the time a predetermined time (recovery process activation timeout time TR1) has elapsed after the prepare success / failure vote. In this example, since the transmission of the prepare success / failure vote to the transaction management unit 111a is delayed, resulting in a delay in the arrival of the commit instruction (S511) from the transaction management unit 111a to the resource management unit (1) 211-1, the recovery process is activated.

[0058] S506: The resource management unit (1) 211-1 sends a recovery request to the transaction management unit 111a.

[0059] S507: The transaction management unit 111a receives the recovery request from the resource management unit (1) 211-1. Since there is no log (decision result log) for this transaction in log 112, the transaction management unit 111a assumes a rollback and sends a rollback instruction to the resource management unit (1) 211-1. Note that the transaction management unit 111a does not record the log (decision result log) in log 112.

[0060] S508: When the resource management unit (1) 211-1 receives the rollback instruction from the transaction management unit 111a, it performs rollback processing.

[0061] S509: Due to processing delays, after the prepare processing is completed, the resource management unit (2) 211-2 sends a prepare success / failure vote to the transaction management unit 111a at a timing later than the point when the resource management unit (1) 211-1 sends a prepare success / failure vote.

[0062] S510: The transaction management unit 111a receives prepare success / failure votes from the resource management unit (1) 211-1 and the resource management unit (2) 211-2. Since all of the received prepare success / failure votes are prepare successes, the transaction management unit 111a decides on a commit and records the commit in the decision result 112b of log 112.

[0063] S511: The transaction management unit 111a sends a commit instruction to the resource management unit (1) 211-1 and sends a commit instruction to the resource management unit (2) 211-2.

[0064] S512: Even if the resource management unit (1) 211-1 receives the commit instruction from the transaction management unit 111a, since it has already completed rollback processing, it does nothing.

[0065] S513: When the resource management unit (2) 211-2 receives a commit instruction from the transaction management unit 111a, it performs commit processing.

[0066] When the transaction management unit 111a, the resource management unit (1) 211-1, and the resource management unit (2) 211-2 operate as described above and process a transaction, the resource management unit (1) 211-1 will roll back and the resource management unit (2) 211-2 will commit, resulting in a transaction inconsistency.

[0067] Therefore, in the transaction management apparatus 100 according to the first embodiment, in order to avoid the transaction from becoming inconsistent, even when the transaction settlement result is rollback, the rollback transaction settlement result log is recorded in the log 112 (S607 in FIG. 6 described later). Thereby, it is possible to avoid the transaction from becoming inconsistent.

[0068] On the other hand, when the rollback transaction settlement result log is recorded in the log 112, in order to avoid an increase in the storage area for storing the log 112, it is necessary to delete the rollback transaction settlement result log that was not required in the prior art.

[0069] In order to delete the transaction settlement result log, since it may be necessary to use the transaction settlement result log until the transaction processing is completed, it is necessary to confirm that the transaction processing has been completed (that is, "all databases (resource management unit 211) have completed commit or rollback"). For this purpose, there is an idea that the transaction management unit 111a needs to grasp the resource management unit (1) 211-1 and the resource management unit (2) 211-2 participating in the transaction.

[0070] Based on this concept, when a transaction is completed by a commit, since the transaction management unit 111a knows all the resource management units (1) 211-1 and resource management units (2) 211-2 participating in the transaction, when the transaction management unit 111a receives a notification of the completion of the commit process from all the resource management units 211, it deletes the commit transaction decision result log.

[0071] On the other hand, in the case of a rollback, since the prepare success / failure vote itself may not reach the transaction management unit 111a due to a timeout or the like, the transaction management unit 111a does not always know all the resource management units 211 participating in the transaction.

[0072] Therefore, it becomes difficult to specify the timing to delete the transaction decision result log without being able to confirm that the rollback has been completed in all the resource management units 211 participating in the transaction. Therefore, if the timing to delete the transaction decision result log for a rollback is not determined, the storage area for storing the log 112 will increase.

[0073] Therefore, the transaction management device 100 according to the first embodiment performs the deletion of the transaction decision result log for a rollback at the timing described below. That is, when the transaction management unit 111a of the transaction management device 100 receives the completion of the rollback process from any one of the plurality of resource management units 211 participating in the transaction, it deletes the transaction decision result log for the rollback from the log 112. In a specific environment, after the point in time when the completion of the rollback process is received from any one of the plurality of resource management units 211 participating in the transaction, the transaction management unit 111a does not need to use the transaction decision result log, so it is deleted at this timing.

[0074] Here, the specific environment is an environment in which, in a resource management unit 211 other than the resource management unit 211 where the order swapping of processing first occurs, which is a rollback process due to a recovery request before the arrival of a transaction completion instruction based on the settlement of a transaction by a prepare success / failure vote, a situation may occur where no order swapping of processing occurs for a certain period or more from the settlement of the transaction (the point in time when the rollback settlement result is recorded in the log 900) due to the recovery request of the activated recovery process.

[0075] The specific environment is, for example, an environment where (1) the minimum value of the recovery process activation timeout time TR1 + the recovery request communication time < the maximum value of the prepare success / failure vote communication time TP, and (2) the maximum value of the prepare success / failure vote communication time TP < the processing delay time TR2 of the recovery process activation, and (3) the maximum value of the prepare success / failure vote communication time TP < the required time TS2 for the recovery process. Note that the required time TS2 for the recovery process is the minimum value of the recovery process activation timeout time TR1 + the recovery request communication time + the minimum value of the commit or rollback instruction communication time + the rollback process time + the minimum value of the commit or rollback process completion notification communication time, and is an arbitrary time determined according to the processing delay time and the like.

[0076] Thereby, the transaction management device 100 can prevent an increase in the storage area of the log 112 while ensuring the consistency of the distributed transaction. In addition, since the transaction management unit 111a only determines the point in time when it receives the completion of the rollback process from one resource management unit 211 participating in the transaction in order to delete the rollback transaction settlement result log, the transaction management device 100 can delete the rollback transaction settlement result log in a simple method.

[0077] <Operation> Hereinafter, the operation of the transaction management apparatus 100 according to the first embodiment of the present invention will be described. FIG. 6 is a sequence diagram for explaining the processes executed by the transaction management unit 111a, the resource management unit (1) 211-1, and the resource management unit (2) 211-2 according to the first embodiment of the present invention.

[0078] The transaction management unit 111a, the resource management unit (1) 211-1, and the resource management unit (2) 211-2 sequentially execute the processes of S601 to S615 described below.

[0079] S601: The transaction management unit 111a issues a prepare instruction to the resource management unit (1) 211-1 and the resource management unit (2) 211-2 participating in the transaction.

[0080] S602: In response to the prepare instruction from the transaction management unit 111a, the resource management unit (1) 211-1 executes a prepare process.

[0081] S603: In response to the prepare instruction from the transaction management unit 111a, the resource management unit (2) 211-2 executes a prepare process.

[0082] S604: The resource management unit (1) 211-1 sends a prepare success / failure vote to the transaction management unit 111a.

[0083] S605: When the recovery process activation timeout time TR1 elapses since the resource management unit (1) 211-1 sends the prepare success / failure vote, the resource management unit (1) 211-1 activates the recovery process.

[0084] S606: The resource management unit (1) 211-1 sends a recovery request to the transaction management unit 111a.

[0085] S607: The transaction management unit 111a checks whether a log related to the transaction (settlement result log) exists in the log 112. If the log related to the transaction (settlement result log) does not exist in the log 112, the transaction management unit 111a estimates a rollback and records the rollback in the settlement result 112b of the log 112.

[0086] S608: The transaction management unit 111a sends a rollback instruction to the resource management unit (1) 211-1.

[0087] S609: When the resource management unit (1) 211-1 receives a rollback instruction from the transaction management unit 111a, it performs a rollback process.

[0088] S610: After the prepare process is completed, the resource management unit (2) 211-2 sends a prepare success / failure vote to the transaction management unit 111a at a timing later than the time when the resource management unit (1) 211-1 sends a prepare success / failure vote.

[0089] S611: The transaction management unit 111a receives prepare success / failure votes from the resource management unit (1) 211-1 and the resource management unit (2) 211-2. The transaction management unit 111a checks the log related to the transaction (settlement result log). If the log (settlement result log) exists in the log 112, regardless of the result of the received prepare success / failure vote, based on the settlement result log of the log 112, it instructs the processing of the transaction. Here, since a rollback is recorded in the settlement result 112b of the log 112, the transaction management unit 111a sends a rollback instruction to the resource management unit (1) 211-1 and the resource management unit (2) 211-2.

[0090] S612: Even if the resource management unit (1) 211-1 receives a rollback instruction from the transaction management unit 111a, since it has already completed the rollback process, it does nothing.

[0091] S613: When the resource management unit (2) 211-2 receives a rollback instruction from the transaction management unit 111a, it performs a rollback process.

[0092] S614: The resource management unit (1) 211-1 sends a rollback process completion notification to the transaction management unit 111a.

[0093] S615: When the transaction management unit 111a receives a rollback process completion notification from the resource management unit (1) 211-1, it deletes a log (row (record)) including a decision result log (rollback) for the transaction from the log 112.

[0094] S616: The resource management unit (2) 211-2 sends a rollback process completion notification to the transaction management unit 111a.

[0095] Figure 7 is a flowchart showing a processing flow executed by the transaction management unit 111a. The transaction management unit 111a starts processing from step 700, sequentially executes the processes of step 705 and step 710 described below, and then proceeds to step 715.

[0096] Step 705: The transaction management unit 111a sends a prepare instruction to the resource management unit 211 participating in the transaction.

[0097] Step 710: The transaction management unit 111a receives a message from the resource management unit 211.

[0098] When the transaction management unit 111a proceeds to step 715, it determines whether the message is a recovery request. If the message is a recovery request, the transaction management unit 111a determines "YES" at step 715 and proceeds to step 720, and determines whether a log (decision result log) for the transaction targeted by the recovery request has been recorded in the log 112.

[0099] If the log (settlement result log) for the transaction targeted by the recovery request has not been recorded in log 112, the transaction management unit 111a determines "NO" in step 720 and proceeds to step 725. When the transaction management unit 111a proceeds to step 725, since the log (settlement result log) for the transaction targeted by the recovery request has not been recorded in log 112, it estimates that the settlement of that transaction has been rolled back and records the rollback settlement result in the settlement result 112b of log 112.

[0100] After that, the transaction management unit 111a proceeds to step 730, sends an instruction corresponding to the settlement result of log 112 to the resource management unit 211, and returns to step 710.

[0101] On the other hand, for example, if the recovery process is activated in the resource management unit (1) 211-1 and after recording the rollback settlement result in log 112 (step 725), the recovery process is activated in the resource management unit (2) 211-2 and a recovery request is made by the resource management unit (2), the log (settlement result log) will already be recorded in log 112. Thus, if the log (settlement result log) for the transaction targeted by the recovery request has already been recorded in log 112 in step 720, the transaction management unit 111a determines "YES" in step 720 and proceeds directly to step 730. After executing the process of step 730 as described above, it returns to step 710.

[0102] If the message is not a recovery request in step 715, the transaction management unit 111a determines "NO" in step 715 and proceeds to step 735 to determine whether the message is a prepare success / failure vote.

[0103] If the message is a prepare success / failure vote, the transaction management unit 111a determines "YES" in step 735 and proceeds to step 740 to determine whether the log (settlement result log) for the transaction has already been recorded in log 112.

[0104] If a log about the transaction (decision result log) has been recorded in log 112, the transaction management unit 111a determines "YES" in step 740, proceeds to step 730, executes the process of step 730 as described above, and then returns to step 710.

[0105] On the contrary, if a log about the transaction (decision result log) has not been recorded in log 112, the transaction management unit 111a determines "NO" in step 740, proceeds to step 745, and determines whether the prepare success / failure vote is a prepare negative.

[0106] If the prepare success / failure vote is a prepare negative, the transaction management unit 111a determines "YES" in step 745, proceeds to step 750, records the rollback decision result in the decision result 112b of log 112, then proceeds to step 730, executes the process of step 730 as described above, and then returns to step 710.

[0107] If the prepare success / failure vote is a prepare success, the transaction management unit 111a determines "NO" in step 745, proceeds to step 755, and determines whether prepare success / failure votes have reached from all of the resource management units 211 participating in the transaction and whether all of those prepare success / failure votes are successful (prepare success).

[0108] If prepare success / failure votes have reached from all of the resource management units 211 participating in the transaction and all of those prepare success / failure votes are successful, the transaction management unit 111a determines "YES" in step 755 and proceeds to step 760. When the transaction management unit 111a proceeds to step 760, since all the vote results of the resource management units 211 participating in the transaction are prepare success, the decision of the transaction is committed, and the commit decision result is recorded in the decision result 112b of log 112. Thereafter, the transaction management unit 111a proceeds to step 730, executes the process of step 730 as described above, and then returns to step 710.

[0109] On the other hand, if the prepare success / failure votes have not reached from all of the resource management units 211 participating in the transaction, the transaction management unit 111a determines "NO" in step 755 and returns to step 710.

[0110] In step 735 described above, if the message is not a prepare success / failure vote, the transaction management unit 111a determines "NO" in step 735 and proceeds to step 765 to determine whether the message is a rollback process completion notification.

[0111] If the message is a rollback process completion notification, the transaction management unit 111a determines "YES" in step 765, proceeds to step 770, deletes the log (rows (records) including the rollback settlement result log) for that transaction from the log 112, and then returns to step 710. If the message is not a rollback process completion notification, the transaction management unit 111a determines "NO" in step 765, proceeds to step 775, and determines whether the message is the last commit process completion notification from the resource management unit 211 participating in the transaction based on the list 112c of resource management unit identifiers in the log 112 (the list of the resource management units 211 participating in the transaction).

[0112] If the message is the last commit process completion notification, the transaction management unit 111a determines "YES" in step 775, proceeds to step 770, deletes the log (rows (records) including the commit settlement result log) for that transaction from the log 112, and then returns to step 710. If the message is not the last commit process completion notification, the transaction management unit 111a determines "NO" in step 775 and returns to step 710.

[0113] By executing the above processing flow, when there is a transaction recovery request, if the decision result log for the transaction does not exist in log 112, the transaction management unit 111a estimates a rollback and records (stores) the rollback in the decision result 112b corresponding to the transaction identifier 112a of that transaction in log 112.

[0114] When at least one of the prepare success / failure votes is negative, the transaction management unit 111a sets the transaction decision as a rollback and records (stores) the rollback in the decision result 112b corresponding to the transaction identifier 112a of that transaction in log 112.

[0115] When the transaction management unit 111a receives a rollback processing completion notification from any one of the resource management units 211 participating in the transaction, it deletes the log of that transaction (the row (record) including the transaction decision result log (rollback) corresponding to the transaction identifier) from log 112.

[0116] When all of the prepare success / failure votes are prepare successes, the transaction management unit 111a sets the transaction decision as a commit and records (stores) the commit in the decision result 112b corresponding to the transaction identifier 112a of that transaction in log 112.

[0117] When the transaction management unit 111a receives a commit processing completion notification from all of the resource management units 211 participating in the transaction, it deletes the log of that transaction (the row (record) corresponding to the transaction identifier) from log 112.

[0118] By recording and deleting the transaction decision result log in this way, the transaction management unit 111a can prevent an increase in the storage area for recording log 112 while ensuring the consistency of the distributed transaction.

[0119] FIG. 8 is a flowchart showing a processing flow executed by the resource management unit 211. The resource management unit 211 starts processing from step 800, sequentially executes the processing of steps 805 to 820 described below, and then proceeds to step 825.

[0120] Step 805: The resource management unit 211 receives a prepare instruction from the transaction management unit 111a.

[0121] Step 810: The resource management unit 211 executes a prepare process.

[0122] Step 815: The resource management unit 211 sends a prepare success / failure vote to the transaction management unit 111a.

[0123] Step 820: The resource management unit 211 receives a recovery process activation timeout event or an instruction from the transaction management unit 111a.

[0124] When the resource management unit 211 proceeds to step 825, it determines whether the event is a recovery process activation timeout. Note that the recovery process activation timeout means that the recovery process activation timeout time TR1 has elapsed since the prepare success / failure vote was sent and the recovery process has been activated.

[0125] If the event is a recovery process activation timeout, the resource management unit 211 determines "YES" at step 825, proceeds to step 830, sends a recovery request to the transaction management unit 111a, and then returns to step 820.

[0126] If the event is not a recovery process activation timeout, the resource management unit 211 determines "NO" at step 825, proceeds to step 835, and determines whether the commit process or the rollback process has been completed.

[0127] If the commit process or rollback process has been completed, the resource management unit 211 determines "YES" in step 835, proceeds to step 840, sends a decision process completion notice to the transaction management unit 111a, and then returns to step 820.

[0128] If the commit process or rollback process has not been completed (that is, neither the commit process nor the rollback process has been completed), the resource management unit 211 determines "NO" in step 835 and proceeds to step 845.

[0129] When the resource management unit 211 proceeds to step 845, it determines whether the instruction from the transaction management unit 111a is a commit.

[0130] If the instruction from the transaction management unit 111a is not a commit, the resource management unit 211 determines "NO" in step 845, sequentially executes the processes of step 850 and step 855 described below, and then returns to step 820.

[0131] Step 850: The resource management unit 211 executes a rollback process.

[0132] Step 855: The resource management unit 211 sends a rollback process completion notice to the transaction management unit 111a.

[0133] If the instruction from the transaction management unit 111a is a commit, the resource management unit 211 determines "YES" in step 845, sequentially executes the processes of step 860 and step 865 described below, and then returns to step 820.

[0134] Step 860: The resource management unit 211 executes a commit process.

[0135] Step 865: The resource management unit 211 sends a commit process completion notice to the transaction management unit 111a.

[0136] <Effect> As described above, according to the transaction management apparatus 100 according to the first embodiment of the present invention, it is possible to prevent an increase in the storage area of the log 112 (transaction log) while ensuring the consistency of the distributed transaction. Further, the transaction management apparatus 100 can delete the rollback transaction determination result log in a simple manner.

[0137] <<Second Embodiment>> The transaction management apparatus 100 according to the second embodiment of the present invention will be described. The transaction management apparatus 100 according to the second embodiment holds (stores, stores) the log 900 shown in FIG. 9 instead of the log 112 shown in FIG. 3. As shown in FIG. 9, the log 900 includes a transaction identifier 112a, a determination result 112b, a list 112c of resource management identifiers, and a recording time 112d as columns (columns) for storing information (values). The transaction identifier 112a, the determination result 112b, and the list 112c of resource management identifiers are the same as those of the log 112 shown in FIG. 3. The recording time 112d stores the time when the log (determination result log) was recorded.

[0138] <Operation> Hereinafter, the operation of the transaction management apparatus 100 according to the second embodiment of the present invention will be described. FIG. 10 is a sequence diagram for explaining the processes executed by the transaction management unit 111a, the resource management unit (1) 211-1, and the resource management unit (2) 211-2 according to the second embodiment of the present invention.

[0139] In a specific environment, within a certain period of time from the transaction determination (S1008) of the rollback due to the recovery request (S1007), the order of processing may be switched in the resource management unit (2) 211-2. However, after a certain period of time has elapsed from the transaction determination of the rollback (the point in time when the rollback determination result was recorded in the log 900) (S1008), the order of processing does not change.

[0140] Here, the specific environment is an environment in which a situation may occur where no processing order swap occurs for a certain period of time or more from the determination of the transaction by the recovery request (the point in time when the rollback result of the rollback is recorded in the log 900) in the resource management unit 211 other than the resource management unit 211 where the processing order swap first occurred due to the rollback process by the recovery request before the arrival of the transaction completion instruction based on the determination of the transaction by the prepare success / failure vote.

[0141] The specific environment is, for example, an environment where (1) the minimum value of the recovery process activation timeout time TR1 + the recovery request communication time < the maximum value of the prepare success / failure vote communication time TP, and (2) the maximum value of the prepare success / failure vote communication time TP < the processing delay time TR2 of the recovery process activation, and (3) the maximum value of the prepare success / failure vote communication time TP < the recovery process activation timeout time TR1 + the minimum value of the recovery request communication time + the log retention time TS3. Note that the log retention time TS3 corresponds to the above-mentioned certain period of time and is an arbitrary time determined according to the processing delay time and the like. Therefore, in such a specific environment, the transaction management unit 111a, the resource management unit (1) 211-1, and the resource management unit (2) 211-2 of the transaction management apparatus 100 according to the second embodiment execute the processes of S1001 to S1013 described below in order.

[0142] S1001: The transaction management unit 111a issues a prepare instruction to the resource management unit (1) 211-1 and the resource management unit (2) 211-2 participating in the transaction.

[0143] S1002: The resource management unit (1) 211-1 executes the prepare process in response to the prepare instruction from the transaction management unit 111a.

[0144] S1003: The resource management unit (2) 211-2 executes the prepare process in response to the prepare instruction from the transaction management unit 111a.

[0145] S1004: The resource management unit (1) 211-1 sends the prepare success / failure vote to the transaction management unit 111a.

[0146] S1005: The resource management unit (2) 211-2 sends the prepare success / failure vote to the transaction management unit 111a.

[0147] S1006: Since the recovery process activation timeout time TR1 has elapsed since the resource management unit (1) 211-1 sent the prepare success / failure vote, the resource management unit (1) 211-1 activates the recovery process. Note that since the recovery process activation timeout time TR1 has also elapsed since the resource management unit (2) 211-2 sent the prepare success / failure vote, it has timed out. However, since the activation timing of the recovery process in the resource management unit (2) 211-2 is offset from the activation timing of the recovery process in the resource management unit (1) 211-1, the recovery process is not activated simultaneously. Such a deviation in the activation of the recovery process occurs because the activation of the recovery process after timeout in the resource management unit (2) 211-2 is delayed. Until the log retention time TS3 elapses from the transaction settlement of the rollback due to the recovery request, the recovery process may also be activated in the resource management unit (2) 211-2. Therefore, within this log retention time TS3, it is necessary to retain the rollback settlement result log.

[0148] S1007: The resource management unit (1) 211-1 sends a recovery request to the transaction management unit 111a.

[0149] S1008: The transaction management unit 111a checks whether the settlement result log related to the transaction exists in log 900. If the log (settlement result log) related to the transaction does not exist in log 900, the transaction management unit 111a estimates a rollback and records the rollback in the settlement result 112b of log 900.

[0150] S1009: The transaction management unit 111a sends a rollback instruction to the resource management unit (1) 211-1.

[0151] S1010: When the resource management unit (1) 211-1 receives a rollback instruction from the transaction management unit 111a, it performs a rollback process.

[0152] S1011: The transaction management unit 111a receives a prepare success / failure vote from the resource management unit (1) 211-1 and the resource management unit (2) 211-2. The transaction management unit 111a checks the log related to the transaction (decision result log). If the log (decision result log) exists in log 900, regardless of the result of the received prepare success / failure vote, it instructs the processing of the transaction based on the decision result log in log 900. Here, since rollback is recorded in the decision result 112b of log 900, the transaction management unit 111a sends a rollback instruction to the resource management unit (1) 211-1 and the resource management unit (2) 211-2.

[0153] S1012: Even if the resource management unit (1) 211-1 receives a rollback instruction from the transaction management unit 111a, since it has already completed the rollback process, it does nothing.

[0154] S1013: When the resource management unit (2) 211-2 receives a rollback instruction from the transaction management unit 111a, it performs a rollback process.

[0155] S1014: Since a certain period of time (log retention time TS3) has elapsed from the time when the transaction management unit 111a recorded the rollback decision result log (the time stored at the recording time 112d), it deletes the log (row (record)) including the decision result log (rollback) for the transaction from log 900.

[0156] In a specific environment, when the resolution result log of rollback is recorded in log 900 (S1008), if the situation in the resource management unit (2) 211-2 reaches a state where the order of processing does not change, even if the resolution result log of rollback is retained in log 900, there is no need to use the resolution result log of rollback (no opportunity to use it).

[0157] On the other hand, within a certain period (log retention time TS3) from the time (S1008) when the resolution result log of rollback is recorded in log 900, the order of processing in the resource management unit (2) 211-2 may change. Therefore, during that period, the transaction management unit 111a needs to retain the resolution result log of rollback. Accordingly, the transaction management unit 111a of the transaction management apparatus 100 according to the second embodiment retains the resolution result log of rollback until a certain time (log retention time TS3) has elapsed from the time (S1008) when the resolution result log of rollback is recorded in log 900, and deletes the log (row (record)) including the resolution result log of rollback from log 900 at the time when a certain time (log retention time TS3) has elapsed from the time (S1008) when the resolution result log of rollback is recorded in log 900.

[0158] FIG. 11 is a flowchart showing a processing flow executed by the transaction management unit 111a. This flowchart is the same as the flowchart of FIG. 7 except that step 710 in FIG. 7 is replaced with step 1110 and step 765 in FIG. 7 is replaced with step 1120. Therefore, hereinafter, the description will focus on the differences from FIG. 7.

[0159] After executing the processing of the above-described step 705, when the transaction management unit 111a proceeds to step 1110, it receives a message or waits for the elapse of the log retention time TS3, and then proceeds to the above-described step 715.

[0160] When the transaction management unit 111a determines "NO" in the process of step 735 described above and proceeds to step 1120, it determines whether the log retention time TS3 has elapsed.

[0161] If the log retention time TS3 has elapsed, the transaction management unit 111a determines "YES" in step 1120, proceeds to step 770, executes the process of step 770 described above, and then returns to step 1010. If the log retention time TS3 has not elapsed, the transaction management unit 111a determines "NO" in step 1120 and proceeds to step 775 described above.

[0162] By executing the above processing flow, when there is a transaction recovery request, if the decision result log for the transaction does not exist in log 900, the transaction management unit 111a estimates a rollback, records (stores) the rollback in the decision result 112b corresponding to the transaction identifier 112a of the transaction in log 900, and records the recording time at the recording time 112d.

[0163] When at least one of the prepare success / failure votes is negated, the transaction management unit 111a rolls back the transaction decision and records (stores) the rollback in the decision result 112b corresponding to the transaction identifier 112a of the transaction in log 900.

[0164] When a certain time (log retention time TS3) has elapsed since the rollback decision result log was recorded, the transaction management unit 111a deletes the log of the transaction (the row (record) including the transaction decision result log (rollback) corresponding to the transaction identifier) from log 900.

[0165] When all of the prepare success / failure votes are prepare successes, the transaction management unit 111a determines the outcome of the transaction as a commit, and records (stores) the commit in the decision result 112b corresponding to the transaction identifier of that transaction in the log 900.

[0166] When the transaction management unit 111a has received a commit processing completion notice from all of the resource management units 211 participating in the transaction, it deletes the log of that transaction (the row (record) corresponding to the transaction identifier) from the log 900.

[0167] By recording and deleting the transaction decision result log in this way, the transaction management unit 111a can prevent an increase in the storage area for recording the log 900 while ensuring the consistency of the distributed transaction.

[0168] <Effect> As described above, the transaction management apparatus 100 according to the second embodiment of the present invention can prevent an increase in the storage area of the log 900 (transaction log) while ensuring the consistency of the distributed transaction.

[0169] <<Third Embodiment>> The distributed transaction management apparatuses (1) 100-1 and (2) 100-2 according to the third embodiment of the present invention will be described. FIG. 12 is a system configuration diagram showing a configuration example of a system (distributed transaction system) including the distributed transaction management apparatuses (1) 100-1 and (2) 100-2 according to the third embodiment of the present invention. Hereinafter, the "distributed transaction management apparatus (1) 100-1" is referred to as the "transaction management apparatus (1) 100-1", and the distributed transaction management apparatus (2) 100-2 is referred to as the "transaction management apparatus (2) 100-2". When there is no need to particularly distinguish between the transaction management apparatus (1) 100-1 and the transaction management apparatus (2) 100-2, they are referred to as the "transaction management apparatus 100".

[0170] As shown in FIG. 12, the system includes a transaction management device (1) 100-1, a transaction management device (2) 100-2, and computers (1) 200-1 to computers (N) 200-N. The transaction management device (1) 100-1, the transaction management device (2) 100-2, and the computers (1) 200-1 to computers (N) 200-N are communicably connected to each other via a network NW1.

[0171] The transaction management device (1) 100-1 has a transaction management unit 111a and a compressed log 1300. The hardware configuration of the transaction management device (1) 100-1 is the same as the hardware configuration shown in FIG. 2, except that the transaction start processing unit 111b is not included in the program 111 and the log 112 is replaced by the compressed log 1300.

[0172] The hardware configuration of the transaction management device (2) 100-2 is the same as the hardware configuration shown in FIG. 2, except that the transaction management unit 111a is not included in the program 111 and the log 112 is not included in the storage device 110.

[0173] The transaction management device (1) 100-1 holds (stores, stores) the compressed log 1300 shown in FIG. 13 in the storage device 110. As shown in FIG. 13, the compressed log 1300 includes a transaction identifier range 1301 and usage information 1302 as columns (columns) for storing information (values). In the compressed log 1300, information corresponding to each column regarding the settlement result of the transaction is stored as row unit information (records) in association with each other. Specifically, the transaction identifier range 1301 stores a range of TR identifier numbers that are transaction identifiers. The usage information 1302 stores "used". Note that the "used" stored in the usage information 1302 may also be referred to as "settlement result log" or "transaction settlement result log" for convenience.

[0174] <Summary> The transaction management unit 111a temporarily records information regarding each transaction as a pre-compression log 1400 shown in FIG. 14A in the storage device 110 of the transaction management apparatus (1) 100-1. The pre-compression log 1400 includes, as columns (fields) for storing information (values), a transaction identifier 1401, a settlement result 1402, and processing information 1403. Although not shown in the figure, the pre-compression log 1400 includes columns (fields) similar to the list 112c of resource management identifiers in FIG. 3. In this column (field), a list of resource management units 211 participating in the transaction indicated by the TR identification number stored in the transaction identifier 1401 is stored.

[0175] The transaction identifier 1401 stores a TR identification number which is a transaction identifier. The settlement result 1402 stores either R or C indicating the settlement result of the transaction, or unused. Note that R indicates rollback and C indicates commit. When the corresponding settlement result is C, the processing information 1403 stores either "commit decision" (not shown in the figure) or "processed".

[0176] "Commit decision" means that the transaction has been decided to be committed, but the commit processing of the resource management unit 211 participating in the transaction is incomplete. Processed means that the commit processing of the resource management unit 211 participating in the transaction has been completed (settled). When the corresponding settlement result is R, the processing information 1403 is set to "Null".

[0177] The transaction management unit 111a creates a compressed log 1300 by compressing (converting) the pre-compression log 1400, and permanently (long-term) records the compressed log 1300 in the storage device 110. Thereby, the transaction management apparatus 100-1 can prevent an increase in the storage area of the transaction log while ensuring the consistency of the distributed transaction.

[0178] A method for compressing the pre-compression log 1400 executed by the transaction management unit 111a into the compressed log 1300 will be described. As described above, the transaction identifier 1401 of the pre-compression log 1400 shown in FIG. 14A stores the TR identification number. A predetermined range of TR identification numbers (in this example, TR identification numbers from 10 to 19) for assigning a TR identification number to the transaction is assigned to the transaction start processing unit 111b. Note that the predetermined range of TR identification numbers in this example is merely an example and is not limited thereto.

[0179] The transaction start processing unit 111b assigns numbers in order from the smallest number in the predetermined range of TR identification numbers (in this example, TR identification numbers from 10 to 19) (in this example, in order from the smallest number 10) to each of the plurality of transactions.

[0180] During the progress of the processing of the plurality of transactions, the transaction management unit 111a refers to the transaction identifier 1401, the settlement result 1402 corresponding to the TR identification number, and the processing information 1403 of the pre-compression log 1400 at a predetermined timing, and compresses the pre-compression log 1400.

[0181] The transaction management unit 111a converts the TR identification numbers (in the example of FIG. 14A, TR identification numbers from 10 to 13) corresponding to a plurality of transactions that have been settled in the pre-compression log 1400 and whose TR identification numbers are consecutive into information indicating the range of the plurality of TR identification numbers (the range of TR identification numbers (in the example of FIG. 14A, 10-13)), and associates information (used) indicating that the range of TR identification numbers has been used.

[0182] As a result, the transaction management unit 111a compresses the pre-compression log 1400, creates the compressed log 1300, and permanently stores the compressed log 1300 in the storage device 110. Note that the TR identification numbers corresponding to a plurality of finalized transactions are the TR identification numbers in the pre-compression log 1400 where the settlement result 1402 corresponds to R or C. Note that the above C is the C where the corresponding processing information 1403 has been processed.

[0183] Also, afterwards, as shown in FIG. 14B, the transaction start processing unit 111b assigns a TR identification number, which is a transaction identifier, to the transaction. As the processing of a plurality of transactions proceeds, assuming that the pre-compression log 1400 is compressed in a state where the transactions corresponding to the TR identification numbers 14 to 19 in the pre-compression log 1400 have been finalized. In this case, the transaction management unit 111a converts the TR identification numbers 14 to 19, for which the corresponding transactions have been finalized and the TR identification numbers are consecutive, into a range of a plurality of TR identification numbers (TR identification number range (in the example of FIG. 14B, 10 - 19)) obtained by adding them to the range of the TR identification numbers (10 - 13) in the compressed log 1300 shown in FIG. 14A, and associates information indicating that the range of the TR identification numbers has been used (used) (that is, stores "used" in the usage information 1302). As a result, the transaction management unit 111a compresses the pre-compression log 1400, creates the compressed log 1300, and permanently stores the compressed log 1300 in the storage device 110.

[0184] Note that the transaction management unit 111a uses the compressed log 1300 when there is a transaction recovery request or the like. In this case, when the usage information corresponding to the range of the TR identification numbers including the TR identification number of the transaction is "used" when the transaction management unit 111a refers to the compressed log 1300, it determines that a rollback is required. Therefore, for example, even when the order of processing as shown in FIG. 6 is reversed, it is possible to avoid the occurrence of transaction inconsistencies.

[0185] Also, when the transaction start processing unit 111b stops due to a failure or the like, the transaction management unit 111a may mark all usage information corresponding to the range of the TR identification numbers assigned to the transaction start processing unit 111b as used.

[0186] <Operation> FIG. 15 is a sequence diagram for explaining the processes executed by the transaction start processing unit 111b, the transaction management unit 111a, and the resource management unit 211. The transaction start processing unit 111b, the transaction management unit 111a, and the resource management unit 211 sequentially execute the processes of S1501 to S1510 described below.

[0187] S1501: The transaction start processing unit 111b assigns a TR identification number, which is a transaction identifier, to the transaction. At this time, the transaction start processing unit 111b assigns the TR identification numbers in ascending order from within the range of the TR identification numbers previously assigned to the transaction start processing unit 111b (in this example, the TR identification numbers from 10 to 19).

[0188] S1502: The transaction start processing unit 111b transmits the transaction identifier and SQL or the like to the resource management unit 211, and instructs the plurality of resource management units 211 participating in the transaction to execute the transaction process.

[0189] S1503: The transaction start processing unit 111b transmits the transaction identifier to the transaction management unit 111a, thereby instructing the transaction management unit 111a to resolve the transaction.

[0190] S1504: When the Transaction Management Unit 111a receives a transaction settlement instruction from the Transaction Start Processing Unit 111b, it starts the completion process (commit or rollback) of the transaction corresponding to the transaction identifier received from the Transaction Start Processing Unit 111b. The Transaction Management Unit 111a sends a prepare instruction to a plurality of Resource Management Units 211 participating in the transaction.

[0191] S1505: A plurality of Resource Management Units 211 participating in the transaction respond to the prepare instruction from the Transaction Management Unit 111a and execute a prepare process.

[0192] S1506: Each of the plurality of Resource Management Units 211 participating in the transaction sends a prepare success / failure vote to the Transaction Management Unit 111a.

[0193] S1507: The Transaction Management Unit 111a records the transaction settlement result in a log (uncompressed log 1400). Note that this uncompressed log 1400 is compressed (converted) into a compressed log 1300 at a predetermined timing by executing the processing flows of FIGS. 16 and 17 described later.

[0194] S1508: The Transaction Start Processing Unit 111b assigns the next sequential TR identifier after the TR identifier assigned in S1501 as the transaction identifier to the transaction. For example, in this example, the TR identifier assigned in S1501 is 10, and 11, which is the next sequential TR identifier after 10, is assigned.

[0195] S1509: The Transaction Start Processing Unit 111b sends the transaction identifier and SQL, etc. to the Resource Management Unit 211 and instructs a plurality of Resource Management Units 211 participating in the transaction to execute the transaction process.

[0196] S1510: The transaction start processing unit 111b transmits a prepare instruction to a plurality of resource management units 211 participating in the transaction.

[0197] Thereafter, the transaction start processing unit 111b, the transaction management unit 111a, and the resource management unit 211 repeatedly perform the processes of S1504 to S1508 for as many transactions that require processing, thereby processing a plurality of transactions.

[0198] FIG. 16 is a flowchart showing a processing flow executed by the transaction management unit 111a. This flowchart is the same as the flowchart of FIG. 7 except that step 1605 is added between step 725 and step 730, step 1610 is added between step 750 and step 730, steps 1615 and 1620 are added after step 775, and step 765 is deleted.

[0199] Also, in the processes of steps 720, 725, 730, 740, 750, 760, and 775 in the flowchart of FIG. 16, which have the same reference numerals as the processes in FIG. 7, the compressed log 1300 and / or the pre-compression log 1400 are used instead of the log 112, which is different from the processes in FIG. 7.

[0200] Therefore, hereinafter, the description will focus on the differences from FIG. 7.

[0201] The transaction management unit 111a determines, in step 720, whether a log (settlement result log) for the transaction targeted by the recovery request has been recorded in the compressed log 1300 or the pre-compression log 1400. If the log (settlement result log) for the transaction targeted by the recovery request has not been recorded in the compressed log 1300 and has not been recorded in the pre-compression log 1400, the transaction management unit 111a determines "NO" in step 720 and proceeds to step 725. When the transaction management unit 111a proceeds to step 725, since the log (settlement result log) for the transaction targeted by the recovery request has not been recorded in the compressed log 1300 and the pre-compression log 1400, it estimates that the settlement of that transaction is rolled back and records the rollback settlement result in the settlement result 112b of the pre-compression log 1400.

[0202] After that, the transaction management unit 111a proceeds to step 1605, compresses the pre-compression log 1400 to create the compressed log 1300, and then proceeds to step 730.

[0203] When the transaction management unit 111a proceeds to step 730, it sends an instruction corresponding to the usage information 1302 of the compressed log 1300 or the settlement result 1402 of the pre-compression log 1400 to the resource management unit 211 and returns to step 710.

[0204] In step 720, if the log (settlement result log) for the transaction targeted by the recovery request has been recorded in the compressed log 1300 or the pre-compression log 1400, the transaction management unit 111a determines "YES" in step 720 and directly proceeds to step 730. After executing the process of step 730 described above, it returns to step 710.

[0205] When the transaction management unit 111a proceeds to step 740, it determines whether a log (settlement result log) for the transaction has been recorded in the compressed log 1300 or the pre-compression log 1400.

[0206] If a log about a transaction (a settlement result log) has been recorded in the compressed log 1300 or the pre-compression log 1400, the transaction management unit 111a determines "YES" in step 740, proceeds to step 730, after executing the process of step 730 described above, returns to step 710.

[0207] If a log about a transaction (a settlement result log) has not been recorded in the compressed log 1300 and has not been recorded in the pre-compression log 1400, the transaction management unit 111a determines "NO" in step 740 and proceeds to step 745.

[0208] When the transaction management unit 111a determines "YES" in step 745 and proceeds to step 750, it records the rollback settlement result in the pre-compression log 1400, then proceeds to step 1610, compresses the pre-compression log 1400, creates the compressed log 1300, and then proceeds to step 730.

[0209] When the transaction management unit 111a determines "YES" in step 755 and proceeds to step 760, since all the voting results of the resource management units 211 participating in the transaction are prepare successes, the transaction settlement is committed, and the commit settlement result is recorded in the settlement result 112b of the pre-compression log 1400.

[0210] When the transaction management unit 111a proceeds to step 775, it determines whether the message is the last commit process completion notification from the resource management units 211 participating in the transaction based on the list of the resource management units 211 participating in the transaction in the pre-compression log 1400. If the message is the last commit process completion notification, the transaction management unit 111a determines "YES" in step 775, then sequentially executes the processes of step 1615 and step 1620 described below, and then returns to step 710.

[0211] Step 1615: The transaction management unit 111a changes the content (processing information 1403) of the log (pre-compression log 1400) from committed and finalized to committed (processed).

[0212] Step 1620: After the transaction management unit 111a compresses the pre-compression log 1400 to create the compressed log 1300, it returns to step 710.

[0213] FIG. 17 is a flowchart showing the processing flow of log compression executed by the transaction management unit 111a. When the transaction management unit 111a proceeds to the log compression process (step 1605, step 1610, step 1615, or step 1620) in FIG. 16, it starts the process from step 1700, sequentially executes the processes of step 1705 and step 1710 described below, and then proceeds to step 1715.

[0214] Step 1705: The transaction management unit 111a scans the log entries (rows (records)) of the pre-compression log 1400.

[0215] Step 1710: The transaction management unit 111a searches for a portion where rollback or committed processing is continuous. Note that the rollback portion is the portion (row (record)) where the decision result 1402 is "R", and the committed processing portion is the portion (row (record)) where the decision result 1402 is "C" and the processing information 1403 is "processed".

[0216] When the transaction management unit 111a proceeds to step 1715, it determines whether there is a portion where rollback or committed processing is continuous (that is, a portion where the rows (records) storing "C" or "R" in the pre-compression log 1400 are continuous).

[0217] If there is a portion where rollback or committed processing is continuous, the transaction management unit 111a determines "YES" in step 1715 and proceeds to step 1720. When the transaction management unit 111a proceeds to step 1720, as described above, it compresses the portion where rollback or committed processing is continuous by converting it into the range of TR identification numbers and used status, thereby creating a compressed log 1300 and returning to step 1705.

[0218] If there is no portion where rollback is continuous and no portion where committed processing is continuous, the transaction management unit 111a determines "NO" in step 1715, proceeds to step 1795, and temporarily ends this processing flow.

[0219] <Effect> As described above, the transaction management apparatus 100 according to the third embodiment of the present invention can prevent an increase in the storage area of the transaction log while ensuring the consistency of distributed transactions by compressing and recording the decision result logs of a large number of generated transactions.

[0220] <<Fourth Embodiment>> The distributed transaction management apparatuses (1) 100-1, (2) 100-2, and (3) 100-3 according to the fourth embodiment of the present invention will be described. FIG. 18 is a system configuration diagram showing a configuration example of a system (distributed transaction system) including the transaction management apparatuses 100-1, 100-2, and 100-3 according to the fourth embodiment of the present invention. Hereinafter, the "distributed transaction management apparatus (1) 100-1" is referred to as the "transaction management apparatus (1) 100-1", the distributed transaction management apparatus (2) 100-2 is referred to as the "transaction management apparatus (2) 100-2", and the distributed transaction management apparatus (3) 100-3 is referred to as the "transaction management apparatus (3) 100-3". The transaction management apparatus (1) 100-1, the transaction management apparatus (2) 100-2, and the transaction management apparatus (3) 100-3 are referred to as the "transaction management apparatus 100" when there is no particular need to distinguish them.

[0221] As shown in FIG. 18, the system includes a transaction management apparatus (1) 100-1, a transaction management apparatus (2) 100-2, a transaction management apparatus (3) 100-3, and computers (1) 200-1 to (N) 200-N. The transaction management apparatus (1) 100-1, the transaction management apparatus (2) 100-2, the transaction management apparatus (3) 100-3, and the computers (1) 200-1 to (N) 200-N are communicably connected to each other via a network NW1.

[0222] The transaction management apparatus (1) 100-1 has a transaction management unit 111a and a compressed log 1900. The hardware configuration of the transaction management apparatus (1) 100-1 is the same as the hardware configuration shown in FIG. 2, except that the transaction start processing unit 111b is not included in the program 111 and the log 112 is replaced by the compressed log 1900.

[0223] The hardware configuration of the transaction management device (2) 100-2 is the same as the hardware configuration shown in FIG. 2, except that the program 111 does not include the transaction management unit 111a, the storage device 110 does not include the log 112, and the transaction start processing unit 111b replaces the transaction start processing unit (1) 111b1.

[0224] The hardware configuration of the transaction management device (3) 100-3 is the same as the hardware configuration shown in FIG. 2, except that the program 111 does not include the transaction management unit 111a, the storage device 110 does not include the log 112, and the transaction start processing unit 111b replaces the transaction start processing unit (2) 111b2.

[0225] Hereinafter, when there is no need to particularly distinguish between the transaction start processing unit (1) 111b1 and the transaction start processing unit (2) 111b2, they are referred to as the "transaction start processing unit 111b".

[0226] The transaction management device (1) 100-1 holds (stores, remembers) the compressed log 1900 shown in FIG. 19 instead of the log 112. The compressed log 1900 includes a transaction identifier range 1901 and usage information 1902 as columns for storing information (values). In the compressed log 1900, information corresponding to each column regarding the settlement result of the transaction related to the transaction start processing unit (1) 111b1 and the transaction start processing unit (2) 111b2 is stored as row unit information (records) in association with each other. The transaction identifier range 1901 and the usage information 1902 store the same information as the transaction identifier range 1301 and the usage information 1302 in FIG. 13.

[0227] <Summary> The transaction management unit 111a temporarily records, as the pre-compression log 2000 shown in FIG. 20A, information regarding each transaction in the storage device 110 of the transaction management apparatus (1) 100-1 for each transaction start processing unit 111b.

[0228] The pre-compression log 2000 in FIG. 20A includes, as columns (fields) for storing information (values), a transaction identifier 2001, a settlement result 2002, and processing information 2003. Although not shown in the figure, the pre-compression log 2000 includes columns (fields) similar to the list 112c of resource management identifiers in FIG. 3. A list of resource management units 211 participating in the transaction indicated by the TR identification number stored in the transaction identifier 1401 is stored in this column (field).

[0229] In the pre-compression log 2000 in FIG. 20, information corresponding to each column regarding each transaction to which a TR identification number, which is a transaction identifier, is assigned by each of the transaction start processing unit (1) 111b1 and the transaction start processing unit (2) 111b2 is associated with each other and stored as row unit information (records). The information stored in the transaction identifier 2001, the settlement result 2002, and the processing information 2003 is the same as the transaction identifier 1401, the settlement result 1402, and the processing information 1403 in FIG. 14A described above.

[0230] The transaction management unit 111a creates the compressed log 1900 shown in FIG. 19 by compressing (converting) the pre-compression log 2000 in FIG. 20A, and permanently records the compressed log 1900 in the storage device 110. Thereby, the transaction management apparatus (1) 100-1 can prevent an increase in the storage area of the transaction log while ensuring the consistency of the distributed transaction.

[0231] A method for compressing the pre-compression log 2000 executed by the transaction management unit 111a into the compressed log 1900 will be described. As described above, the transaction identifier 2001 of the pre-compression log 2000 stores the TR identification number. A range of TR identification numbers (in this example, the TR identification numbers from 10 to 19) for assigning the TR identification number to the transaction is assigned to the transaction start processing unit (1) 111b1. A range of TR identification numbers (in this example, the TR identification numbers from 20 to 29) for assigning the TR identification number to the transaction is assigned to the transaction start processing unit (2) 111b2.

[0232] The transaction start processing unit (1) 111b1 assigns numbers in order from the smallest number among the predetermined range of numbers (numbers from 10 to 19) assigned in advance to each of the plurality of transactions.

[0233] The transaction start processing unit (2) 111b2 assigns numbers in order from the smallest number among the predetermined range of numbers (numbers from 20 to 29) assigned in advance to each of the plurality of transactions.

[0234] During the processing of a plurality of transactions, the transaction management unit 111a refers to the TR identification number of the pre-compression log 2000 in FIG. 20A and the settlement result corresponding to the TR identification number at a predetermined timing, and compresses the pre-compression log 2000.

[0235] The transaction management unit 111a converts the TR identification numbers (in the example of FIG. 20A, the TR identification numbers from 10 to 13) corresponding to a plurality of transactions that have been settled in the pre-compression log 2000 for the transaction start processing unit (1) 111b1 and whose TR identification numbers are continuous into information indicating the range of the plurality of TR identification numbers (the range of TR identification numbers (in the example of FIG. 20A, 10-13)), and associates information (used) indicating that the range of TR identification numbers has been used.

[0236] The transaction management unit 111a has finalized the pre-compression log 2000 for the transaction start processing unit (2) 111b2, and converts the TR identification numbers corresponding to a plurality of transactions with consecutive TR identification numbers (in the example of FIG. 20A, the TR identification numbers from 20 to 23) into information indicating the range of the plurality of TR identification numbers (the range of TR identification numbers (in the example of FIG. 20A, 20-23)), and associates information (used) indicating that the range of TR identification numbers has been used.

[0237] Thereby, the transaction management unit 111a compresses the pre-compression log 2000, creates a compression log 1900, and permanently stores the compression log 1900 in the storage device 110.

[0238] Also, thereafter, as shown in FIG. 20B, by each of the transaction start processing unit (1) 111b1 and the transaction start processing unit (2) 111b2, a TR identification number, which is a transaction identifier, is assigned to a transaction, and as the processing of a plurality of transactions proceeds, assuming that the pre-compression log 2000 has been compressed in a state where the transactions corresponding to the TR identification numbers 14 to 19 and 24 to 29 in the pre-compression log 2000 have been finalized.

[0239] In this case, the transaction management unit 111a has finalized the corresponding transaction, and converts the TR identification numbers 14 to 19 and 24 to 29 with consecutive TR identification numbers into information indicating a plurality of ranges of TR identification numbers added to the range of TR identification numbers in the compression log 1900 shown in FIG. 20A (the range of TR identification numbers (in the example of FIG. 20B, 10-29)), and associates information (used) indicating that the range of TR identification numbers has been used. Thereby, the transaction management unit 111a compresses the pre-compression log 2000, creates a compression log 1900, and permanently stores the compression log 1900 in the storage device 110.

[0240] <Operation> FIG. 21 is a sequence diagram for explaining the processing of the transaction start processing unit (1) 111b1, the transaction start processing unit (2) 111b2, and the transaction management unit 111a. In this sequence diagram, the range of transaction identifiers is assigned in ascending order for each transaction start processing unit 111b, and the processing when each of the transaction start processing units 111b assigns a transaction identifier to a transaction from the assigned range will be described. Note that as the range of transaction identifiers, for example, it is a range numbered in order by a predetermined number Y starting from the number X of the start point, and the sequentially generated ranges are sequentially assigned.

[0241] For example, the range of the Nth transaction identifier is generated by numbering in order by a predetermined number Y starting from the number X (the number of numberings includes the number X). Here, X = X0 + (Y × (N - 1)). In this example, X0 = 10 and Y = 10. In this case, the range of the first transaction identifier is numbered from the number 10 by 10, resulting in 10 to 19. The number X of the range of the second transaction identifier is 20 (= 10 + (10 × (2 - 1))), and by numbering 10 starting from the number 20, it becomes 20 to 29. The number X of the range of the third transaction identifier is 30 (= 10 + (10 × (3 - 1)), and by numbering 10 starting from the number 30, it becomes 30 to 39.

[0242] The transaction start processing unit (1) 111b1, the transaction start processing unit (2) 111b2, and the transaction management unit 111a sequentially execute the processes of S2101 to S2112 described below.

[0243] S2101: The transaction start processing unit (1) 111b1 acquires the range of transaction identifiers (the range of the transaction identifiers in the smallest order (for example, the range of TR identification numbers from 10 to 19)).

[0244] S2102: The transaction management unit 111a assigns a range of transaction identifiers (for example, the range of TR identification numbers from 10 to 19) to the transaction start processing unit (1) 111b1.

[0245] S2103: The transaction start processing unit (2) 111b2 acquires the range of the next sequential transaction identifiers (for example, the range of TR identification numbers from 20 to 29).

[0246] S2104: The transaction management unit 111a assigns a range of transaction identifiers (for example, the TR identification numbers from 20 to 29) to the transaction start processing unit (2) 111b2.

[0247] S2105: The transaction start processing unit (1) 111b1 assigns the TR identification number (10), which is a transaction identifier, from the acquired range (for example, the range of TR identification numbers from 10 to 19) to the transaction.

[0248] S2106: The transaction start processing unit (2) 111b2 assigns the TR identification number (20), which is a transaction identifier, from the acquired range (for example, the TR identification numbers from 20 to 29) to the transaction.

[0249] S2107: The transaction start processing unit (1) 111b1 assigns the next TR identification number (11), which is a transaction identifier, from the acquired range (for example, the range of TR identification numbers from 10 to 19) to the transaction.

[0250] S2108: The transaction start processing unit (2) 111b2 assigns the next transaction identifier (21) from the acquired range (for example, the TR identification numbers from 20 to 29) to the transaction.

[0251] S2119: When all the TR identification numbers in the obtained range (for example, TR identification numbers from 10 to 19) are assigned to the transactions, the transaction start processing unit (1) 111b1 acquires the next sequential range (for example, TR identification numbers from 30 to 39) of the range of the transaction identifiers currently in use (range of TR identification numbers from 10 to 29).

[0252] S2110: The transaction management unit 111a assigns the range of transaction identifiers (range of TR identification numbers from 30 to 39) to the transaction start processing unit (1) 111b1.

[0253] S2111: When all the TR identification numbers in the obtained range (for example, range of TR identification numbers from 20 to 29) are assigned to the transactions, the transaction start processing unit (2) 111b2 acquires the next range of transaction identifiers (for example, range of TR identification numbers from 40 to 49) of the range of the currently used transaction identifications (for example, range of TR identification numbers from 10 to 39).

[0254] S2112: The transaction management unit 111a assigns the range of transaction identifiers (for example, TR identification numbers from 40 to 49) to the transaction start processing unit (2) 111b2.

[0255] By performing the above operations, the transaction management unit 111a assigns the range of transaction identifiers to each transaction start processing unit 111b.

[0256] Furthermore, the transaction management unit 111a executes the processing flow shown by the above-described flowcharts of FIGS. 16 and 17 to record the settlement result log of the transaction corresponding to the TR identification number assigned to the transaction, and further compresses the recorded settlement result log of the transaction. Thereby, the transaction management device 100-1 can prevent an increase in the storage area of the transaction log while ensuring the consistency of the distributed transaction.

[0257] <Effect> As described above, the transaction management apparatus 100-1 according to the fourth embodiment of the present invention can prevent an increase in the storage area of the transaction log while ensuring the consistency of the distributed transaction by compressing and recording the decision result log of the transactions that occur in large quantities.

[0258] <<Modification Example>> The present invention is not limited to the above-described embodiments, and various modification examples can be adopted within the scope of the present invention. Further, the above-described embodiments can be combined with each other as long as they do not deviate from the scope of the present invention.

[0259] In the second embodiment, after the rollback decision due to the request for the recovery process, the decision result log of the rollback may be deleted at the point in time when a predetermined time has elapsed from the point in time when the transaction was decided by the prepare success / failure vote.

[0260] The transaction management apparatus 100 may be configured to be able to execute either the method for deleting the transaction decision result log of the rollback of the transaction management apparatus 100 according to the first embodiment (the first deletion) or the method for deleting the transaction decision result log of the rollback of the transaction management apparatus 100 according to the second embodiment (the second deletion). In this case, the transaction management apparatus 100 may be configured to be able to select and execute either the first deletion or the second deletion according to the environment of the system.

[0261] The present invention can also take the following configuration.

[0262] In a distributed transaction management apparatus including a storage device that is applied to a distributed transaction system and records a transaction decision result log indicating a decision result of a transaction of the distributed transaction system, and an information processing apparatus that manages the transaction decision result log, the information processing apparatus is When receiving a rollback processing completion notification from any one of a plurality of resource management units participating in the transaction, a first deletion for deleting the transaction settlement result log of the rollback and a second deletion for deleting the transaction settlement result log of the rollback after a certain period of time from the transaction settlement are selectively performed according to the environment of the distributed transaction system. Distributed transaction management device.

[0263] In a distributed transaction management method applied to a distributed transaction system in a specific environment, including a storage device for recording a transaction settlement result log indicating the settlement result of a transaction of the distributed transaction system, and using an information processing device for managing the transaction settlement result log, By the information processing device, When receiving a rollback processing completion notification from any one of a plurality of resource management units participating in the transaction, delete the transaction settlement result log of the rollback. Distributed transaction management method.

[0264] In a distributed transaction management method applied to a distributed transaction system in a specific environment, including a storage device for recording a transaction settlement result log indicating the settlement result of a transaction of the distributed transaction system, and using an information processing device for managing the transaction settlement result log, By the information processing device, After a certain period of time from the transaction settlement of the rollback due to a recovery request from a plurality of resource management units participating in the transaction, delete the transaction settlement result log of the rollback. Distributed transaction management method.

[0265] A distributed transaction management method that is applied to a distributed transaction system and uses a storage device for recording a transaction settlement result log indicating a settlement result of a transaction in the distributed transaction system, and an information processing device for managing the transaction settlement result log. By the information processing device, A transaction identifier number having a magnitude relationship is used for a transaction identifier for identifying the transaction, and a plurality of consecutive transaction identifier numbers corresponding to the settled transaction are converted into range information indicating a range of the plurality of consecutive transaction identifier numbers, and used information indicating that it has been used is associated with the converted range information, thereby compressing the transaction settlement result log to create a compressed log, and recording the compressed log in a storage device. Distributed transaction management method.

Explanation of Signs

[0266] 100…Transaction management device, 111a…Transaction management unit, 111b…Transaction start processing unit, 112…Log, 200-1~200-N…Computer 1~Computer N, 211-1~211-N…Resource management unit 1~Resource management unit N, 1300…Compressed log

Claims

1. A distributed transaction management apparatus applied to a distributed transaction system in a specific environment, comprising a storage device for recording a transaction decision result log indicating a decision result of a transaction of the distributed transaction system, and an information processing device for managing the transaction decision result log. In the distributed transaction management apparatus, the information processing device when receiving a rollback processing completion notification from any one of a plurality of resource management units participating in the transaction, deletes the transaction decision result log of the rollback transaction. is configured as the specific environment is an environment in which a situation where no processing order swapping occurs can occur in a resource management unit other than the resource management unit in which the processing order swapping first occurs, which occurs before the arrival of a transaction completion instruction based on the decision of the transaction by the prepare success / failure vote and before the rollback processing due to a recovery request. Distributed transaction management apparatus.

2. In the distributed transaction management apparatus according to Claim 1, the specific environment (1) The minimum value of the recovery processing activation timeout time + the recovery request communication time < the maximum value of the prepare success / failure vote communication time, and (2) The maximum value of the prepare success / failure vote communication time < the processing delay time of the recovery processing activation is an environment in which the following holds. Distributed transaction management apparatus.

3. In the distributed transaction management apparatus according to Claim 1, the information processing device when there is a recovery request for the transaction from the resource management unit and there is no transaction decision result log corresponding to the transaction, estimates a rollback and records a transaction decision result log indicating a rollback in the storage device. is configured as Distributed transaction management apparatus.

4. A distributed transaction management apparatus applied to a distributed transaction system in a specific environment, comprising a storage device for recording a transaction decision result log indicating a decision result of a transaction of the distributed transaction system, and an information processing device for managing the transaction decision result log. In the distributed transaction management apparatus, the information processing device deletes the transaction decision result log of the rollback after a certain time from the transaction decision of the rollback due to a recovery request from a plurality of resource management units participating in the transaction. configured as follows, the specific environment is an environment in which, in a resource management unit other than the resource management unit where the first order swap of processing occurs, which is a swap in the order of processing in which rollback processing due to a recovery request occurs before the arrival of a commit instruction based on the decision of a transaction by a prepare success / failure vote in the distributed transaction system, a situation may occur where no order swap of processing occurs for a certain period of time or more from the decision of the transaction due to the recovery request of the activated recovery processing. Distributed transaction management device.

5. In the distributed transaction management device according to claim 4, the specific environment is (1) the minimum value of the recovery processing activation timeout time + the recovery request communication time < the maximum value of the prepare success / failure vote communication time, and (2) the maximum value of the prepare success / failure vote communication time < the processing delay time of the recovery processing activation, and (3) the maximum value of the prepare success / failure vote communication time < the recovery processing activation timeout time + the minimum value of the recovery request communication time + the log retention time. Distributed transaction management device.

6. In the distributed transaction management device according to claim 4, the information processing device is when there is a recovery request for the transaction from the resource management unit, if there is no transaction decision result log corresponding to the transaction, it is estimated as a rollback, and a transaction decision result log indicating a rollback is recorded in the storage device. configured as Distributed transaction management device.

7. Applied to a distributed transaction system, including a storage device for recording a transaction decision result log indicating the decision result of a transaction in the distributed transaction system, and an information processing device for managing the transaction decision result log. In the distributed transaction management device, the information processing device is using a transaction identification number having a magnitude relationship as a transaction identifier for identifying the transaction, converting a plurality of consecutive transaction identification numbers corresponding to a committed transaction into range information indicating the range of the plurality of consecutive transaction identification numbers, and associating used information indicating that it has been used with the converted range information to compress the transaction decision result log, thereby creating a compressed log and recording the compressed log in the storage device. configured as Distributed transaction management device.

8. In the distributed transaction management device according to claim 7, the information processing device starts processing of the transaction and assigns a transaction identification number range within a predetermined range to the transaction start processing unit that assigns the transaction identification number to the transaction, the transaction start processing unit assigns the transaction identification number to the transaction in ascending order from the assigned transaction identification number range, configured as a distributed transaction management device.

9. In the distributed transaction management device according to claim 7, the information processing device starts processing of the transaction and assigns a different transaction identification number range within a predetermined range to each of a plurality of transaction start processing units that assign the transaction identification number to the transaction, each of the plurality of transaction start processing units assigns the transaction identification number to the transaction in ascending order from the assigned transaction identification number range, configured as a distributed transaction management device.

10. In the distributed transaction management device according to claim 7, the information processing device when there is a recovery request for a transaction participating in the transaction, refers to the compressed log, and when the range information corresponding to the transaction identification number of the transaction with the recovery request is in the compressed log, determines that the settlement of the transaction is a rollback, configured as a distributed transaction management device.

11. In a distributed transaction management method using a storage device that records a transaction settlement result log indicating a settlement result of a transaction in a distributed transaction system in a specific environment and an information processing device that manages the transaction settlement result log, by the information processing device when a rollback processing completion notification is received from any one of a plurality of resource management units participating in the transaction, deletes the transaction settlement result log of the rollback The specific environment is an environment in which an out-of-order processing situation can occur in a resource management unit other than the resource management unit in which an out-of-order processing of rollback processing due to a recovery request occurs before the arrival of a transaction completion instruction based on the determination of a transaction by a prepare success / failure vote. Distributed transaction management method.

12. In a distributed transaction management method applied to a distributed transaction system in a specific environment and including a storage device that records a transaction determination result log indicating a determination result of a transaction of the distributed transaction system, and using an information processing device that manages the transaction determination result log, by the information processing device, after a certain time from the transaction determination of rollback due to a recovery request from a plurality of resource management units participating in the transaction, delete the transaction determination result log of the rollback, The specific environment is an environment in which an out-of-order processing situation can occur in a resource management unit other than the resource management unit in which an out-of-order processing of rollback processing due to a recovery request occurs before the arrival of a commit instruction based on the determination of a transaction by a prepare success / failure vote in the distributed transaction system, and in which an out-of-order processing does not occur for a certain time or more from the transaction determination of the activated recovery process due to a recovery request. Distributed transaction management method.

13. In a distributed transaction management method applied to a distributed transaction system and including a storage device that records a transaction determination result log indicating a determination result of a transaction of the distributed transaction system, and using an information processing device that manages the transaction determination result log, by the information processing device, using a transaction identification number having a magnitude relationship as a transaction identifier for identifying the transaction, converting a plurality of consecutive transaction identification numbers corresponding to a determined transaction into range information indicating a range of the plurality of consecutive transaction identification numbers, and associating used information indicating that it has been used with the converted range information, thereby compressing the transaction determination result log to create a compressed log and recording the compressed log in the storage device. Distributed transaction management method.

Citation Information

Patent Citations

  • Decentralized transaction processing system

    JP1994259397A

  • History information analysis method for transaction processing

    JP1996235039A

  • Method for solving in-doubt state of two-phase commit protocol of distributed transaction

    JP2009282790A

  • Distributed transaction recovery system and method

    JP2010157202A

  • Snapshot acquisition processing program, snapshot acquisition processing method, snapshot participant computer, and snap shot coordinator computer

    JP2012018449A