Database Partition State Synchronization Using Compare-and-Swap
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for synchronizing partition states in database systems often rely on synchronization variables like mutexes, which can cause performance degradation in processes waiting to access them.
Innovation Solution
Implement multilevel synchronization by using a mutex for non-active partitions and a compare-and-swap instruction for active partitions to manage access and state changes efficiently, ensuring concurrent access control and reducing wait times.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a mutex synchronization variable is used to synchronize partition states, then reliability of partition state synchronization is improved, but productivity of processes waiting to access the partition deteriorates
Solution Approach 1:
The patent divides the synchronization mechanism into two segments: mutex for non-active partitions and compare-and-swap for active partitions. This segmentation allows different synchronization strategies to be applied based on partition state, improving overall system performance while maintaining reliability.
Solution Approach 2:
The patent applies different synchronization qualities to different partition states: strong mutual exclusion (mutex) for non-active partitions and lighter atomic operations (compare-and-swap) for active partitions. This local differentiation optimizes performance for the common case of accessing active partitions while maintaining reliability for state changes.
2Reliability
If a mutex is used for all partition access, then reliability of state change synchronization is improved, but loss of time in waiting for access increases
Solution Approach 1:
The patent changes the synchronization parameter based on partition state. For active partitions, it uses compare-and-swap with an active flag, while for non-active partitions, it uses mutex. This parameter change reduces wait time for active partitions while maintaining synchronization reliability for state changes.
Solution Approach 2:
The patent performs preliminary action by setting the active flag before allowing compare-and-swap operations. This preliminary marking of active partitions allows processes to quickly identify and access active partitions without acquiring mutex, reducing wait time while maintaining reliability.
Data Source
AI summary
Disclosed herein are system, method, and computer program product embodiments for multilevel synchronization of database table partition states. An embodiment operates by retrieving a partition from a partition lookup structure and determining whether the partition is in an active state. Based on a determination that the partition is in the active state an embodiment increments a counter associated with the partition using a compare-and-swap instruction accesses the partition.


