Home / Companies / MongoDB / Blog / Post Details
Content Deep Dive

Breaking the WiredTiger Logjam: The Wait-Free Solution (2/2)

Blog post from MongoDB

Post Details
Company
Date Published
Author
MongoDB
Word Count
1,706
Language
English
Hacker News Points
-
Summary

The WiredTiger logjam was resolved by Bruce Lucas's wait-free solution, which eliminates the need for threads to wait before copying their payloads. This is achieved by using a single register to multiplex a slot's state along with bookkeeping about joined and released bytes, allowing threads to write into the slot as soon as they receive their write offset from their join operation. The new implementation uses masking and bit-shifting to perform joins and releases atomically, without compromising any other workloads or introducing a "leader" thread. This solution has been successfully integrated into the WiredTiger storage engine in MongoDB, resulting in nearly tripled performance of the journal algorithm and almost entirely eliminated negative scaling at high thread counts.