Hassium: Hardware Assisted Database Synchronization

Slides:



Advertisements
Similar presentations
Copyright 2008 Sun Microsystems, Inc Better Expressiveness for HTM using Split Hardware Transactions Yossi Lev Brown University & Sun Microsystems Laboratories.
Advertisements

Transactional Memory Parag Dixit Bruno Vavala Computer Architecture Course, 2012.
Time-based Transactional Memory with Scalable Time Bases Torvald Riegel, Christof Fetzer, Pascal Felber Presented By: Michael Gendelman.
Company LOGO MVCC on Flash Memory Fan Yulei, Lab of WAMDM, School of Information, Renmin University of China, Beijing, China,
Privatization Techniques for Software Transactional Memory Michael F. Spear, Virendra J. Marathe, Luke Dalessandro, and Michael L. Scott University of.
Database Systems (資料庫系統)
1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos – A. Pavlo Lecture#23: Concurrency Control – Part 3 (R&G.
Concurrent programming: From theory to practice Concurrent Algorithms 2014 Vasileios Trigonakis Georgios Chatzopoulos.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
Nested Transactional Memory: Model and Preliminary Architecture Sketches J. Eliot B. Moss Antony L. Hosking.
Transactional Memory Yujia Jin. Lock and Problems Lock is commonly used with shared data Priority Inversion –Lower priority process hold a lock needed.
Transaction Management and Concurrency Control
Quick Review of May 1 material Concurrent Execution and Serializability –inconsistent concurrent schedules –transaction conflicts serializable == conflict.
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
Scalable, Reliable, Power-Efficient Communication for Hardware Transactional Memory Seth Pugsley, Manu Awasthi, Niti Madan, Naveen Muralimanohar and Rajeev.
Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E. Ramadan, Aditya Bhandari, and Emmett Witchel - Presentation By Sathish P.
ACS-4902 R. McFadyen 1 Chapter 18 Database Concurrency Control Locking 18.1 Shared/Exclusive (aka Read/Write) Locks Lock Operations Read_lock(X) Write_lock(X)
Unbounded Transactional Memory Paper by Ananian et al. of MIT CSAIL Presented by Daniel.
1 Concurrency: Deadlock and Starvation Chapter 6.
Tianzheng Wang Ryan Johnson Alan Fekete Ippokratis Pandis The Serial Safety Net: Efficient concurrency control on modern hardware 1.
Database System Architectures  Client-server Database System  Parallel Database System  Distributed Database System Wei Jiang.
Concurrency Control In Dynamic Database Systems Laurel Jones.
Administration etc.. What is this ? This section is devoted to those bits that I could not find another home for… Again these may be useless, but humour.
1 IT420: Database Management and Organization Transactions 31 March 2006 Adina Crăiniceanu
Concurrency Control in Distributed Databases. By :- Rishikesh Mandvikar rmandvik[at]engr.smu.edu May 1, 2004.
Data Concurrency Control And Data Recovery
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Reduced Hardware NOrec: A Safe and Scalable Hybrid Transactional Memory Alexander Matveev Nir Shavit MIT.
Sutirtha Sanyal (Barcelona Supercomputing Center, Barcelona) Accelerating Hardware Transactional Memory (HTM) with Dynamic Filtering of Privatized Data.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Distributed synchronization and mutual exclusion Distributed Transactions.
Jason Wong Applications Manager DBA/Developer Programmer …. 20+ years IS&T, DEV,
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Technology from seed Exploiting Off-the-Shelf Virtual Memory Mechanisms to Boost Software Transactional Memory Amin Mohtasham, Paulo Ferreira and João.
Page 1 Concurrency Control Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Chapter 20 Transaction Management Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation and Management, 4 th Edition,
Consistency Oblivious Programming Hillel Avni Tel Aviv University.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
© 2008 Multifacet ProjectUniversity of Wisconsin-Madison Pathological Interaction of Locks with Transactional Memory Haris Volos, Neelam Goyal, Michael.
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Motivation for Recovery Atomicity: –Transactions may abort (“Rollback”). Durability: –What if DBMS stops running? (Causes?) crash! v Desired Behavior after.
On Transactional Memory, Spinlocks and Database Transactions Khai Q. Tran Spyros Blanas Jeffrey F. Naughton (University of Wisconsin Madison)
Maurice Herlihy and J. Eliot B. Moss,  ISCA '93
Transactions in PostgreSQL
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Transactional Memory : Hardware Proposals Overview
PHyTM: Persistent Hybrid Transactional Memory
LogSI-HTM: Log Based Snapshot Isolation in
Schedules and Serializability
EECS 498 Introduction to Distributed Systems Fall 2017
Transaction Management
Concurrency Control II (OCC, MVCC)
Database Processing: David M. Kroenke’s Chapter Nine: Part One
Chapter 10 Transaction Management and Concurrency Control
Hybrid Transactional Memory
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Software Transactional Memory Should Not be Obstruction-Free
Transactions and Concurrency
Concurrency Control Techniques
Database Management System
Database System Architectures
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
Concurrency control (OCC and MVCC)
CSE 542: Operating Systems
CSE 542: Operating Systems
Transactions, Properties of Transactions
Presentation transcript:

