Abstract
Modern memory-optimized indexes often use optimistic locks for concurrent accesses. Read operations can proceed optimistically without taking the lock, greatly improving performance on multicore CPUs. But this is at the cost of robustness against contention where many threads contend on a small set of locks, causing excessive cacheline invalidation, interconnect traffic and eventually performance collapse. Yet existing solutions often sacrifice desired properties such as compact 8-byte lock size and fairness among lock requesters.
This paper presents optimistic queuing lock (OptiQL), a new optimistic lock for database indexing to solve this problem. OptiQL extends the classic MCS lock---a fair, compact and robust mutual exclusion lock---with optimistic read capabilities for index workloads to achieve both robustness and high performance while maintaining various desirable properties. Evaluation using memory-optimized B+-trees on a 40-core, dual-socket server shows that OptiQL matches existing optimistic locks for read operations, while avoiding performance collapse under high contention.
- Adnan Alhomssi and Viktor Leis. 2021. Contention and Space Management in B-Trees. In Conference on Innovative Data Systems Research (CIDR 2021).Google Scholar
- T.E. Anderson. 1990. The performance of spin lock alternatives for shared-money multiprocessors. IEEE Transactions on Parallel and Distributed Systems, Vol. 1, 1 (1990), 6--16.Google ScholarDigital Library
- Joy Arulraj, Justin J. Levandoski, Umar Farooq Minhas, and Per-Åke Larson. 2018. BzTree: A High-Performance Latch-free Range Index for Non-Volatile Memory. PVLDB, Vol. 11, 5 (2018), 553--565.Google Scholar
- R. Bayer and M. Schkolnick. 1977. Concurrency of Operations on B-Trees. Acta Inf., Vol. 9, 1 (mar 1977), 1--21.Google ScholarDigital Library
- Robert Binna, Eva Zangerle, Martin Pichl, Günther Specht, and Viktor Leis. 2018. HOT: A Height Optimized Trie Index for Main-Memory Database Systems. In Proceedings of the 2018 International Conference on Management of Data (SIGMOD '18). 521--534.Google ScholarDigital Library
- Jan Böttcher, Viktor Leis, Jana Giceva, Thomas Neumann, and Alfons Kemper. 2020. Scalable and Robust Latches for Database Systems. In Proceedings of the 16th International Workshop on Data Management on New Hardware (DaMoN '20). Article 2, 8 pages.Google ScholarDigital Library
- Sang K. Cha, Sangyong Hwang, Kihong Kim, and Keunjoo Kwon. 2001. Cache-Conscious Concurrency Control of Main-Memory Indexes on Shared-Memory Multiprocessor Systems. In Proceedings of the 27th International Conference on Very Large Data Bases (VLDB '01). 181--190.Google ScholarDigital Library
- cppreference.com. 2022. std::shared_mutex. https://en.cppreference.com/w/cpp/thread/shared_mutex.Google Scholar
- Travis S. Craig. 1993. Building FIFO and Priority-Queuing Spin Locks from Atomic Swap. University of Washington Technical Report 93-02-02 (1993).Google Scholar
- Cristian Diaconu, Craig Freedman, Erik Ismert, Per-Ake Larson, Pravin Mittal, Ryan Stonecipher, Nitin Verma, and Mike Zwilling. 2013. Hekaton: SQL Server's Memory-Optimized OLTP Engine. In Proceedings of the 2013 ACM SIGMOD International Conference on Management of Data (SIGMOD '13). 1243--1254.Google ScholarDigital Library
- Dave Dice and Alex Kogan. 2019. Compact NUMA-Aware Locks. In Proceedings of the Fourteenth EuroSys Conference 2019 (EuroSys '19). Article 12, 15 pages.Google ScholarDigital Library
- Dave Dice and Alex Kogan. 2020. Fissile Locks. In Networked Systems: 8th International Conference, NETYS 2020, Marrakech, Morocco, June 3--5, 2020, Proceedings. 192--208.Google Scholar
- David Dice, Virendra J. Marathe, and Nir Shavit. 2012. Lock Cohorting: A General Technique for Designing NUMA Locks. In Proceedings of the 17th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '12). 247--256.Google ScholarDigital Library
- Jialin Ding, Umar Farooq Minhas, Jia Yu, Chi Wang, Jaeyoung Do, Yinan Li, Hantian Zhang, Badrish Chandramouli, Johannes Gehrke, Donald Kossmann, David Lomet, and Tim Kraska. 2020. ALEX: An Updatable Adaptive Learned Index. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data (SIGMOD '20). 969--984.Google ScholarDigital Library
- Jose M. Faleiro and Daniel J. Abadi. 2017. Latch-free Synchronization in Database Systems: Silver Bullet or Fool's Gold?. In 8th Biennial Conference on Innovative Data Systems Research, CIDR 2017, Chaminade, CA, USA, January 8--11, 2017, Online Proceedings. 9.Google Scholar
- Goetz Graefe. 2010. A Survey of B-Tree Locking Techniques. ACM Trans. Database Syst., Vol. 35, 3, Article 16 (jul 2010), 26 pages.Google ScholarDigital Library
- Jim Gray, Prakash Sundaresan, Susanne Englert, Ken Baclawski, and Peter J. Weinberger. 1994. Quickly Generating Billion-Record Synthetic Databases. In Proceedings of the 1994 ACM SIGMOD International Conference on Management of Data (SIGMOD '94). 243--252.Google Scholar
- Rachid Guerraoui and Vasileios Trigonakis. 2016. Optimistic Concurrency with OPTIK. In Proceedings of the 21st ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '16). Article 18, 12 pages.Google ScholarDigital Library
- Joseph M. Hellerstein, Michael Stonebraker, and James Hamilton. 2007. Architecture of a Database System. Found. Trends Databases, Vol. 1, 2 (feb 2007), 141--259.Google ScholarDigital Library
- Maurice Herlihy and Nir Shavit. 2012. The Art of Multiprocessor Programming, Revised Reprint 1st ed.).Google ScholarDigital Library
- IBM. 1983. IBM System/370 Extended Architecture, Principles of Operation. IBM Publication No. SA22--7085.Google Scholar
- Intel Corporation. 2021. Intel 64 and IA-32 Architectures Software Developer's Manual. (2021). https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.htmlGoogle Scholar
- Kangnyeon Kim, Tianzheng Wang, Ryan Johnson, and Ippokratis Pandis. 2016. ERMIA: Fast memory-optimized database system for heterogeneous workloads. In Proceedings of the 2016 International Conference on Management of Data. 1675--1687.Google ScholarDigital Library
- Hideaki Kimura. 2015. FOEDUS: OLTP Engine for a Thousand Cores and NVRAM. In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data (SIGMOD '15). 691--706.Google ScholarDigital Library
- Philip L. Lehman and s. Bing Yao. 1981. Efficient Locking for Concurrent Operations on B-Trees. ACM Trans. Database Syst., Vol. 6, 4 (dec 1981), 650--670.Google ScholarDigital Library
- Viktor Leis, Michael Haubenschild, and Thomas Neumann. 2019. Optimistic Lock Coupling: A Scalable and Efficient General-Purpose Synchronization Method. IEEE Data Eng. Bull., Vol. 42 (2019), 73--84.Google Scholar
- Viktor Leis, Alfons Kemper, and Thomas Neumann. 2013. The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases. In Proceedings of the 2013 IEEE International Conference on Data Engineering (ICDE '13). 38--49.Google ScholarDigital Library
- Viktor Leis, Florian Scheibner, Alfons Kemper, and Thomas Neumann. 2016. The ART of Practical Synchronization. In Proceedings of the 12th International Workshop on Data Management on New Hardware (DaMoN '16). Article 3, 8 pages.Google ScholarDigital Library
- Viktor Leis and Ziqi Wang. 2017. OLC B-tree. https://github.com/wangziqi2016/index-microbench/tree/master/BTreeOLC.Google Scholar
- Lucas Lersch, Xiangpeng Hao, Ismail Oukid, Tianzheng Wang, and Thomas Willhalm. 2019. Evaluating Persistent Memory Range Indexes. PVLDB, Vol. 13, 4 (2019), 574--587.Google ScholarDigital Library
- Justin J. Levandoski, David B. Lomet, and Sudipta Sengupta. 2013. The Bw-Tree: A B-tree for New Hardware Platforms. In Proceedings of the 2013 IEEE International Conference on Data Engineering (ICDE 2013) (ICDE '13). 302--313.Google ScholarDigital Library
- Hyeontaek Lim, Michael Kaminsky, and David G. Andersen. 2017. Cicada: Dependably Fast Multi-Core In-Memory Transactions. In Proceedings of the 2017 ACM International Conference on Management of Data (SIGMOD '17). 21--35.Google Scholar
- Baotong Lu, Jialin Ding, Eric Lo, Umar Farooq Minhas, and Tianzheng Wang. 2021. APEX: A High-Performance Learned Index on Persistent Memory. PVLDB, Vol. 15, 3 (2021), 597--610.Google ScholarDigital Library
- Baotong Lu, Xiangpeng Hao, Tianzheng Wang, and Eric Lo. 2020. Dash: Scalable Hashing on Persistent Memory. PVLDB, Vol. 13, 8 (2020), 1147--1161.Google ScholarDigital Library
- Peter S. Magnusson, Anders Landin, and Erik Hagersten. 1994. Queue Locks on Cache Coherent Multiprocessors. In Proceedings of the 8th International Symposium on Parallel Processing. 165--171.Google ScholarDigital Library
- Darko Makreshanski, Justin Levandoski, and Ryan Stutsman. 2015. To Lock, Swap, or Elide: On the Interplay of Hardware Transactional Memory and Lock-Free Indexing. Proc. VLDB Endow., Vol. 8, 11 (jul 2015), 1298--1309.Google ScholarDigital Library
- Yandong Mao, Eddie Kohler, and Robert Tappan Morris. 2012. Cache craftiness for fast multicore key-value storage. In Proceedings of the 7th ACM european conference on Computer Systems. 183--196.Google ScholarDigital Library
- John M. Mellor-Crummey and Michael L. Scott. 1991 a. Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors. ACM Trans. Comput. Syst., Vol. 9, 1 (feb 1991), 21--65.Google ScholarDigital Library
- John M. Mellor-Crummey and Michael L. Scott. 1991 b. Scalable Reader-Writer Synchronization for Shared-Memory Multiprocessors. In Proceedings of the Third ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPOPP '91). 106--113.Google Scholar
- Ismail Oukid, Johan Lasperas, Anisoara Nica, Thomas Willhalm, and Wolfgang Lehner. 2016. FPTree: A Hybrid SCM-DRAM Persistent and Concurrent B-Tree for Storage Class Memory. In Proceedings of the 2016 International Conference on Management of Data, SIGMOD. 371--386.Google ScholarDigital Library
- Larry Rudolph and Zary Segall. 1984. Dynamic Decentralized Cache Schemes for MIMD Parallel Processors. SIGARCH Comput. Archit. News, Vol. 12, 3 (Jan 1984), 340--347.Google ScholarDigital Library
- Michael Lee Scott. 2013. Shared-memory synchronization. Morgan & Claypool, San Rafael, Calif. (1537 Fourth Street, San Rafael, CA 94901 USA).Google Scholar
- Stephen Tu, Wenting Zheng, Eddie Kohler, Barbara Liskov, and Samuel Madden. 2013. Speedy Transactions in Multicore In-memory Databases. SOSP (2013), 18--32.Google Scholar
- Lukas Vogel, Alexander Van Renen, Satoshi Imamura, Jana Giceva, Thomas Neumann, and Alfons Kemper. 2022. Plush: A Write-Optimized Persistent Log-Structured Hash-Table. PVLDB, Vol. 15, 11 (2022), 2895--2907.Google ScholarDigital Library
- Tianzheng Wang, Milind Chabbi, and Hideaki Kimura. 2016. Be My Guest: MCS Lock Now Welcomes Guests. In Proceedings of the 21st ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '16). Article 21, 12 pages.Google ScholarDigital Library
- Tianzheng Wang and Hideaki Kimura. 2016. Mostly-Optimistic Concurrency Control for Highly Contended Dynamic Workloads on a Thousand Cores. PVLDB, Vol. 10, 2 (Oct. 2016), 49--60.Google ScholarDigital Library
- Tianzheng Wang, Justin Levandoski, and Per-Åke Larson. 2018a. Easy Lock-Free Indexing in Non-Volatile Memory. In 2018 IEEE 34th International Conference on Data Engineering (ICDE). 461--472.Google Scholar
- Ziqi Wang, Andrew Pavlo, Hyeontaek Lim, Viktor Leis, Huanchen Zhang, Michael Kaminsky, and David G. Andersen. 2018b. Building a Bw-Tree Takes More Than Just Buzz Words. In Proceedings of the 2018 International Conference on Management of Data (SIGMOD '18). 473--488.Google Scholar
Index Terms
- OptiQL: Robust Optimistic Locking for Memory-Optimized Indexes
Recommendations
Adaptable concurrency control for atomic data types
In many distributed systems concurrent access is required to a shared object, where abstract object servers may incorporate type-specific properties to define consistency requirements. Each operation and its outcome is treated as an event, and conflicts ...
Polaris: Enabling Transaction Priority in Optimistic Concurrency Control
PACMMODTransaction priority is a critical feature for real-world database systems. Under high contention, certain classes of transactions should be given a higher chance to commit than others. Such a prioritization mechanism is commonly implemented in locking-...
Optimistic concurrency for clusters via speculative locking
SYSTOR '09: Proceedings of SYSTOR 2009: The Israeli Experimental Systems ConferenceTransactional memory and speculative locking are optimistic concurrency control mechanisms, whose goal is to enable highly concurrent execution while reducing the programming effort. The same basic idea lies in the heart of both methods: optimistically ...
Comments