Shard-Aware Index Message Routing to Reduce Commit Blocking
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional index pipelines distribute index messages randomly among message queues, leading to blocking and reduced throughput due to shards being in a commit phase or operating at varying speeds.
Innovation Solution
Implement a shard-aware data partitioning method using a common mapping scheme that assigns index messages to specific shards based on hash ranges, ensuring efficient distribution and reducing delays.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If index messages are distributed randomly among message queues, then the distribution is simple to implement, but blocking and reduced throughput occur during shard updates
Solution Approach 1:
The patent segments the index message distribution by creating dedicated message queues for each shard instead of a single shared queue. Each queue is assigned to specific shards based on a mapping relationship, allowing parallel processing without blocking. This segmentation resolves the contradiction by maintaining simple queue management while eliminating throughput bottlenecks caused by random distribution.
Solution Approach 2:
The patent applies local quality by assigning different message queues to different shards based on their specific characteristics and current state. The mapping between queues and shards creates localized relationships where each queue is optimized for its target shard, improving overall system throughput while maintaining manageable complexity through structured local assignments.
2Speed
If multiple updaters send index messages to all shards in parallel, then update speed increases, but blocking occurs when shards are in commit phase
Solution Approach 1:
The patent segments the updater workload by assigning each updater to specific message queues and their corresponding target shards. Instead of having updaters send messages to all shards, each updater is responsible for a subset of queues and shards, enabling parallel processing without blocking. This maintains high update speed while ensuring reliability by avoiding conflicts during shard commit phases.
Solution Approach 2:
The patent introduces message queues as intermediary components between updaters and shards. These queues act as buffers that decouple the updater from the shard, allowing updaters to send messages asynchronously without being blocked by shard commit phases. This intermediary mechanism preserves both update speed and reliability.
3Productivity
If shards operate at varying speeds, then system flexibility is maintained, but overall throughput is adversely impacted by slower shards
Solution Approach 1:
The patent segments the shard processing workload by creating dedicated message queues for each shard, allowing faster shards to process their queues more quickly while slower shards process at their own pace. This segmentation eliminates the bottleneck effect where slower shards hold up the entire system, improving overall throughput while maintaining adaptability to individual shard performance characteristics.
Solution Approach 2:
The patent ensures continuous useful action by having multiple updaters work on different message queues simultaneously. While one shard may be slower, other updaters continue processing messages for faster shards without interruption. This continuous parallel processing maintains high overall throughput despite variations in individual shard speeds.
Data Source
AI summary
A method can include determining a common mapping scheme for message queues and shards for an index message to be committed to the shards. The common mapping scheme can include a respective shard hash range for each shard, and a mapping function between the message queues and the shards. The method further can include determining a message hash value for the index message. Additionally, the method can include determining a target shard based on the message hash value and the respective shard hash range for each shard. The method also can include determining an intermediate message queue based on the message hash value and the mapping function. Moreover, the method can include storing the index message to the intermediate message queue. The method further can include causing the index message stored in the intermediate message queue to be committed to the target shard. Other embodiments are disclosed.


