Saga Transaction Control With Early Lock Release and Rollback Order

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Microservices in distributed transactions face challenges in ensuring consistency and optimizing lock periods while using the Saga pattern and lock early release, leading to issues with serializability, data consistency, and recovery possibilities.

Innovation Solution

An information processing system with a transaction controller that manages transactions in a predetermined order, activates a lock function for each transaction, and executes compensation transactions in the opposite order to ensure consistency and recoverability, using a Saga pattern and lock early release.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If lock early release is used to shorten lock period, then productivity is improved, but reliability deteriorates due to loss of serializability guarantee

Engineering Contradiction:
Improvelock periodVSAvoidserializability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs preliminary actions by executing the compensation transaction preparation and setting settlement waiting information before the actual commit settlement. This allows the lock to be released early while ensuring that if rollback is needed, the compensation can be executed properly to maintain serializability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The invention introduces an intermediary mechanism through the service proxy that mediates between the transaction manager and the service. The service proxy holds settlement waiting information and controls the timing of lock release and compensation execution, acting as a buffer that enables early lock release while preserving serializability through coordinated compensation transactions.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Manufacturing precision

If lock function is activated before calling external service unit, then manufacturing precision is improved through serializability control, but loss of time increases due to waiting for lock acquisition

Engineering Contradiction:
Improveserializability controlVSAvoidlock acquisition waiting time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The lock function is activated in advance before the external service unit is called, ensuring that the resource is reserved and serializability is maintained. This preliminary locking action prevents other transactions from accessing the resource until the current transaction completes or is rolled back via compensation.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The lock holding period is made dynamic rather than fixed. The lock is released at the optimal moment - after the external service execution completes but before the commit settlement is finalized. This dynamic timing minimizes lock acquisition waiting time for subsequent transactions while preserving serializability through the compensation mechanism.

Inventive Principle:
Principle #15Dynamics

3Reliability

If compensation transactions are executed in opposite order, then reliability is improved through proper rollback, but device complexity increases due to additional transaction management

Engineering Contradiction:
Improverollback consistencyVSAvoidtransaction management
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

Compensation transactions are executed in the opposite order of the original transaction sequence. If transactions T1, T2, T3 were executed in that order, compensation executes as T3', T2', T1'. This inversion ensures that dependencies are properly reversed - later transactions that depended on earlier ones are compensated first, maintaining logical consistency and reliability.

Inventive Principle:
Principle #13The other way round (Inversion)

Solution Approach 2:

The service proxy acts as an intermediary that manages the complexity of compensation transaction execution. It stores execution order information, determines the correct compensation sequence, and coordinates the rollback process. This intermediary absorbs the complexity of managing inverted transaction orders, making the system more reliable without requiring complex changes to the core transaction logic.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20250355727A1Information processing system, information processing device, and information processing method
Publication Date: 2025.11.20 HITACHI LTD
  • US20250355727A1 patent drawing
  • US20250355727A1 patent drawing
  • US20250355727A1 patent drawing

AI summary

Provided is a technique capable of executing optimal control in distributed transactions using a Saga pattern and lock early release. An information processing system of the present invention includes: a plurality of transaction managers that manages a respective plurality of transactions to be executed in a predetermined order for an external service unit; and a transaction controller that has functions of: calling the external service unit to execute the plurality of transactions in a predetermined order; executing a plurality of compensation transactions in order opposite to the predetermined order when an execution result of the plurality of transactions is failure; activating a lock function before calling the external service unit when each of the plurality of transactions is executed; and releasing the lock function after a transaction to be processed is executed and before an execution result of the transaction to be processed is output.