tictoc time traveling optimistic concurrency control
play

TicToc: Time Traveling Optimistic Concurrency Control Xiangyao Yu 1 - PowerPoint PPT Presentation

TicToc: Time Traveling Optimistic Concurrency Control Xiangyao Yu 1 , Andrew Pavlo 2 , Daniel Sanchez 1 , Srinivas Devadas 1 Massachusetts Institute of Technology 1 Carnegie Mellon University 2 PHYSICAL VS LOGICAL TIME T1 T2 Lock Release Lock


  1. TicToc: Time Traveling Optimistic Concurrency Control Xiangyao Yu 1 , Andrew Pavlo 2 , Daniel Sanchez 1 , Srinivas Devadas 1 Massachusetts Institute of Technology 1 Carnegie Mellon University 2

  2. PHYSICAL VS LOGICAL TIME T1 T2 Lock Release Lock Acquire Two-Phase Tuple A Read Lock Write Lock Locking (2PL) Tuple B Write Lock Time Read Timestamp Tuple A Write Lock Ordering Tuple B (T/O) Write Lock T1 @ ts = 1 T2 @ ts = 2 2 ¡

  3. TIMESTAMP ORDERING Timestamp Allocation T/O ¡ 2PL ¡ 25 ¡ (txns have unique timestamps) (Million ¡txn/s) ¡ 20 ¡ Throughput ¡ • Centralized Allocator 15 ¡ 10 ¡ – Timestamp allocation is 5 ¡ a scalability bottleneck 0 ¡ ts = __sync_fetch_and_add(&glob_ts, 1) 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ Thread ¡Count ¡ • Synchronized Clock – Clock skew causes unnecessary aborts 3 ¡

  4. TIMESTAMP ORDERING Time Timestamp Allocation COMMIT BEGIN T1@ts=1 (txns have unique timestamps) READ(A) COMMIT Static Timestamp BEGIN T2@ts=2 Assignment WRITE(A) COMMIT • Txns abort due to bad BEGIN T1@ts=2 timestamp assignment READ(A) ABORT BEGIN T2@ts=1 WRITE(A) 4 ¡

  5. DATA DRIVEN TIMESTAMP MANAGEMENT TicToc Traditional T/O 1. Acquire timestamp (TS) 1. Access tuples and remember 2. Determine tuple visibility using their timestamp info. TS 2. Compute commit timestamp (CommitTS) Timestamp Allocation No Timestamp Allocation Static Timestamp Assignment Dynamic Timestamp Assignment 5 ¡

  6. OPTIMISTIC CONCURRENCY CONTROL (OCC) COMMIT BEGIN READ VALIDATION WRITE PHASE PHASE PHASE Update Database Read & Write Tuples Compute CommitTS Execute Transaction Decide Commit/Abort wts rts Tuple Format Data (Write Timestamp) (Read Timestamp) 6 ¡

  7. READ PHASE Write to local write set Transaction WRITE(A) Read data and READ(B) timestamps atomically Logical Time READ(C) 1 2 3 4 7 ¡

  8. VALIDATION PHASE TXN Step 1 Lock Write Set WRITE(A) READ(B) READ(C) 1 2 3 4 Logical Time 8 ¡

  9. VALIDATION PHASE TXN CommitTS Step 1 Lock Write Set Step 2 Compute CommitTS WRITE(A) READ(B) READ(C) 1 2 3 4 Logical Time 9 ¡

  10. VALIDATION PHASE TXN CommitTS Step 1 Lock Write Set Step 2 Compute CommitTS WRITE(A) Step 3 Validate Read Set Case 1: latest version READ(B) READ(C) 1 2 3 4 Logical Time 10 ¡

  11. VALIDATION PHASE TXN CommitTS Step 1 Lock Write Set Step 2 Compute CommitTS WRITE(A) Step 3 Validate Read Set Case 1: latest version READ(B) Case 2: New version at/before CommitTS READ(C) 1 2 3 4 Logical Time 11 ¡

  12. VALIDATION PHASE TXN CommitTS Step 1 Lock Write Set Step 2 Compute CommitTS WRITE(A) Step 3 Validate Read Set Case 1: latest version READ(B) Case 2: New version at/before CommitTS Case 3: New version after READ(C) CommitTS 1 2 3 4 Logical Time 12 ¡

  13. TIME TRAVELING COMMIT BEGIN Txn 1 READ(A) COMMIT BEGIN Txn 2 WRITE(A) Time Txn 2 Txn 1 Tuple A CommitTS CommitTS 1 2 3 4 Logical Time 13 ¡

  14. TICTOC OPTMIZATIONS • No-wait locking in validation phase • Preemptive aborts • Timestamp history • Lower isolation levels 14 ¡

  15. EXPERIMENTAL SETUP • 4-socket, 40-core Machine (80 threads w/ hyper- threading) • Main Memory DBx1000 – No logging – No B-tree (Hash indexing) • Concurrency Control Algorithms – MVCC: HEKATON – OCC: SILO – 2PL: DL_DETECT, NO_WAIT 15 ¡

  16. YSCB Medium Contention TICTOC ¡ HEKATON ¡ DL_DETECT ¡ NO_WAIT ¡ SILO ¡ Throughput Abort Rate 5 ¡ 0.4 ¡ 4 ¡ 0.3 ¡ (Million ¡txn/s) ¡ Abort ¡Rate ¡ Throughput ¡ 3 ¡ 0.2 ¡ 2 ¡ 0.1 ¡ 1 ¡ 0 ¡ 0 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ Thread ¡Count ¡ Thread ¡Count ¡ 16 ¡

  17. YSCB High Contention TICTOC ¡ HEKATON ¡ DL_DETECT ¡ NO_WAIT ¡ SILO ¡ Throughput Abort Rate 1 ¡ 1 ¡ 0.8 ¡ 0.8 ¡ Abort ¡Rate ¡ (Million ¡txn/s) ¡ Throughput ¡ 0.6 ¡ 0.6 ¡ 0.4 ¡ 0.4 ¡ 0.2 ¡ 0.2 ¡ 0 ¡ 0 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ Thread ¡Count ¡ Thread ¡Count ¡ 17 ¡

  18. Xiangyao Yu Andy Pavlo Daniel Sanchez Srinivas Devadas yxy@mit.edu pavlo@cs.cmu.edu sanchez@mit.edu devadas@mit.edu DBx1000 (https://github.com/yxymit/DBx1000)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend