Lock-Free Read Method Using Commit Scope Identifiers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current data store systems face issues with deadlocks and timeouts due to lock-based read operations, particularly under 'read committed' and 'repeatable read' isolation levels, which can lead to performance degradation and complexity with multiple versions of data.

Innovation Solution

Implementing a lock-free read method using a last committed log sequence number and transaction flag within lock data structures, allowing for exclusive locking during write transactions and returning the last committed version of a record during concurrent read and write operations, thereby reducing the need for multiple versions and minimizing lock duration.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If lock-based read operations are used under 'read committed' isolation level, then data consistency is maintained, but deadlocks occur due to lock contention

Engineering Contradiction:
Improvedata consistencyVSAvoiddeadlocks
Core Design Contradiction:
ReliabilityVSObject-generated harmful factors

Solution Approach 1:

The patent segments the locking mechanism by introducing version identifiers (commit scopes) that divide the locking granularity. Instead of locking entire records, the system locks specific versions of records identified by commit scopes, allowing concurrent access to different versions and eliminating deadlocks while maintaining data consistency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces commit scope identifiers as intermediaries between read operations and actual data access. These identifiers act as mediators that enable reads to access specific historical versions of data without requiring locks on current records, thus preventing deadlocks while ensuring consistent reads.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If lock-based read operations are used under 'repeatable read' isolation level, then data consistency is maintained, but timeouts occur due to prolonged lock holding

Engineering Contradiction:
Improvedata consistencyVSAvoidtimeout
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent performs preliminary actions by capturing and storing commit scope identifiers at the time of data modification. This allows read operations to directly access the correct historical version of data without needing to hold locks for extended periods, eliminating timeouts while maintaining repeatable read consistency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates copies of data versions identified by commit scopes, allowing read operations to access these copied historical versions without locking the current data. This eliminates the need for prolonged lock holding and prevents timeouts while ensuring consistent repeated reads.

Inventive Principle:
Principle #26Copying

3Object-generated harmful factors

If snapshot isolation level is used to prevent deadlocks, then read operations become lock-free, but system complexity increases due to multiple data versions

Engineering Contradiction:
ImprovedeadlocksVSAvoidmultiple data versions
Core Design Contradiction:
Object-generated harmful factorsVSDevice complexity

Solution Approach 1:

The patent introduces dynamic version management where commit scopes are created and destroyed based on transaction lifecycles. Instead of maintaining all historical versions indefinitely, the system dynamically manages version storage, keeping only the versions necessary for active transactions and their isolation requirements, thus reducing overall system complexity.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the parameter of version identification from traditional snapshot identifiers to commit scope identifiers that are tied to transaction contexts. This parameter change enables more efficient version management and retrieval, reducing the complexity of managing multiple data versions by linking them directly to transactional contexts.

Inventive Principle:
Principle #35Parameter changes

4Reliability

If multiple concurrent transactions execute under lock-based isolation levels, then data consistency is maintained, but system performance degrades due to lock contention

Engineering Contradiction:
Improvedata consistencyVSAvoidsystem performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the data access mechanism by introducing commit scope-based version identification, allowing multiple concurrent transactions to access different historical versions of data simultaneously without lock contention. This segmentation enables parallel execution of transactions while maintaining data consistency, thus improving system performance.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent uses commit scope identifiers as intermediaries that enable concurrent transactions to access data without direct lock interactions. These intermediaries allow transactions to independently access specific data versions, eliminating lock contention and improving throughput while maintaining consistency.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS7548919B2Computer program product for conducting a lock free read
Publication Date: 2009.06.16 SAP SE
  • US7548919B2 patent drawing
  • US7548919B2 patent drawing
  • US7548919B2 patent drawing

AI summary

The present invention expounds upon the ANSI “read committed” isolation level by allowing readers to read committed data without waiting for a concurrent writer to the data to finish. The method returns a last committed version of the data as it existed prior to changes made by the concurrent writer. Only two versions of any data record are required to be stored in the record data store, the last committed version and the current version. The last committed version may be generated from an undo log record. Locating the appropriate undo log record may be accomplished by storing a log sequence number in a lock data structure associated with the requested data record. A transaction flag may also stored in the lock data structure to facilitate generating the last committed version. The method may also utilize one or more locks to detect a concurrent writer to the requested data.