Database Node Restart Segment for Fast Failover Recovery
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing database systems face inefficiencies in restarting a database node, particularly when transitioning from a secondary to a primary role, as the process of rebuilding the in-memory cache can take significant time, potentially violating service-level agreements regarding downtime.
Innovation Solution
The system preserves the in-memory cache and database state information by allocating a restart segment during the restart operation, allowing the database node to quickly transition to a primary role by replaying log records from a stored stop position and maintaining database state information.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the database node performs a traditional restart operation to transition from secondary to primary role, then the node can be restarted, but the in-memory cache must be rebuilt which takes significant time and may violate service-level agreements
Solution Approach 1:
The system performs preliminary actions by preserving the in-memory cache data in a persistent storage location (such as a memory-mapped file or disk-based cache) before the restart operation. When the database node needs to restart, the cached data is already available and can be quickly reloaded into memory, eliminating the time-consuming cache rebuild process while ensuring service-level agreement compliance
Solution Approach 2:
The system creates a copy of the in-memory cache data and stores it in a persistent format that can be quickly restored. This copy mechanism allows the database node to recover its cache state without reconstructing it from scratch, significantly reducing restart time while maintaining data integrity and service availability commitments
2Loss of time
If the database node preserves in-memory cache during restart, then restart time is reduced, but additional memory management complexity is introduced
Solution Approach 1:
The memory management system is segmented into distinct regions: a primary in-memory cache for active data, a persistent storage area for cache preservation, and a restart segment for recovery operations. This segmentation allows each component to be managed independently with specialized algorithms, reducing overall system complexity while enabling fast restart through the dedicated restart segment
Solution Approach 2:
An intermediary memory-mapped file or disk-based cache structure serves as a bridge between the volatile in-memory cache and persistent storage. This intermediary layer automatically handles the preservation and restoration of cache data during restart operations, simplifying the memory management complexity by providing a standardized interface that abstracts the underlying storage mechanics
3Quantity of substance
If the database node deallocates memory segments during restart, then memory is freed for other uses, but the cache must be completely rebuilt losing previous state information
Solution Approach 1:
The system selectively discards and recovers memory segments during restart operations. Instead of deallocating all cache memory, the system preserves critical cache data in a restart segment or persistent storage, then recovers this data after restart. This approach frees up sufficient memory for other uses while maintaining essential cache state information, balancing memory availability with information preservation
Data Source
AI summary
Techniques are disclosed relating to restarting a database node. A database node may allocate memory segments that include a restart segment for storing data records. The database node may spawn processes to read a log and replay log records of the log to update the restart segment to store data records. The database node may determine to perform a restart operation to transition from a first mode to a second mode. Performing the restart operation may include ceasing reading the log at a stop position and storing, based on the stop position, database state information that enables the processes to resume reading the log from the stop position. The database node may further deallocate the memory segments except for the restart segment and terminate the processes. After performing the restart operation, the database node may spawn the processes, which may resume reading the log based on the database state information.


