LSM Database Corruption Repair via Transaction Logs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Multi-tenant database systems face significant challenges in efficiently addressing logical and physical corruption, which can lead to catastrophic failures, affecting numerous users and causing business disruptions, due to the complexity of identifying and correcting corruption without service outages.

Innovation Solution

The implementation of Log-Structured Merge-Tree (LSM) databases, which store transactions in immutable extents, allow for the recording of transaction history and correction of corruption during live operations by replaying transactions or generating compensating transactions, enabling continuous database availability.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If conventional database systems detect data corruption, then data integrity is protected by crashing the database, but system availability and continuity are severely impacted

Engineering Contradiction:
Improvedata integrityVSAvoidsystem availability
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the database into multiple independent components including LSM trees, snapshots, and WAL logs. Each component can be independently validated and repaired, allowing corruption in one segment to be fixed without affecting the entire database system, thus maintaining availability while ensuring integrity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary validation actions by maintaining multiple snapshots and WAL logs that record the state of the database at different points in time. When corruption is detected, these pre-recorded states enable immediate rollback or repair without crashing, as the recovery mechanisms are already in place and validated.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If the database crashes upon detecting corruption, then corrupted data is prevented from being served, but service outages affect numerous users and cause business disruptions

Engineering Contradiction:
Improvedata integrityVSAvoidservice outage duration
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The database system performs self-diagnosis and self-repair through automated corruption detection mechanisms that validate LSM trees, snapshots, and WAL logs. When corruption is detected, the system automatically initiates repair procedures using backup snapshots and transaction logs, eliminating the need for manual intervention and avoiding service outages.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

When corruption is detected in specific database segments, the system discards only the corrupted portions while recovering and continuing to serve data from valid segments, snapshots, and WAL logs. This selective discarding and recovery approach prevents complete service outage while maintaining data integrity for unaffected data.

Inventive Principle:
Principle #34Discarding and recovering

3Reliability

If manual corruption rectification is performed, then data integrity can be restored, but the process requires skilled experts and causes additional delays

Engineering Contradiction:
Improvedata integrityVSAvoidcorrection process complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system implements automated corruption detection and repair mechanisms that validate database integrity through checksums, cryptographic hashes, and consistency checks on LSM trees, snapshots, and WAL logs. When corruption is detected, the system automatically repairs it using backup copies and transaction logs, eliminating the need for skilled database experts and reducing correction time.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The database system continuously monitors its own integrity through feedback mechanisms that validate data structures and detect corruption. This automated feedback loop enables the system to identify and correct issues before they impact service, reducing both the complexity and time required for corruption rectification.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS9875164B2Systems, methods, and apparatuses for fixing logical or physical corruption in databases using LSM trees
Publication Date: 2018.01.23 SALESFORCE INC
  • US9875164B2 patent drawing
  • US9875164B2 patent drawing
  • US9875164B2 patent drawing

AI summary

In accordance with disclosed embodiments, there are provided methods, systems, and apparatuses for fixing logical or physical corruption in databases using LSM trees including, for example, means for storing records in a LSM database at the host organization; processing transactions to the LSM database by writing the transactions into immutable extents for subsequent merge into the LSM database; recording a history of the transactions in a log; identifying corruption in at least one of the records of the LSM database represented within the immutable extents prior to use of the immutable extents in the LSM database; and correcting the identified corruption to the at least one of the records of the LSM database based at least in part on the recorded history of the transactions in the log during live operation of the LSM database. Other related embodiments are disclosed.