Hassium: Hardware Assisted Database Synchronization Hillel Avni Aharon Avitzur

Contents Hassium Execution Example Performance Page 1

Hassium Single version, shared everything concurrency control algorithm The following are wrapped with separate HTM transactions: Row access, for read or write Commit Deadlock detection More characteristics: Monotonic increasing version counter V per database thread (i.e. per connection) Unique database thread ID Each database transaction Has a unique set of ID and version, <ID, V> At commit, a database transaction marks <ID, V> as committed More details in the running example… Page 2

Hassium Scalability Characteristics Compared, single version, shared everything algorithm types: OCC: Lock write-set at commit time and then and validate read-set ETL: Lock write-set at encounter time and validate read-set at commit 2PL: Lock both read and write-sets at encounter time. HTM: Check conflicts by exploiting cache coherence invalidations T1 and T2, both access row R. Scalability characteristics: Writer Allows Reader: T1 wrote R  T2 can read R (not ETL and 2PL) Writer See Writer: T1 wrote R  T2 sees R is locked (not OCC) Reader Allows Writer: T1 read R  T2 can write R (not HTM and 2PL) At Least One Survives: T1 and T2 will not mutually abort (not OCC) and ETL) Page 3

Contents Hassium Execution Example Performance Page 4

Example Threads ID = 0 V = 12 Data ID = 0 V = 3 Row 0 ID = 0 V = 3 Safe Versions Array Page 5

Example Threads Public ID = 0 V = 12 Data ID = 0 V = 3 Row 0 ID = 0 Private Safe Versions Array Page 6

Example ID (0) and V (3) of last writer of Row 1. User data not shown Backup of last committed version of the row Threads ID = 0 V = 12 Data ID = 0 V = 3 Row 0 Highest committed version of thread 1 ID = 0 V = 3 ID = 1 V = 183 Row 1 Highest committed version of thread 0 ID = 1 V = 170 Row 2 V = 11 V = 182 Safe Versions Array Page 7

Example Threads ID = 0 V = 12 Data ID = 0 V = 3 Row 0 ID = 0 V = 3 Safe Versions Array Page 8

Example: Threads 0 and 1 Write ID = 0 V = 12 2 Concurrent HTM TX Data ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 Row 2 V = 11 V = 182 Safe Versions Array Page 9

Example: Threads Read from each other ID = 0 V = 12 Another 2 Concurrent HTM TX Data ID = 0 V = 3 ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 ID = 1 V = 170 Row 2 V = 11 V = 182 Safe Versions Array Page 10

Example: Thread 0 Validates Threads ID = 0 V = 12 HTM TX Start Data ID = 0 V = 3 ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 ID = 1 V = 170 Row 2 V = 11 V = 182 Safe Versions Array Page 11

Example: Thread 0 Validation Passed Threads ID = 0 V = 12 HTM TX Continues Data ID = 0 V = 3 ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 ID = 1 V = 170 Row 2 V = 11 V = 182 Safe Versions Array Page 12

Example: Thread 0 Commits Threads ID = 0 V = 12 HTM TX Commits Data ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 ID = 1 V = 170 Row 2 V = 12 V = 182 Safe Versions Array Page 13

Example: Thread 0 Commits Threads ID = 0 V = 13 NO HTM Data ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 ID = 1 V = 170 Row 2 V = 12 V = 182 Safe Versions Array Page 14

Example: Thread 1 Validates Threads ID = 0 V = 13 HTM TX Start Data ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 ID = 1 V = 170 Row 2 V = 12 V = 182 Safe Versions Array Page 15

Example: Threads 1 Validation Fails HTM TX Commits Data ID = 0 V = 3 Row 0 ID = 1 V = 183 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 ID = 1 V = 170 ID = 1 V = 170 Row 2 V = 12 V = 182 Safe Versions Array Page 16

Example: Thread 1 Aborts and rolls back Threads ID = 0 V = 13 NO HTM Data ID = 0 V = 3 Row 0 ID = 0 V = 3 ID = 1 V = 183 Row 1 ID = 0 V = 12 Row 2 V = 12 V = 182 Safe Versions Array Page 17

Contents Hassium Execution Example Performance Page 18

Possibility Test We execute the following test: N rows, r1,,,rN N threads, t1…tN A thread tk executes: Start Transaction Write rk Read r1…rN Commit Transaction All the algorithms we tested stopped at 3 threads: OCC and ETL: 100% aborts 2PL: Slowed to zero Page 19

Contention Test – TPCC New Order Mix of reads and writes. Hassium has Lower DB abort rate than OCC. When contention rises, Hassium has lower overhead than 2PL Page 20

Contention Test – TPCC Payment Mostly writes Hassium has Lower DB abort than ETL due to deadlock detection OCC has lower part of aborted DB transactions but, higher part of aborted work, because OCC always aborts at commit and waists more work Page 21