Database Lock Wait Tracing for Culprit Process Identification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database systems lack a sufficient mechanism to identify database processes that cause unreasonably long lock wait times, leading to inefficient operation and delayed transactions.

Innovation Solution

Implement lock wait tracing techniques that collect and analyze information on lock acquisition and release timestamps to identify 'culprit' processes that block 'victim' processes for excessive periods, allowing for the creation of trace records that can be used to reconstruct wait queue timelines and address issues.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If lock wait tracing is implemented to identify culprit processes, then the ability to identify problematic processes is improved, but the system complexity increases due to additional tracing mechanisms

Engineering Contradiction:
Improveidentification accuracy of culprit processesVSAvoidtracing mechanism complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The tracing mechanism leverages existing database infrastructure components (lock manager, wait queues, process lists) to collect and analyze lock wait information. The system uses its own existing data structures and processes to generate trace records, eliminating the need for separate external monitoring systems and reducing overall complexity.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The trace record generation mechanism is integrated into the existing lock management system, allowing the same infrastructure to serve both lock control functions and diagnostic tracing functions. This multi-functionality reduces the need for separate specialized components.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Loss of information

If detailed trace records are collected for all lock operations, then the information completeness is improved, but the data processing overhead increases

Engineering Contradiction:
Improvelock wait information completenessVSAvoiddata processing overhead
Core Design Contradiction:
Loss of informationVSLoss of energy

Solution Approach 1:

The tracing mechanism applies selective recording based on local conditions: trace records are generated specifically when lock conflicts occur and processes enter wait queues. Not all lock operations are traced equally - only those that represent problematic situations requiring analysis. This selective approach maintains information completeness for diagnostic purposes while reducing overall data processing overhead.

Inventive Principle:
Principle #3Local quality

3Speed

If the system monitors and analyzes lock wait times in real-time, then the response time to identify issues is improved, but the processing resources consumed increase

Engineering Contradiction:
Improveissue identification speedVSAvoidprocessing resource consumption
Core Design Contradiction:
SpeedVSUse of energy by moving object

Solution Approach 1:

The system performs preliminary actions by maintaining process lists and lock wait queues that are updated in real-time as part of normal lock management operations. This preliminary data collection and organization enables rapid issue identification when needed, as the foundational data structures are already in place and updated continuously, eliminating the need for separate real-time monitoring operations.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11698898B2Lock wait tracing
Publication Date: 2023.07.11 SALESFORCE INC
  • US11698898B2 patent drawing
  • US11698898B2 patent drawing
  • US11698898B2 patent drawing

AI summary

Techniques are disclosed relating to lock wait tracing. A computer system may operate a database that includes a lockable object. The computer may maintain a lock wait queue that stores an indication of processes waiting to acquire a lock on the lockable object. The computer system may store trace records for those processes that, upon releasing a respective lock on the lockable object when another process is waiting in the lock wait queue, have been in contention for the respective lock for over a threshold amount of time. The computer system may present ones of the trace records that identify a timeline that is usable to determine a set of processes that contributed to a delay in a process acquiring a lock on the lockable object.