skip to main content
research-article

OptiQL: Robust Optimistic Locking for Memory-Optimized Indexes

Published:13 November 2023Publication History
Skip Abstract Section

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.

References

  1. Adnan Alhomssi and Viktor Leis. 2021. Contention and Space Management in B-Trees. In Conference on Innovative Data Systems Research (CIDR 2021).Google ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle Scholar
  4. R. Bayer and M. Schkolnick. 1977. Concurrency of Operations on B-Trees. Acta Inf., Vol. 9, 1 (mar 1977), 1--21.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. cppreference.com. 2022. std::shared_mutex. https://en.cppreference.com/w/cpp/thread/shared_mutex.Google ScholarGoogle Scholar
  9. Travis S. Craig. 1993. Building FIFO and Priority-Queuing Spin Locks from Atomic Swap. University of Washington Technical Report 93-02-02 (1993).Google ScholarGoogle Scholar
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle Scholar
  16. Goetz Graefe. 2010. A Survey of B-Tree Locking Techniques. ACM Trans. Database Syst., Vol. 35, 3, Article 16 (jul 2010), 26 pages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. Maurice Herlihy and Nir Shavit. 2012. The Art of Multiprocessor Programming, Revised Reprint 1st ed.).Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. IBM. 1983. IBM System/370 Extended Architecture, Principles of Operation. IBM Publication No. SA22--7085.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle Scholar
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle Scholar
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. Viktor Leis and Ziqi Wang. 2017. OLC B-tree. https://github.com/wangziqi2016/index-microbench/tree/master/BTreeOLC.Google ScholarGoogle Scholar
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. Baotong Lu, Xiangpeng Hao, Tianzheng Wang, and Eric Lo. 2020. Dash: Scalable Hashing on Persistent Memory. PVLDB, Vol. 13, 8 (2020), 1147--1161.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle Scholar
  40. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. Michael Lee Scott. 2013. Shared-memory synchronization. Morgan & Claypool, San Rafael, Calif. (1537 Fourth Street, San Rafael, CA 94901 USA).Google ScholarGoogle Scholar
  43. Stephen Tu, Wenting Zheng, Eddie Kohler, Barbara Liskov, and Samuel Madden. 2013. Speedy Transactions in Multicore In-memory Databases. SOSP (2013), 18--32.Google ScholarGoogle Scholar
  44. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  45. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  46. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  47. 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 ScholarGoogle Scholar
  48. 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 ScholarGoogle Scholar

Index Terms

  1. OptiQL: Robust Optimistic Locking for Memory-Optimized Indexes

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image Proceedings of the ACM on Management of Data
            Proceedings of the ACM on Management of Data  Volume 1, Issue 3
            PACMMOD
            September 2023
            472 pages
            EISSN:2836-6573
            DOI:10.1145/3632968
            Issue’s Table of Contents

            Copyright © 2023 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 13 November 2023
            Published in pacmmod Volume 1, Issue 3

            Permissions

            Request permissions about this article.

            Request Permissions

            Qualifiers

            • research-article
          • Article Metrics

            • Downloads (Last 12 months)125
            • Downloads (Last 6 weeks)32

            Other Metrics

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader