Computer system, and control method for distributed transaction
The system addresses data integrity issues in microservices by using judgment information to determine necessary rollbacks in distributed transactions, effectively detecting inconsistencies and maintaining data integrity during service restarts.
Patent Information
- Application Number
- JP2023154171
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-04-02
- Estimated Expiration
- 2043-09-21
AI Technical Summary
Existing technologies face challenges in maintaining data integrity during distributed transactions in microservices, particularly when service restarts occur, leading to potential data inconsistencies and loss of transaction recovery information.
A computer system comprising multiple service execution systems that execute services implementing distributed transactions, where at least one service execution system generates judgment information for determining whether a rollback of the distributed transaction is necessary, and transmits this information to another service execution system for validation and decision-making.
Enables the detection of data inconsistencies associated with service restarts in applications performing distributed transactions, ensuring data integrity and allowing for appropriate rollback decisions even if transaction recovery information is lost.
Smart Images

Figure 2025046031000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for detecting data inconsistencies in an application that executes distributed transactions. [Background technology]
[0002] In recent years, the use of microservices, which link multiple services to realize a single application, has become widespread. It is known that maintaining data consistency through distributed transactions is difficult in microservices. To address this issue, the TCC pattern and Saga pattern have been developed.
[0003] When a service is restarted, transaction information related to that service is lost. This is difficult to address with conventional technology. To address this issue, the technology described in Patent Document 1 is known.
[0004] Patent document 1 states that "a system and method are provided for supporting transaction recovery based on inline delegation of transaction logs to a database. The system can obtain transaction recovery information for a transaction from a persistent storage device. During the preparation phase, the transaction recovery information is persisted in a resource manager associated with the persistent storage device. Furthermore, the system can obtain one or more in-doubt transactions from one or more participating resource managers of the transaction. The system can then determine whether to commit or roll back the one or more in-doubt transactions by matching the one or more in-doubt transactions with the transaction recovery information." [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Special Publication No. 2015-514247 Summary of the Invention [Problem to be solved by the invention]
[0006] In Patent Document 1, transaction recovery information needs to be saved, and there is a possibility that the information will be lost if a failure occurs in the resource manager. The present invention provides a technology for detecting data inconsistency caused by restarting a service in an application that executes distributed transactions. [Means for solving the problem]
[0007] A representative example of the invention disclosed in this application is as follows: A computer system composed of a plurality of service execution systems that execute a service that realizes an application that executes a distributed transaction, in which at least one of the service execution systems generates judgment information for judging whether or not the distributed transaction needs to be rolled back and transmits it to the other service execution systems, and the service execution system that receives the judgment information uses the judgment information to judge whether or not the distributed transaction needs to be rolled back. Effect of the Invention
[0008] According to the present invention, in an application that executes a distributed transaction, data inconsistency that occurs when a service is restarted can be detected. Problems, configurations, and effects other than those described above will become apparent from the following description of the embodiment. [Brief description of the drawings]
[0009] [Figure 1] FIG. 1 illustrates an example of a system configuration according to a first embodiment. [Diagram 2] FIG. 2 illustrates an example of a hardware configuration of a computer that configures the service execution system of the first embodiment. [Diagram 3]FIG. 11 is a sequence diagram illustrating a process flow of a distributed transaction in the system according to the first embodiment. [Figure 4] 1 is a diagram illustrating an example of call state management information held by the service execution system according to the first embodiment; [Diagram 5] 1 is a flowchart illustrating an example of a process executed by the service execution system according to the first embodiment. [Figure 6] 11 is a flowchart illustrating an example of a determination process executed by the service execution system according to the first embodiment. [Figure 7] FIG. 11 is a sequence diagram illustrating a process flow of a distributed transaction in the system according to the second embodiment. [Figure 8] FIG. 11 is a diagram illustrating an example of call state management information held by the service execution system according to the second embodiment. [Figure 9] 13 is a flowchart illustrating an example of a process executed by the service execution system according to the second embodiment. [Figure 10] 13 is a flowchart illustrating an example of a determination process executed by the service execution system according to the second embodiment. [Figure 11] FIG. 13 is a sequence diagram illustrating the flow of processing of a distributed transaction in the system according to the third embodiment. [Figure 12] 13 is a flowchart illustrating an example of a determination process executed by the service execution system according to the third embodiment. [Figure 13] FIG. 13 is a diagram illustrating an example of a system configuration of a fourth embodiment. [Figure 14] 13 is a flowchart illustrating an example of a process executed by a generation management device according to a fourth embodiment. [Figure 15] FIG. 13 is a sequence diagram illustrating the flow of processing of a distributed transaction in the system according to the fourth embodiment. [Figure 16] 13 is a flowchart illustrating an example of a determination process executed by the service execution system according to the fourth embodiment. [Figure 17] FIG. 13 is a diagram illustrating an example of a system configuration of a fifth embodiment. [Figure 18A]FIG. 13 is a sequence diagram illustrating the flow of processing of a distributed transaction in a system according to a fifth embodiment. [Figure 18B] FIG. 13 is a sequence diagram illustrating the flow of processing of a distributed transaction in a system according to a fifth embodiment. [Figure 19A] FIG. 13 is a diagram illustrating an example of route management information according to a fifth embodiment. [Figure 19B] FIG. 13 is a diagram illustrating an example of route management information according to a fifth embodiment. [Figure 19C] FIG. 13 is a diagram illustrating an example of route management information according to a fifth embodiment. [Figure 19D] FIG. 13 is a diagram illustrating an example of route management information according to a fifth embodiment. [Figure 20] 13 is a flowchart illustrating an example of a route management information update process executed by the load balancing device according to the fifth embodiment. [Figure 21A] FIG. 23 is a sequence diagram illustrating the flow of processing of a distributed transaction in a system according to a sixth embodiment. [Figure 21B] FIG. 23 is a sequence diagram illustrating the flow of processing of a distributed transaction in a system according to a sixth embodiment. [Figure 22A] FIG. 23 is a diagram illustrating an example of route management information according to the sixth embodiment. [Figure 22B] FIG. 23 is a diagram illustrating an example of route management information according to the sixth embodiment. [Figure 23] FIG. 23 is a diagram illustrating an example of a distributed transaction according to the seventh embodiment. [Figure 24A] FIG. 23 is a sequence diagram illustrating the flow of processing of a distributed transaction in a system according to a seventh embodiment. [Figure 24B] FIG. 23 is a sequence diagram illustrating the flow of processing of a distributed transaction in a system according to a seventh embodiment. [Diagram 25] 23 is a flowchart illustrating an example of a call process executed by the service execution system according to the seventh embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. However, the present invention is not to be interpreted as being limited to the description of the embodiment shown below. It will be easily understood by those skilled in the art that the specific configuration can be changed without departing from the concept or purpose of the present invention.
[0011] In the configurations of the invention described below, the same or similar configurations or functions are given the same reference numerals, and duplicated explanations are omitted.
[0012] In this specification, the terms "first," "second," "third," and the like are used to identify components and do not necessarily limit the number or order. EXAMPLES
[0013] Fig. 1 is a diagram illustrating an example of a system configuration of the first embodiment. Fig. 2 is a diagram illustrating an example of a hardware configuration of a computer that constitutes the service execution system 100 of the first embodiment.
[0014] The system is composed of a plurality of service execution systems 100. The service execution systems 100 are connected to each other via a network such as a LAN (Local Area Network) or a WAN (Wide Area Network).
[0015] The service execution system 100 is a system that executes services that constitute an application, and is configured, for example, by a computer 200 as shown in Fig. 2. The computer 200 has a processor 201, a main memory device 202, a secondary memory device 203, and a network interface 204. The service execution system 100 has a service instance 110, a transmission / reception unit 111, a transaction control unit 112, a judgment unit 113, and a judgment information storage unit 114. The service execution system 100 is connected to a database (not shown).
[0016] A service instance 110 is an entity that executes a service. A plurality of service instances 110 are operated for load balancing of the service execution system 100. In the first embodiment, it is assumed that the number of service instances 110 is fixed.
[0017] The transmission / reception unit 111 controls the reception of requests and the transmission of processing results. The transaction control unit 112 controls local transactions that constitute a distributed transaction. The judgment unit 113 detects data inconsistencies in a distributed transaction. The judgment information storage unit 114 stores information used by the judgment unit 113.
[0018] FIG. 3 is a sequence diagram illustrating the flow of processing of a distributed transaction in the system of the first embodiment.
[0019] The service execution system 100-1 that executes the service A transmits a call request to the service execution system 100-2 that executes the service B in response to the start of a distributed transaction (step S101). The call request includes the identification information of the distributed transaction and the identification information of the service (service B).
[0020] The call request is controlled so that it is sent to an arbitrary service instance 110 by the transmission / reception unit 111. This is because when the same service is called multiple times in a distributed transaction, the same service instance 110 needs to process the requests in order to maintain the consistency of the processing. The mechanism for calling the same service instance 110 is called affinity.
[0021] Methods for calling the same service instance 110 include, for example, a method using route information that associates the identifier of a distributed transaction with the identification information of the service instance 110 to be called, and a method using a hash value calculation.
[0022] After executing the service, the service execution system 100-2 transmits a response and determination information to the service execution system 100-1 (step S102).
[0023] In the first embodiment, a call flag indicating the call status of the service, service identification information, and distributed transaction identification information are sent as the determination information. When a call request is received for the first time, a call flag of "first time" is sent, and when a call request is received for the second or subsequent time, a call flag of "continue" is sent.
[0024] When the service execution system 100-1 receives the response and the determination information, it executes a determination process to determine whether or not a rollback of the distributed transaction accompanying the restart of the service execution system 100-2 is necessary (step S103). The details of the determination process will be described later. Here, it is determined that a rollback is not necessary.
[0025] The service execution system 100-1 transmits a call request to the service execution system 100-2 in the same distributed transaction (step S104).
[0026] After executing the service, the service execution system 100-2 transmits a response and determination information to the service execution system 100-2 (step S105). Here, the call flag "continue" is transmitted.
[0027] When the service execution system 100-1 receives the response and the determination information, it executes a determination process (step S106), where it is determined that rollback is not necessary.
[0028] After a failure occurs and the service execution system 100-2 is restarted, it receives a call request in the same distributed transaction from the service execution system 100-1 (step S107). In this case, after executing the service, the service execution system 100-2 transmits a response and determination information to the service execution system 100-1 (step S108). Since the service execution system 100-2 has been restarted, it determines that it is the first time it has received a call request. Therefore, the service execution system 100-2 transmits a call flag of "first time."
[0029] When the service execution system 100-1 receives the response and the determination information, it executes a determination process (step S109), in which it is determined that a rollback is necessary.
[0030] In the case of a distributed transaction in which three or more services are called, the judgment information transmitted by each service execution system 100 is transferred to the originating service execution system 100. Specifically, the judgment information storage unit 114 of each service execution system 100 records the judgment information received from the other service execution systems 100, and after execution of the service, the transmission / reception unit 111 transmits the judgment information of that service execution system 100 and the judgment information recorded by the judgment information storage unit 114. Then, the originating service execution system 100 executes judgment processing for each service execution system 100.
[0031] FIG. 4 is a diagram illustrating an example of the call state management information 400 held by the service execution system 100-1 of the first embodiment.
[0032] The call state management information 400 stores entries including a transaction ID 401, a service ID 402, and a call flag 403. One entry corresponds to one piece of judgment information.
[0033] The transaction ID 401 is a field that stores identification information of a distributed transaction. The service ID 402 is a field that stores identification information of a service executed by the service execution system 100 that transmitted the determination information. The call flag 403 is a field that stores a call flag.
[0034] When the transmitting / receiving unit 111 receives the determination information, it transfers the determination information to the determination information storage unit 114. The determination information storage unit 114 registers an entry in the call state management information 400 that corresponds to the determination information.
[0035] When the service execution system 100-1 is started up or restarted, the determination information storage unit 114 initializes the call state management information 400.
[0036] FIG. 5 is a flowchart illustrating an example of a process executed by the service execution system 100-2 according to the first embodiment.
[0037] The transmitting / receiving unit 111 of the service execution system 100-2 monitors the call request (step S201).
[0038] When the call request is received, the transmitting / receiving unit 111 transfers the call request to the service instance 110 (step S202). At this time, the transmitting / receiving unit 111 transfers the identification information of the distributed transaction and the identification information of the service to the determination unit 113.
[0039] The determination unit 113 determines whether or not a pair of the distributed transaction identification information and the service identification information is registered in the determination information storage unit 114 (step S203).
[0040] If the pair of the distributed transaction identification information and the service identification information has been registered, the determination unit 113 outputs the call flag "continue" to the transmission / reception unit 111 (step S204).
[0041] When the transmitting / receiving unit 111 receives a notification of completion of the process from the service instance 110, the transmitting / receiving unit 111 transmits a response and determination information to the service execution system 100-1 (step S205). The determination information includes a call flag "continue". After that, the transmitting / receiving unit 111 continues to monitor the call request.
[0042] If the pair of the distributed transaction identification information and the service identification information has not been registered, the determination unit 113 outputs a call flag "first time" to the transmission / reception unit 111 (step S206). At this time, the determination unit 113 transmits the pair of the distributed transaction identification information and the service identification information to the determination information storage unit 114.
[0043] When the transmitting / receiving unit 111 receives a notification of completion of the process from the service instance 110, the transmitting / receiving unit 111 transmits a response and determination information to the service execution system 100-1 (step S207). The determination information includes a call flag "first time". After that, the transmitting / receiving unit 111 continues to monitor the call request.
[0044] FIG. 6 is a flowchart illustrating an example of the determination process executed by the service execution system 100-1 according to the first embodiment.
[0045] When the transmitting / receiving unit 111 receives a response, it instructs the determination unit 113 to execute a determination process. First, the determination unit 113 refers to the call state management information 400, and counts the number of entries that match the identification information of the distributed transaction and the identification information of the service included in the determination information and that have the call flag 403 set to "first time" (step S301).
[0046] The determining unit 113 determines whether the number of entries is "1" (step S302).
[0047] If the number of entries is "1", the determination unit 113 ends the determination process. If the number of entries is greater than "1", the determination unit 113 determines that a rollback of the distributed transaction is necessary, and starts the rollback (step S303). Thereafter, the determination unit 113 ends the determination process. The rollback of the distributed transaction may be executed by the determination unit 113 or by the transaction control unit 112.
[0048] According to the first embodiment, it is possible to detect data inconsistency in an application that executes a distributed transaction due to a restart of a service. Even if information on the restarted service is lost, it is possible to detect data inconsistency. EXAMPLES
[0049] In the second embodiment, data included in the determination information and the contents of the determination process are different from those in the first embodiment. The second embodiment will be described below, focusing on the differences from the first embodiment.
[0050] The system configuration of the second embodiment is the same as that of the first embodiment. In the second embodiment, data included in the determination information is different.
[0051] FIG. 7 is a sequence diagram illustrating the flow of processing of a distributed transaction in the system according to the second embodiment.
[0052] The service execution system 100-1 transmits a call request to the service execution system 100-2 when a distributed transaction starts (step S401). The call request includes the identification information of the distributed transaction and the identification information of the service (service A).
[0053] After executing the service, the service execution system 100-2 transmits a response and determination information to the service execution system 100-1 (step S402).
[0054] In the second embodiment, the number of times the service has been started, the identification information of the service, the identification information of the service instance 110 that executed the service, and the identification information of the distributed transaction are transmitted as the determination information.
[0055] When the service execution system 100-1 receives the response and the judgment information, it executes a judgment process to judge whether or not a rollback of the distributed transaction is necessary (step S403). The details of the judgment process will be described later. Here, it is judged that a rollback is not necessary.
[0056] After a failure occurs and the service execution system 100-2 is restarted, it receives a call request in the same distributed transaction from the service execution system 100-1 (step S404). In this case, after executing the service, the service execution system 100-2 transmits a response and determination information to the service execution system 100-1 (step S405). The number of times of invocation becomes a value obtained by adding 1 to the previous value.
[0057] When the service execution system 100-1 receives the response and the determination information, it executes a determination process (step S406), in which it is determined that a rollback is necessary.
[0058] In the case of a distributed transaction in which three or more services are called, the judgment information transmitted by each service execution system 100 is transferred to the originating service execution system 100. Specifically, the judgment information storage unit 114 of each service execution system 100 records the judgment information received from the other service execution systems 100, and after execution of the service, the transmission / reception unit 111 transmits the judgment information of that service execution system 100 and the judgment information recorded by the judgment information storage unit 114. Then, the originating service execution system 100 executes judgment processing for each service execution system 100.
[0059] FIG. 8 is a diagram illustrating an example of the call status management information 800 held by the service execution system 100-1 of the second embodiment.
[0060] The call state management information 800 stores entries including a transaction ID 801, a service ID 802, an instance ID 803, and an invocation count 804. One entry corresponds to one piece of judgment information.
[0061] The transaction ID 801 and the service ID 802 are the same fields as the transaction ID 401 and the service ID 402 .
[0062] The instance ID 803 is a field that stores identification information of the service instance 110. The number of invocations 804 is a field that stores the number of times the service has been invoked.
[0063] When the transmitting / receiving unit 111 receives the determination information, it transfers the determination information to the determination information storage unit 114. The determination information storage unit 114 registers an entry in the call state management information 800 that corresponds to the determination information.
[0064] When the service execution system 100-1 is started up or restarted, the determination information storage unit 114 initializes the call state management information 800.
[0065] FIG. 9 is a flowchart illustrating an example of a process executed by the service execution system 100-2 according to the second embodiment.
[0066] The transaction control unit 112 of the service execution system 100-2 counts up the number of times the service has been started, and records the number in a non-volatile storage device (step S501).
[0067] The transmitting / receiving unit 111 of the service execution system 100-2 monitors the call request (step S502).
[0068] When the call request is received, the transmission / reception unit 111 transfers the call request to the service instance 110 (step S503).
[0069] When the transmitting / receiving unit 111 receives a notification of completion of processing from the service instance 110, it transmits a response and determination information to the service execution system 100-1 (step S504). The determination information includes the number of times the service has been started, identification information of the service, identification information of the service instance 110 that executed the service, and identification information of the distributed transaction. Thereafter, the transmitting / receiving unit 111 continues to monitor the call request.
[0070] FIG. 10 is a flowchart illustrating an example of the determination process executed by the service execution system 100-1 of the second embodiment.
[0071] When the transmitting / receiving unit 111 receives a response, it instructs the determination unit 113 to execute a determination process. First, the determination unit 113 refers to the call state management information 800 and searches for an entry in which the identification information of the distributed transaction and the identification information of the service included in the determination information match (step S601).
[0072] The determination unit 113 determines whether or not the combinations of the activation counts and the service instances 110 of all the entries are the same (step S602).
[0073] If the combination of the activation count and the service instance 110 for all the entries is the same, the determination unit 113 ends the determination process.
[0074] If there is at least one entry with a different combination of invocation count and service instance 110, the determination unit 113 determines that a rollback of the distributed transaction is necessary and starts the rollback (step S603). After that, the determination unit 113 ends the determination process. The rollback of the distributed transaction may be executed by the determination unit 113 or the transaction control unit 112.
[0075] According to the second embodiment, data inconsistencies that occur either due to a service restart or due to invocation of a different service instance 110 within a distributed transaction can be detected.
[0076] The determination information does not have to include identification information of the service instance 110. In this case, data inconsistency caused by restarting the service can be detected. EXAMPLES
[0077] In the third embodiment, the service execution system 100-2 that receives the call request executes the determination process. The third embodiment will be described below, focusing on the differences from the first embodiment.
[0078] The configuration of the system of the third embodiment is the same as that of the first embodiment. Fig. 11 is a sequence diagram illustrating the flow of processing of a distributed transaction in the system of the third embodiment.
[0079] When a distributed transaction starts, the service execution system 100-1 transmits a call request and judgment information to the service execution system 100-2 (step S701). The call request includes identification information of the distributed transaction and identification information of the service (service A). The judgment information includes a call flag indicating the call status of the service. When a call request is transmitted for the first time, the call flag "first time" is transmitted, and when a call request is transmitted for the second or subsequent times, the call flag "continue" is transmitted.
[0080] When the service execution system 100-2 receives the call request and the judgment information, it executes a judgment process to judge whether or not a rollback of the distributed transaction is necessary (step S702). The details of the judgment process will be described later. Here, it is judged that a rollback is not necessary.
[0081] After executing the service, the service execution system 100-2 transmits a response and determination information to the service execution system 100-1 (step S703).
[0082] In the third embodiment, the call flag, the identification information of the service, and the identification information of the distributed transaction are transmitted as the determination information.
[0083] When the service execution system 100-1 receives the response and the determination information, it records the call flag.
[0084] The service execution system 100-1 transmits a call request and determination information to the service execution system 100-2 in the same distributed transaction (step S704). Since the service execution system 100-1 has received the call flag "first time" from the service execution system 100-2, it transmits the call flag "continue".
[0085] When the service execution system 100-2 receives the call request and the determination information, it executes a determination process (step S705). Here, it is determined that rollback is not necessary.
[0086] After executing the service, the service execution system 100-2 transmits a response and determination information to the service execution system 100-1 (step S706).
[0087] After the service execution system 100-2 has restarted after a failure occurs, it receives a call request and judgment information for the same distributed transaction from the service execution system 100-1 (step S707). In this case, since the service execution system 100-1 has received the call flag "first time" from the service execution system 100-2, it sends the call flag "continue".
[0088] The service execution system 100-2 executes a determination process (step S708), in which it is determined that a rollback is necessary.
[0089] In the case of a distributed transaction in which three or more services are called, each of the service execution systems 100 that receives the call request executes the determination process.
[0090] FIG. 12 is a flowchart illustrating an example of the determination process executed by the service execution system 100-2 according to the third embodiment.
[0091] When the transmitting / receiving unit 111 receives a call request, it instructs the determination unit 113 to execute a determination process. First, the determination unit 113 inquires of the determination information storage unit 114 whether or not a call flag is recorded (step S801).
[0092] If the call flag is not recorded, the determination unit 113 determines whether the received call flag is "first time" (step S802).
[0093] If the received call flag is not "first time", the determination unit 113 determines that a rollback of the distributed transaction is necessary and starts the rollback (step S806). After that, the determination unit 113 ends the determination process. The rollback of the distributed transaction may be executed by the determination unit 113 or the transaction control unit 112.
[0094] If the received call flag is "first time", the determination unit 113 records the received call flag (step S803). Specifically, the determination unit 113 transfers the received call flag to the determination information storage unit 114. The determination unit 113 transfers the call request to the service instance 110 (step S804), and then ends the determination process.
[0095] If the call flag is recorded, the determination unit 113 determines whether the received call flag is "continue" (step S805).
[0096] If the received call flag is "continue", the determination unit 113 records the received call flag (step S803). The determination unit 113 transfers the call request to the service instance 110 (step S804), and then ends the determination process.
[0097] If the received call flag is not "continue", the determination unit 113 determines that a rollback of the distributed transaction is necessary, and starts the rollback (step S806). After that, the determination unit 113 ends the determination process.
[0098] According to the third embodiment, data inconsistency in a distributed transaction that accompanies the restart of a service can be detected on a service-by-service basis. EXAMPLES
[0099] In the fourth embodiment, the service execution system 100-2 that receives the call request executes the determination process. The fourth embodiment will be described below, focusing on the differences from the first embodiment.
[0100] 13 is a diagram showing an example of the configuration of a system according to the fourth embodiment. The system according to the fourth embodiment includes a generation management device 120. Any one of the service execution systems 100 may have the function of the generation management device 120.
[0101] In the fourth embodiment, the generation management device 120 assigns generations to distributed transactions and service instances 110.
[0102] FIG. 14 is a flowchart illustrating an example of processing executed by the generation management device 120 of the fourth embodiment.
[0103] Upon startup, the generation management device 120 sets the generation number to an initial value of "1" (step S901) and monitors the occurrence of an event (step S902). For example, the generation management device 120 detects the start of a distributed transaction, the start of a service, etc. as the occurrence of an event.
[0104] When an event occurs, generation management device 120 increments the generation number by 1 (step S903), and notifies the source of the event of the generation number (step S904). After that, generation management device 120 monitors the occurrence of an event.
[0105] FIG. 15 is a sequence diagram illustrating the flow of processing of a distributed transaction in the system according to the fourth embodiment.
[0106] When the service execution system 100-2 is started, it obtains the generation number "1" from the generation management device 120 and manages it as an instance generation.
[0107] When a distributed transaction starts, the service execution system 100-1 transmits a call request and judgment information to the service execution system 100-2 (step S1001). The call request includes service identification information (service A). The judgment information includes the generation of the transaction. Specifically, the service execution system 100-1 obtains the generation number "2" from the generation management device 120 and transmits it as the transaction generation.
[0108] When the service execution system 100-2 receives the call request and the judgment information, it executes a judgment process to judge whether or not a rollback of the distributed transaction is necessary (step S1002). The details of the judgment process will be described later. Here, it is judged that a rollback is not necessary.
[0109] After executing the service, the service execution system 100-2 transmits a response to the service execution system 100-1 (step S1003).
[0110] After the service execution system 100-2 has restarted after a failure occurs, it receives a call request and judgment information in the same distributed transaction from the service execution system 100-1 (step S1004).
[0111] When the service is restarted, the service execution system 100-2 obtains the generation number "3" from the generation management device 120 and manages it as the instance generation. In addition, the service execution system 100-1 transmits the same transaction generation as the previous time because the request is for the same distributed transaction.
[0112] The service execution system 100-2 executes a determination process (step S1005), where it is determined that a rollback is necessary.
[0113] In the case of a distributed transaction in which three or more services are called, each of the service execution systems 100 that receives the call request executes the determination process.
[0114] FIG. 16 is a flowchart illustrating an example of the determination process executed by the service execution system 100-2 according to the fourth embodiment.
[0115] When the transmitting / receiving unit 111 receives a response, it instructs the determination unit 113 to execute a determination process. First, the determination unit 113 determines whether or not the transaction generation is equal to or greater than the instance generation (step S1101).
[0116] If the transaction generation is equal to or greater than the instance generation, the determining unit 113 transfers the call request to the service instance 110 (step S1102), and then ends the determining process.
[0117] If the transaction generation is smaller than the instance generation, it is determined that the distributed transaction needs to be rolled back, and the rollback is started (step S1103). After that, the determination unit 113 ends the determination process. The rollback of the distributed transaction may be executed by the determination unit 113 or the transaction control unit 112.
[0118] According to the fourth embodiment, data inconsistency in a distributed transaction that accompanies the restart of a service can be detected on a service-by-service basis. EXAMPLES
[0119] The number of service instances 110 in the service execution system 100 changes depending on the service load. If the number of service instances 110 is changed during execution of a distributed transaction, the same service instance 110 may not be called. The system of the fifth embodiment determines whether or not a rollback is necessary, and calls the same service instance 110.
[0120] 17 is a diagram showing an example of a system configuration of the embodiment 5. The system of the embodiment 5 includes a generation management device 120 and a load balancing device .
[0121] Any one of the service execution systems 100 may have the functionality of the generation management device 120. Any one of the service execution systems 100 may have the functionality of the load balancing device .
[0122] The generation management device 120 of the fifth embodiment has the same functions as the generation management device 120 of the fourth embodiment. The load balancer 130 uses route information to control calling of the service instance 110 of each service. The load balancer 130 of the fifth embodiment holds route management information 1900. The details of the route management information 1900 will be described later.
[0123] 18A and 18B are sequence diagrams explaining the flow of processing of a distributed transaction in the system of the embodiment 5. FIGs. 19A, 19B, 19C, and 19D are diagrams showing an example of path management information 1900 of the embodiment 5.
[0124] First, the sequence diagram in Fig. 18A will be described. When generating route information, the load balancer 130 obtains the generation number "1" from the generation management device 120 and manages it as the route generation. At this time, the load balancer 130 generates route management information 1900 including an entry in which the generation number "1" is stored in route generation 1901 and route information is stored in route information 1903. When started up, the service execution system 100-2 obtains the generation number "2" from the generation management device 120 and manages it as the instance generation.
[0125] When a distributed transaction starts, the service execution system 100-1 transmits a call request and judgment information to the service execution system 100-2 (step S1201). The call request includes service identification information (service A). The judgment information includes the generation of the transaction. Specifically, the service execution system 100-1 obtains the generation number "3" from the generation management device 120 and transmits it as the transaction generation.
[0126] When the load balancer 130 receives the call request and the determination information, it executes a route management information update process (step S1202). Here, route management information 1900 as shown in Fig. 19A is generated. The route management information 1900 stores entries including a route generation 1901, a transaction generation 1902, and route information 1903.
[0127] The load balancer 130 transmits the call request and the determination information to the service execution system 100-2 based on the route information associated with the route generation "1" (step S1203).
[0128] When the service execution system 100-2 receives the call request and the determination information, it executes a determination process (step S1204). The determination process of the fifth embodiment is the same as that of the fourth embodiment, and therefore a description thereof will be omitted.
[0129] When a new distributed transaction starts, the service execution system 100-1 transmits a call request and determination information to the service execution system 100-2 (step S1205). The service execution system 100-1 obtains the generation number "4" from the generation management device 120 and transmits it as the transaction generation.
[0130] When the load balancer 130 receives the call request and the determination information, it executes a route management information update process (step S1206). Here, the route management information 1900 as shown in FIG. 19B is updated.
[0131] The processes in steps S1207 and S1208 are the same as those in steps S1203 and S1204.
[0132] Next, the sequence diagram in Fig. 18B will be described. When generating route information, the load balancer 130 obtains the generation number "1" from the generation management device 120 and manages it as the route generation. At this time, the load balancer 130 generates route management information 1900 including an entry in which the generation number "1" is stored in route generation 1901 and route information is stored in route information 1903. When started up, the service execution system 100-2 obtains the generation number "2" from the generation management device 120 and manages it as the instance generation.
[0133] The processing from step S1201 to step S1204 is the same as the processing described in FIG. 18A.
[0134] As the number of service instances 110 in the service execution system 100-2 increases or decreases, the load balancer 130 generates new route information (step S1251) and then executes route management information update processing (step S1252). When generating route information, the load balancer 130 obtains the generation number "4" from the generation management device 120 and manages it as the route generation. Furthermore, the route management information update processing updates route management information 1900 as shown in FIG. 19C.
[0135] The service execution system 100-1 transmits a call request and determination information to the service execution system 100-2 in conjunction with the start of a new distributed transaction (step S1253). The service execution system 100-1 obtains the generation number "5" from the generation management device 120 and transmits it as the transaction generation.
[0136] When the load balancer 130 receives the call request and the determination information, it executes a route management information update process (step S1254). Here, the route management information 1900 as shown in FIG. 19D is updated.
[0137] When the load balancer 130 receives a call request, it switches the route information to be used according to the transaction generation included in the call request, and transfers the call request to a specific service instance 110. This makes it possible to call the same service instance 110 even if the number of service instances 110 changes.
[0138] FIG. 20 is a flowchart illustrating an example of a route management information update process executed by the load balancer 130 according to the fifth embodiment.
[0139] The load balancing device 130 determines whether or not the reception of a call request is an execution trigger (step S1301).
[0140] If the execution is triggered by the reception of a call request, the load balancer 130 registers the transaction generation included in the call request in the entry corresponding to the current route generation in the route management information 1900 (step S1302). After that, the load balancer 130 ends the route management information update process.
[0141] If the reception of a call request is not the trigger for execution, the load balancer 130 requests the generation management device 120 to update the generation (step S1303).
[0142] The load balancer 130 adds the entry to the path management information 1900 (step S1304) and ends the path management information update process. The path generation 1901 of the added entry stores the generation number acquired from the generation management device 120. In addition, the path information 1903 of the added entry stores the newly generated path information.
[0143] According to the fifth embodiment, data inconsistency in a distributed transaction caused by restarting a service can be detected on a service-by-service basis, as in the fourth embodiment. Also, even if the number of service instances 110 increases or decreases, control can be performed so that the same service instance 110 executes processing in the distributed transaction. EXAMPLES
[0144] Example 6 is a modified example of Example 5. Figures 21A and 21B are sequence diagrams explaining the flow of distributed transaction processing in the system of Example 6. Figures 22A and 22B are diagrams showing an example of path management information 2200 of Example 6.
[0145] First, the sequence diagram of FIG. 21A will be described. When the service execution system 100-2 is started, it sets a predetermined number of instances, obtains a generation number "1" from the generation management device 120, and manages it as an instance generation. The service execution system 100-2 also notifies the load balancer 130 of the instance ID. When the load balancer 130 receives a notification from the service execution system 100-2, it obtains a generation number "2" from the generation management device 120, and manages it as a path generation. At this time, the load balancer 130 generates path management information 2200 including an entry in which the generation number "2" is stored in the start path generation 2201 and the ID of an instance managed by the service execution system 100-2 is stored in the instance ID 2203. Note that a value meaning infinity is set in the end path generation 2202. For example, the path management information 2200 shown in FIG. 22A is generated.
[0146] When a distributed transaction starts, the service execution system 100-1 transmits a call request and judgment information to the service execution system 100-2 (step S1401). The call request includes service identification information (service A). The judgment information includes the generation of the transaction. Specifically, the service execution system 100-1 obtains the generation number "3" from the generation management device 120 and transmits it as the transaction generation.
[0147] When the load balancer 130 receives the call request and the determination information, it determines the instance ID of the destination (step S1402). Specifically, the following process is executed.
[0148] (S1402-1) The load balancing apparatus 130 identifies a range determined by the start route generation 2201 and the end route generation 2202 of each entry in the route management information 2200.
[0149] (S1402-2) The load balancer 130 identifies a range that includes the transaction generation.
[0150] (S1402-3) The load balancing apparatus 130 selects an instance ID from the instance IDs 2203 of the entries corresponding to the identified range, based on a hash balancing algorithm using the transaction ID as a key.
[0151] The load balancer 130 transmits the call request and the determination information to the determined instance ID of the service execution system 100-2 (step S1403).
[0152] When the service execution system 100-2 receives the call request and the determination information, it executes a determination process (step S1404). The determination process of the sixth embodiment is the same as that of the fourth embodiment, and therefore a description thereof will be omitted.
[0153] When a new distributed transaction starts, the service execution system 100-1 transmits a call request and determination information to the service execution system 100-2 (step S1405). The service execution system 100-1 obtains the generation number "4" from the generation management device 120 and transmits it as the transaction generation.
[0154] When the load balancer 130 receives the call request and the determination information, it determines the instance ID of the destination (step S1406). The process of step S1406 is the same as the process of step S1402.
[0155] The processes in steps S1407 and S1408 are the same as those in steps S1403 and S1404.
[0156] Next, the sequence diagram of FIG. 21B will be described. When the service execution system 100-2 is started, it sets a predetermined number of instances, obtains a generation number "1" from the generation management device 120, and manages it as an instance generation. The service execution system 100-2 also notifies the load balancer 130 of the instance ID. When the load balancer 130 receives a notification from the service execution system 100-2, it obtains a generation number "2" from the generation management device 120, and manages it as a path generation. At this time, the load balancer 130 generates path management information 2200 including an entry in which the generation number "2" is stored in the start path generation 2201 and the ID of an instance managed by the service execution system 100-2 is stored in the instance ID 2203. Note that a value meaning infinity is set in the end path generation 2202. For example, the path management information 2200 as shown in FIG. 22A is generated.
[0157] The processing from step S1401 to step S1404 is the same as the processing described in FIG. 21A.
[0158] The service execution system 100-2 notifies the instance ID according to an increase or decrease in the number of service instances 110. The load balancer 130 updates the path management information 2200 (step S1451). Specifically, the following process is executed.
[0159] (S1451-1) The load balancer 130 searches the route management information 2200 for an entry that stores a value indicating infinity in the end route generation 2202. The load balancer 130 sets a value obtained by subtracting 1 from the acquired generation number to the end route generation 2202 of the searched entry.
[0160] (S1451-2) The load balancer 130 adds an entry to the path management information 2200, sets the acquired generation number to the start path generation 2201 of the added entry, and sets the ID of the notified instance to the instance ID 2203. A value indicating infinity is set to the end path generation 2202.
[0161] Through the above processing, the route management information 2200 is updated, for example, as shown in FIG. 22B.
[0162] The service execution system 100-1 transmits a call request and determination information to the service execution system 100-2 in conjunction with the start of a new distributed transaction (step S1452). The service execution system 100-1 obtains the generation number "5" from the generation management device 120 and transmits it as the transaction generation.
[0163] When the load balancer 130 receives the call request and the determination information, it determines the instance ID of the destination (step S1453). The process of step S1453 is the same as the process of step S1402. In step S1453, the instance is determined based on a new entry added to the route management information 2200.
[0164] The processes in steps S1454 and S1455 are the same as those in steps S1403 and S1404. EXAMPLES
[0165] The seventh embodiment is a modification of the third embodiment. Fig. 23 is a diagram showing an example of a distributed transaction of the seventh embodiment.
[0166] In the distributed transaction shown in FIG. 23, service A calls service B and service D in this order, and then service A calls service C and service D in this order.
[0167] 24A and 24B are sequence diagrams illustrating the flow of processing of a distributed transaction in the system of the seventh embodiment.
[0168] The service execution system 100-1 executes a call process in response to the start of a distributed transaction (step S1501). In the call process, a call flag and a service list are set. The details of the call process will be described later. Here, the call flag is set to "first time", and a service list in which service B is registered is set.
[0169] The service execution system 100-1 transmits a call request and determination information to the service execution system 100-2 (step S1502). The call request includes identification information of the distributed transaction. In the seventh embodiment, a call flag and a service list are transmitted as the determination information.
[0170] When the service execution system 100-2 receives the call request and the judgment information, it stores the service list included in the judgment information, and then executes a judgment process to judge whether or not a rollback of the distributed transaction is necessary (step S1503). The details of the judgment process are the same as those in the third embodiment. Here, it is judged that a rollback is not necessary.
[0171] After executing the service, the service execution system 100-2 determines that it is necessary to call the service execution system 100-4, and executes the call process (step S1504). Here, the call flag is set to "first time", and a service list in which the service B and the service D are registered is set.
[0172] The service execution system 100-2 transmits a call request and determination information to the service execution system 100-4 (step S1505). The call request includes identification information of the distributed transaction. In step S1505, a service list in which service B and service D to be executed by the service execution system 100-4 are registered is transmitted.
[0173] When the service execution system 100-4 receives the call request and the determination information, it stores the service list included in the determination information and then executes a determination process (step S1506). Here, it is determined that rollback is not necessary.
[0174] After executing the service, the service execution system 100-4 transmits a response and determination information to the service execution system 100-2 (step S1507).
[0175] When the service execution system 100-2 receives the response and the determination information, it records the call flag and the service list included in the determination information, and then transfers the response to the service execution system 100-1 (step S1508).
[0176] When the service execution system 100-1 receives the response and the determination information, it records the call flag and the service list included in the determination information. After that, the service execution system 100-1 executes the call process to send a call request to the service execution system 100-3 (step S1509). Here, the call flag is set to "first time", and a service list is set in which service B, service D, and service C executed by the service execution system 100-3 are registered.
[0177] The service execution system 100-1 transmits the call request and the determination information to the service execution system 100-3 (step S1510).
[0178] When the service execution system 100-3 receives the call request and the judgment information, it stores the service list included in the judgment information, and then executes a judgment process to judge whether or not a rollback of the distributed transaction is necessary (step S1511). Here, it is judged that a rollback is not necessary.
[0179] After executing the service, the service execution system 100-2 determines that it is necessary to call the service execution system 100-4, and executes the call process (step S1512). Here, the call flag is set to "continue," and a service list is set in which the service B, service C, and service D are registered.
[0180] When the service execution system 100-4 receives the call request and the determination information, it stores the service list included in the determination information and then executes a determination process (step S1514). Here, it is determined that rollback is not necessary.
[0181] After executing the service, the service execution system 100-4 transmits a response and determination information to the service execution system 100-3 (step S1515).
[0182] When the service execution system 100-3 receives the response and the determination information, it records the call flag and the service list included in the determination information, and then transfers the response to the service execution system 100-1 (step S1516).
[0183] When the service execution system 100-1 receives the response and the determination information, it records the call flag and the service list included in the determination information.
[0184] If the call process is not executed, the call flag "first time" is sent from the service execution system 100-3 to the service execution system 100-4. At this time, the service execution system has already been called from the service execution system 100-2 within the same distributed transaction. Therefore, the service execution system 100-4 determines that a rollback is necessary. In the seventh embodiment, in order to prevent the above-mentioned rollback, a service list for grasping the call status of the service within the distributed transaction is included in the determination information, and the call flag is adjusted.
[0185] FIG. 25 is a flowchart illustrating an example of a call process executed by the service execution system 100 according to the seventh embodiment.
[0186] The transaction control unit 112 determines whether or not the service of the call destination is registered in the service list stored in the determination information storage unit 114 (step S1601).
[0187] At the start of a distributed transaction, the originating service execution system 100 has no service list in the judgment information storage unit 114. Therefore, the originating service execution system 100 generates an empty service list in the judgment information storage unit 114 and proceeds to step S1603.
[0188] If the service to be called is registered in the service list, the transaction control unit 112 sets the call flag to "continue" (step S1602). The transaction control unit 112 sends a call request to the service execution system 100 that executes the service to be called, along with the call flag to "continue" and the service list stored in the judgment information storage unit 114, together with the judgment information (step S1605).
[0189] If the service of the call destination is not registered in the service list, transaction control unit 112 registers the service of the call destination in the service list stored in determination information storage unit 114 (step S1603).
[0190] The transaction control unit 112 sets the call flag to "first time" (step S1604). The transaction control unit 112 transmits a call request to the service execution system 100 that executes the service to be called, together with the call flag "first time" and the service list stored in the determination information storage unit 114 and the determination information (step S1605).
[0191] According to the seventh embodiment, data inconsistency can also be detected in a distributed transaction that calls the same service via multiple routes.
[0192] The present invention is not limited to the above-mentioned embodiment, but includes various modified examples. For example, the above-mentioned embodiment describes the configuration in detail to easily explain the present invention, and the present invention is not necessarily limited to the configuration including all the described configurations. Also, it is possible to add, delete, or replace a part of the configuration of each embodiment with another configuration.
[0193] In addition, each of the above configurations, functions, processing units, processing means, etc. may be realized in part or in whole by hardware, for example, by designing them as integrated circuits. The present invention can also be realized by software program code that realizes the functions of the embodiments. In this case, a storage medium on which the program code is recorded is provided to a computer, and a processor included in the computer reads the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-mentioned embodiments, and the program code itself and the storage medium storing it constitute the present invention. Examples of storage media for supplying such program code include flexible disks, CD-ROMs, DVD-ROMs, hard disks, SSDs (Solid State Drives), optical disks, magneto-optical disks, CD-Rs, magnetic tapes, non-volatile memory cards, ROMs, etc.
[0194] Furthermore, the program code for realizing the functions described in this embodiment can be implemented in a wide range of program or script languages, such as assembler, C / C++, perl, Shell, PHP, Python, Java (registered trademark), etc.
[0195] Furthermore, the program code of the software that realizes the functions of the embodiments may be distributed over a network and stored in a storage means such as a computer's hard disk or memory, or in a storage medium such as a CD-RW or CD-R, and the processor of the computer may read out and execute the program code stored in the storage means or storage medium.
[0196] In the above-mentioned embodiment, the control lines and information lines are shown as those considered necessary for the explanation, and not all the control lines and information lines are shown in the product. All the components may be connected to each other. [Explanation of symbols]
[0197] 100 Service Execution System 110 Service Instances 111 Transmitter / receiver 112 Transaction Control Unit 113 Judgment section 114 Judgment information storage unit 120 generation management device 130 Load balancer 200 calculator 201 Processor 202 Main storage 203 Secondary storage device 204 Network Interface 400, 800 call status management information 1900 Route Management Information
Claims
1. A computer system including a plurality of service execution systems that execute a service that realizes an application that executes a distributed transaction, at least one of the service execution systems generates determination information for determining whether or not the distributed transaction needs to be rolled back, and transmits the determination information to the other service execution systems; The computer system according to claim 1, wherein the service execution system, having received the determination information, uses the determination information to determine whether or not rollback of the distributed transaction is necessary.
2. 2. The computer system of claim 1, the service execution system receives a call request instructing execution of the service, generates the determination information, A computer system characterized in that the service execution system that executes the service that is the starting point of the distributed transaction obtains the judgment information from the service execution system that executes the service related to the distributed transaction, and determines whether or not a rollback of the distributed transaction is necessary.
3. 3. The computer system of claim 2, The service execution system that receives the call request Executing the service, and generating a call flag indicating a call state of the service execution system as the determination information; the service execution system that executes the service that is the starting point of the distributed transaction, Saving the recall flag; determining whether or not there are two or more call flags indicating that the call request has been received for the first time for each of the service execution systems that execute the service related to the distributed transaction; A computer system characterized in that, when there is at least one service execution system having two or more call flags indicating that the call request has been received for the first time, it is determined that a rollback of the distributed transaction is necessary.
4. 4. The computer system of claim 3, The service execution system that receives the call request When the call request is received for the first time, the call flag indicating that the call is a first call is generated as the determination information; A computer system characterized in that, when a second or subsequent call request is received, the call flag indicating that the call is a second or subsequent call is generated as the determination information.
5. 3. The computer system of claim 2, the service execution system sets the number of times the service is started at the time of starting the service, the service execution system that receives the call request executes the service and generates the number of times the service is invoked as the determination information; the service execution system that executes the service that is the starting point of the distributed transaction, Store the number of times the service is started; determining whether or not a previously received number of times that the service is started and a currently received number of times that the service is started are the same for each of the service execution systems that execute the services related to the distributed transaction; A computer system characterized by determining that a rollback of the distributed transaction is necessary when there is at least one service execution system for which the number of times the service was started last time received does not match the number of times the service was started this time received.
6. 6. The computer system of claim 5, the service execution system includes a plurality of instances that execute the service; the service execution system that has received the call request generates, as the determination information, a number of times the service is started and identification information of the instance; the service execution system that executes the service that is the starting point of the distributed transaction, determining whether or not a previously received set of the number of times the service is started and the identification information of the instance matches a currently received set of the number of times the service is started and the identification information of the instance, for each of the service execution systems that execute the services related to the distributed transaction; A computer system characterized by determining that a rollback of the distributed transaction is necessary when there is at least one service execution system in which the set of the number of times the service is started and the identification information of the instance received last time does not match the set of the number of times the service is started and the identification information of the instance received this time.
7. 2. The computer system of claim 1, the service execution system that executes the service that is the starting point of the distributed transaction, generating the determination information; Sending a call request to the other service execution system together with the determination information, the call request instructing the other service execution system to execute the service; The computer system according to claim 1, wherein the service execution system that receives the call request determines whether or not rollback of the distributed transaction is necessary based on the determination information.
8. 8. The computer system of claim 7, the service execution system that executes the service that is the starting point of the distributed transaction generates, as the determination information, a call flag that indicates a call state of the other service execution system; When a response to the call request is received from the other service execution system, the call flag is updated; The service execution system that receives the call request If the call flag is not recorded, determining whether the received call flag is the call flag indicating that a service is being called for the first time, and if the received call flag is not the call flag indicating that a service is being called for the first time, determining that a rollback of the distributed transaction is necessary; if the call flag has been recorded, determining whether the previously received call flag matches the currently received call flag, and if the previously received call flag does not match the currently received call flag, determining that a rollback of the distributed transaction is necessary; If rollback of the distributed transaction is not required, the received call flag is recorded.
9. 8. The computer system of claim 7, the service execution system that executes the service that is the starting point of the distributed transaction generates, as the determination information, a call flag that indicates a call state of the called service execution system, and a list that registers identification information of the service executed by the called service execution system; The service execution system includes: When the call request is received, recording said list; a process of determining whether the received call flag is a call flag indicating that a service is being called for the first time if the call flag has not been recorded, determining that a rollback of the distributed transaction is necessary if the received call flag is not a call flag indicating that a service is being called for the first time, determining whether a rollback of the distributed transaction is necessary if the call flag has been recorded, determining whether the call flag received last time matches the call flag received this time, and determining that a rollback of the distributed transaction is necessary if the call flag received last time does not match the call flag received this time; if a rollback of the distributed transaction is not required, recording the received call flag; When sending a new call request, a process of determining whether or not the list included in the determination information received together with the received call request includes identification information of the service execution system as a call destination; a call flag indicating that a call has been made, and sending the call request together with the call flag and the determination information composed of the received list, if the list includes identification information of the service execution system of the destination; and, if the list does not include identification information of the service execution system of the destination, registering identification information of the service executed by the service execution system of the destination in the stored list, and sending the call request together with the received call flag and the determination information composed of the list.
10. 8. The computer system of claim 7, the service execution system sets a generation of the service corresponding to the number of times the service is started at the time of starting the service; the service execution system that executes the service that is the starting point of the distributed transaction generates a generation of the distributed transaction as the determination information; A computer system characterized in that the service execution system that receives the call request determines whether or not rollback of the distributed transaction is necessary based on a comparison process between the generation of the service and the generation of the distributed transaction.
11. 11. The computer system of claim 10, a load balancing unit that controls the invocation of the service in the distributed transaction based on route information; The load distribution unit managing the route information and a generation of the distributed transaction in association with each other; when receiving the call request from the service execution system that executes the service that is the starting point of the distributed transaction, recording a generation of the distributed transaction included in the call request and the latest route information in association with each other; a call request generation unit that receives the call request and transmits the call request to the call destination;
12. 11. The computer system of claim 10, the service execution system includes a plurality of instances that execute the service; a load balancing unit that controls the invocation of the service in the distributed transaction; The load distribution unit Manage the association between the identification information of the instance and a generation range of routing control based on a hash distribution algorithm; generating a new association when a notification regarding an increase or decrease in the number of instances is received from the service execution system; A computer system characterized in that, when a call request is received from the service execution system that executes the service that is the starting point of the distributed transaction, the computer system identifies the range that includes the generation of the distributed transaction included in the call request, selects one from the identification information of the instances corresponding to the identified range based on the hash distribution algorithm, and controls the transfer of the call request.
13. A method for controlling distributed transactions in a computer system including a plurality of service execution systems that execute services that realize applications that execute distributed transactions, comprising the steps of: a first step in which at least one of the service execution systems generates determination information for determining whether or not the distributed transaction needs to be rolled back, and transmits the determination information to the other service execution systems; a second step in which the service execution system, having received the judgment information, uses the judgment information to judge whether or not rollback of the distributed transaction is necessary.
14. 14. A method for controlling a distributed transaction according to claim 13, comprising the steps of: the first step includes a step of the service execution system receiving a call request instructing execution of the service generating the determination information, The second step includes: the service execution system that executes the service that is the starting point of the distributed transaction acquires the determination information from the service execution system that executes the service related to the distributed transaction; a step in which the service execution system that executes the service that is the starting point of the distributed transaction determines whether or not rollback of the distributed transaction is necessary based on the determination information.
15. 14. A method for controlling a distributed transaction according to claim 13, comprising the steps of: The first step includes: a step of generating the determination information by the service execution system that executes the service that is the starting point of the distributed transaction; a step of the service execution system that executes the service that is the starting point of the distributed transaction transmitting a call request to another service execution system together with the determination information, the call request instructing the other service execution system to execute the service; The second step of the present invention is characterized in that it includes a step in which the service execution system that receives the call request determines whether or not rollback of the distributed transaction is necessary based on the judgment information.
Citation Information
Patent Citations
A system and method for supporting inline delegation of middle-tier transaction logs to a database.
JP2015514247A
Transaction participant registration with caveats
US20110246822A1
Methods for repairing a corrupted database to a new, correct state
US9830223B1
Exception handler for the upgrade of JAVA objects in a distributed system
WO2007113550A1