JP-7856374-B2 - Computer implementations, systems, and computer programs
Inventors
- ユエ,ワン
- ジンジン,ウェイ
- インチュン,グオ
- シャオ ジュン,ディン
- ジャン ナン,グオ
Assignees
- インターナショナル・ビジネス・マシーンズ・コーポレーション
Dates
- Publication Date
- 20260511
- Application Date
- 20220929
- Priority Date
- 20210930
Claims (19)
- A method implemented in a computer, One or more processors detect that at least two of the services within a transaction are executing and changing the value of the first global variable. One or more processors acquire tracking information indicating a first order in which at least two of the services change the value of the first global variable while the multiple services are running. The method, comprising: determining a rollback execution plan by one or more processors, at least in part, based on the tracking information, for a plurality of compensation services in response to the failure of the transaction, wherein the plurality of compensation services are configured to compensate each of the plurality of services, and the plurality of compensation services are executed by the one or more processors in accordance with the rollback execution plan.
- Determining the aforementioned rollback execution plan is The rollback execution plan is determined by one or more processors, at least in part, based on the tracking information, and a second order is specified in which at least two of the plurality of compensation services are executed to change the value of the first global variable, wherein the second order is the reverse of the first order. The method according to claim 1, including the method described in claim 1.
- Regarding the first of the two services mentioned above, The first service is divided into a first sequence of multiple service segments by one or more processors, where the first service segment in the first sequence of multiple service segments is executed and the value of the first global variable is changed, and the first or more processors determine a first compensation service from among the multiple compensation services based on the first sequence of multiple service segments. Here, the first compensation service includes the first sequence of a plurality of compensation service segments which are to be called independently to compensate for the first sequence of each of the plurality of service segments. The method according to claim 1.
- The first compensation service segment in the first sequence of multiple compensation service segments is determined to compensate the first service segment and to determine the rollback execution plan. Before the second service of the plurality of services, in response to tracking information indicating that the first service changes the value of the first global variable, This includes, after the execution of the compensation service segment of the second compensation service among the plurality of compensation services is completed, generating the rollback execution plan by one or more processors, specifying that the first compensation service segment of the first compensation service should be called, Here, the compensation service segment of the second compensation service is determined to compensate the service segment of the second service in which the value of the first global variable is changed. The method according to claim 3.
- The first service segment first changes the value of the first global variable, Here, dividing the first service means Identifying from the first service by one or more processors a second service segment which is executed after the first service segment to change the value of the first global variable a second time, and further dividing the first service by one or more processors into a first sequence of multiple service segments based on the location of the second service segment, where the first sequence of multiple service segments includes the second service segment. Includes, Here, the first compensation service is determined to further include a second compensation service segment to compensate the second service segment, wherein the second compensation service segment is invoked before the first compensation service segment. The method according to claim 4 .
- Determining the aforementioned rollback execution plan is In response to the tracking information further indicating that a third service among the plurality of services changes the value of the first global variable before the first service, After the execution of the first and second compensation service segments of the first compensation service is completed, a rollback execution plan is generated by one or more processors, further specifying that the compensation service segment of the third compensation service of the plurality of compensation services should be called. Here, the compensation service segment of the third compensation service is determined to compensate the service segment of the third service where the value of the first global variable is changed. The method according to claim 5 .
- Dividing the first service mentioned above means Identifying a third service segment from the first service to change the value of the second global variable, according to a decision that the first service and at least one further service from the plurality of services are performed to change the value of the second global variable, by one or more processors, and dividing the first service into a first sequence of service segments, further based on the position of the third service segment in the first service, where the first sequence of service segments includes the third service segment. Includes, Here, the first compensation service is determined to include a third compensation service segment in order to compensate the third service segment. The method according to claim 3.
- The tracking information further indicates a third sequence in which the first service and at least one further service change the value of the second global variable, where the rollback execution plan is determined. In response to a third sequence in which the first service changes the value of the second global variable, prior to the fourth service of at least one further service, The process includes, after the execution of the compensation service segment of the fourth compensation service among the plurality of compensation services is completed, generating the rollback execution plan by one or more processors to further specify that the third compensation service segment of the first compensation service should be called, Here, the compensation service segment of the fourth compensation service is determined to compensate the service segment of the fourth service where the value of the second global variable is changed. The method according to claim 7 .
- It is a system, A processing unit and a memory connected to the processing unit, the memory having a function for storing instructions, wherein when an instruction is executed by the processing unit, To detect that at least two of the multiple services within a transaction were executed to change the value of the first global variable, Obtaining tracking information indicating a first order in which at least two of the services change the value of the first global variable while the multiple services are running, The system performs an operation that, in response to the failure of the transaction, determines a rollback execution plan for a plurality of compensation services, at least in part, based on the tracking information, wherein the plurality of compensation services are configured to compensate each of the plurality of services, and ensures that the plurality of compensation services are executed in accordance with the rollback execution plan.
- Determining the aforementioned rollback execution plan is Determine the rollback execution plan based at least in part on the tracking information and specify a second order in which at least two of the plurality of compensation services are executed to change the value of the first global variable, wherein the second order is the reverse of the first order. The system according to claim 9 , including the following:
- The aforementioned instruction further states that, with respect to the first of the at least two services, The first service is divided into a first sequence of multiple service segments, wherein the first service segment in the first sequence of multiple service segments is executed, the value of the first global variable is changed, and the first compensation service is determined from among the multiple compensation services based on the first sequence of multiple service segments. Here, the first compensation service includes a first sequence of a plurality of compensation service segments which are to be called independently to compensate for the first sequence of each of the plurality of service segments. The system according to claim 9 .
- The first compensation service segment in the first sequence of multiple compensation service segments is determined to compensate the first service segment and to determine the rollback execution plan. Before the second service of the plurality of services, in response to tracking information indicating that the first service changes the value of the first global variable, This includes generating the rollback execution plan after the execution of the compensation service segment of the second compensation service among the plurality of compensation services is completed, specifying that the first compensation service segment of the first compensation service should be called. Here, the compensation service segment of the second compensation service is determined to compensate the service segment of the second service in which the value of the first global variable is changed. The system according to claim 11 .
- The first service segment first changes the value of the first global variable, Here, dividing the first service means Identifying from the first service a second service segment that is performed after the first service segment to change the value of the first global variable a second time, and further dividing the first service into a first sequence of multiple service segments based on the location of the second service segment, where the first sequence of multiple service segments includes the second service segment. Includes, Here, the first compensation service is determined to further include a second compensation service segment to compensate the second service segment, wherein the second compensation service segment is invoked before the first compensation service segment. The system according to claim 12 .
- Determining the aforementioned rollback execution plan is In response to the tracking information indicating that a third service among the plurality of services changes the value of the first global variable before the first service, This includes generating a rollback execution plan that specifies that after the execution of the first and second compensation service segments of the first compensation service is completed, the compensation service segment of the third compensation service of the plurality of compensation services should be invoked, Here, the compensation service segment of the third compensation service is determined to further compensate the service segment of the third service in which the value of the first global variable is changed. The system according to claim 13 .
- Dividing the first service mentioned above means Identifying a third service segment from the first service to modify the value of the second global variable, in accordance with a decision that the first service and at least one further service from the plurality of services are performed to modify the value of the second global variable, and dividing the first service into a first sequence of plurality of service segments by one or more processors, further based on the position of the third service segment in the first service, wherein the first sequence of plurality of service segments includes the third service segment. Includes, Here, the first compensation service is determined to include a third compensation service segment in order to compensate the third service segment. The system according to claim 11 .
- The tracking information further indicates a third sequence in which the first service and at least one further service change the value of the second global variable, where the rollback execution plan is determined. In response to a third sequence in which the first service changes the value of the second global variable, prior to the fourth service of at least one further service, This includes generating the rollback execution plan after the execution of the compensation service segment of the fourth compensation service among the plurality of compensation services has been completed, and further specifying that the third compensation service segment of the first compensation service should be invoked. Here, the compensation service segment of the fourth compensation service is determined to compensate the service segment of the fourth service where the value of the second global variable is changed. The system according to claim 15 .
- It is a computer program, To detect that at least two of the multiple services within a transaction are executing and changing the value of the first global variable, Obtaining tracking information indicating a first order in which at least two of the services change the value of the first global variable while the multiple services are running, A computer program causing an electronic device to perform a method including, in response to a transaction failure, determining a rollback execution plan for a plurality of compensation services, at least in part, based on the tracking information, wherein the plurality of compensation services are configured to compensate each of the plurality of services, and causing the plurality of compensation services to be executed in accordance with the rollback execution plan.
- Determining the aforementioned rollback execution plan is Determine the rollback execution plan based at least in part on the tracking information and specify a second order in which at least two of the plurality of compensation services are executed to change the value of the first global variable, wherein the second order is the reverse of the first order. including, The computer program according to claim 17 .
- Regarding the first of the two services mentioned above, Dividing the first service into a first sequence of multiple service segments, where the first service segment in the first sequence of multiple service segments is executed, and the value of the first global variable is changed, and Based on the first sequence of multiple service segments, a first compensation service is determined from among the multiple compensation services. This further includes causing the electronic device to perform the following: Here, the first compensation service includes the first sequence of a plurality of compensation service segments which are to be called independently to compensate for the first sequence of each of the plurality of service segments. The computer program according to claim 17.
Description
This disclosure relates to service rollback due to changes in global variables. This disclosure generally relates to data integrity techniques for distributed computing, and more specifically, to data rollback for global variables in multi-service configurations. It is becoming increasingly common for service implementations in distributed systems to involve multiple serial, parallel, or combination-of-the-same calls to other services. Transactions can be designed to include multiple services, and serial, parallel, or combination-of-the-same calls are possible within those services. These service calls may succeed, fail due to errors, or enter an unknown state due to timeouts; in this case, the transaction may succeed or fail. In distributed systems, transactions spanning multiple services require mechanisms to ensure data consistency across services, particularly in the event of transaction failure. Typically, a rollback mechanism for managing failures provides rollback compensation services to each service in the transaction to ensure consistency and accuracy across the entire service of the transaction. Figure 1 shows a cloud computing node according to several embodiments of this disclosure.Figure 2 shows a cloud computing environment according to several embodiments of this disclosure.Figure 3 shows an abstraction model layer according to several embodiments of this disclosure.Figure 4A shows several examples of transaction execution and rollback with the same global variables.Figure 4B shows several examples of transaction execution and rollback with the same global variables.Figure 5 shows a block diagram of a computing architecture according to some embodiments of the present disclosure.Figure 6A shows an exemplary division of a service according to some embodiments of the present disclosure.Figure 6B shows an exemplary correlation between multiple service segments and multiple compensation service segments according to some embodiments of the present disclosure.Figure 7 shows an example of a compensation service generated for a service according to some embodiments of the present disclosure.Figure 8 shows an exemplary correlation between multiple service segments and multiple compensation service segments according to some embodiments of the present disclosure.Figure 9 shows an exemplary execution of a transactional service according to some embodiments of the present disclosure.Figure 10 shows examples of tracking information according to some embodiments of this disclosure: "METHOD ENTER"; "GLOBAL_VAR_X CHANGED"Figure 11 shows an example of a rollback execution plan according to some embodiments of the present disclosure.Figure 12 shows an exemplary execution of a compensation service rollback for a transaction, according to some embodiments of the present disclosure.Figure 13A shows an exemplary correlation between multiple service segments and multiple compensation service segments according to some embodiments of the present disclosure.Figure 13B shows an exemplary execution of a transactional service according to some other embodiments of the present disclosure.Figure 13C shows an example of a rollback execution plan according to some other embodiments of this disclosure.Figure 13D shows an exemplary rollback execution of a compensation service for a transaction, according to some other embodiments of this disclosure.Figure 14A shows an exemplary correlation between multiple service segments and multiple compensation service segments, according to some further embodiments of the present disclosure.Figure 14B shows an exemplary execution of a transaction service according to some further embodiments of this disclosure.Figure 14C shows an example of a rollback execution plan according to some further embodiments of the present disclosure.Figure 14D shows an exemplary rollback execution of a compensation service for a transaction, according to some further embodiments of the present disclosure.Figure 15 shows a flowchart of an exemplary method according to some embodiments of the present disclosure. Several embodiments are described in more detail with reference to the accompanying drawings illustrating embodiments of this disclosure. However, this disclosure can be implemented in a variety of ways and should therefore not be construed as being limited to the embodiments disclosed herein. While this disclosure includes a detailed description of cloud computing, it should be understood that the implementation of the teachings enumerated herein is not limited to cloud computing environments. Rather, embodiments of this disclosure can be implemented in combination with any other type of computing environment currently known or to be developed later. Cloud computing is a service delivery model that enables convenient on-demand network access to a shared pool of configurable computing resources (e.g., networks, network bandwidth, servers, processing, memory, storage, applications, virtual machines, a