Recipe: converting concurrent DRAM indexes to persistent-memory indexes

Se Kwon Lee, Jayashree Mohan, Sanidhya Kashyap, Taesoo Kim, Vijay ChidambaramSOSP 2019 · DOI

Abstract

We present Recipe, a principled approach for converting concurrent DRAM indexes into crash-consistent indexes for persistent memory (PM). The main insight behind Recipe is that isolation provided by a certain class of concurrent in-memory indexes can be translated with small changes to crash-consistency when the same index is used in PM. We present a set of conditions that enable the identification of this class of DRAM indexes, and the actions to be taken to convert each index to be persistent. Based on these conditions and conversion actions, we modify five different DRAM indexes based on B+ trees, tries, radix trees, and hash tables to their crash-consistent PM counterparts. The effort involved in this conversion is minimal, requiring 30-200 lines of code. We evaluated the converted PM indexes on Intel DC Persistent Memory, and found that they outperform state-of-the-art, hand-crafted PM indexes in multi-threaded workloads by up-to 5.2x. For example, we built P-CLHT, our PM implementation of the CLHT hash table by modifying only 30 LOC. When running YCSB workloads, P-CLHT performs up to 2.4x better than Cacheline-Conscious Extendible Hashing (CCEH), the state-of-the-art PM hash table.

Introduction

Persistent Memory (PM), such as Intel’s Optane DC, offers the speed of DRAM with the durability of traditional storage. However, building data structures for PM is notoriously difficult due to the requirement of crash consistency. Developers must ensure that if the system loses power mid-update, the index remains uncorrupted. Currently, most PM indexes are built from scratch, a process that is complex and error-prone; the authors discovered that even "state-of-the-art" PM indexes like FAST & FAIR and CCEH contained bugs leading to data loss. RECIPE asks whether we can instead leverage decades of research into concurrent DRAM indexes by converting them to PM.

Methodology: The RECIPE Framework

The core insight of RECIPE is that isolation (managing concurrent threads) and crash consistency (managing power failure) are fundamentally related. If a concurrent index allows one thread to "fix" or "tolerate" an intermediate state left by another thread, that same logic can facilitate recovery after a crash. The authors categorize DRAM indexes into three conditions:

  1. Condition #1 (Single Atomic Store): Updates are made visible via a single atomic pointer swap. Conversion requires adding memory fences and cache line flushes after the store.
  2. Condition #2 (Writers Fix Inconsistencies): Threads use "helping" mechanisms to complete unfinished operations started by others. These are inherently crash-consistent and primarily require proper write-ordering to PM.
  3. Condition #3 (Writers Don't Fix Inconsistencies): Threads tolerate inconsistencies but don't fix them. For these, authors add a small "helper" function to the write path to detect and fix half-finished operations post-crash.
Figure 1: Implicit recovery through helping mechanisms where T2 completes an operation for a crashed T1.

To verify these conversions, the authors developed a testing methodology using the PIN tool to simulate crashes at every atomic step, ensuring no data loss occurs.

Key Insights and Results

By converting mature DRAM indexes like Masstree and ART, PM indexes inherit years of optimization for cache efficiency and concurrency. The conversion effort is remarkably low, often requiring less than 5% of the original codebase to be modified.

Table 1: Conversion effort and RECIPE conditions for various DRAM indexes.

Key performance results include:

  • Superior Performance: Converted indexes outperformed hand-crafted PM indexes by up to 5.2× in multi-threaded workloads.
  • Efficiency: P-CLHT performed up to 2.4× better than CCEH, the previous state-of-the-art PM hash table.
  • Scalability: Converted versions scale better than PM-specific designs that rely on global locks or heavy logging, as they inherit the multi-core optimizations of their DRAM predecessors.

Conclusion

RECIPE demonstrates that "lock-free" or "non-blocking" DRAM designs are naturally suited for PM because they are already architected to handle interrupted operations. While the approach requires non-blocking reads or specific concurrency controls, it provides a faster, more reliable path to high-performance PM indexes than building from scratch. Future work may involve automating the identification of these conditions and the insertion of persistence primitives.

Summary updated

BibTeX
@inproceedings{lee2019recipe,
  author = {Se Kwon Lee and Jayashree Mohan and Sanidhya Kashyap and Taesoo Kim and Vijay Chidambaram},
  title = {{Recipe: converting concurrent DRAM indexes to persistent-memory indexes}},
  booktitle = {SOSP},
  year = {2019},
  doi = {10.1145/3341301.3359635},
}
Figure