Rethinking Serializable Multi-version Concurrency Control
Jose Faleiro and Daniel Abadi Yale University
Rethinking Serializable Multi-version Concurrency Control Jose - - PowerPoint PPT Presentation
Rethinking Serializable Multi-version Concurrency Control Jose Faleiro and Daniel Abadi Yale University Theory: Single- vs Multi-version Systems Single-version T w Write X T r Read X system X 0 Multi-version T r Read X T w
Jose Faleiro and Daniel Abadi Yale University
X0 Tr – Read X
Single-version system Multi-version system
Tw – Write X X0 Tr – Read X Tw – Write X
X0 Tr – Read X
Single-version system Multi-version system
Tw – Write X X0 Tr – Read X Tw – Write X
Tr and Tw cannot simultaneously execute
X0 Tr – Read X
Single-version system Multi-version system
Tw – Write X X0 Tr – Read X Tw – Write X X1
Tr and Tw cannot simultaneously execute Tr and Tw can both simultaneously make progress
X0 Tr – Read X
Single-version system Multi-version system
Tw – Write X X0 Tr – Read X Tw – Write X
X1
Tr and Tw cannot simultaneously execute Tr and Tw can both simultaneously make progress
T0:
if savings + checking >= 100 savings -= 100 Savings: 100 Checking: 50
T1:
if savings + checking >= 75 checking -= 75 Constraint: savings + checking >= 0
T0:
if savings + checking >= 100 savings -= 100 Savings: 100 Checking: 50
T1:
if savings + checking >= 75 checking -= 75 Constraint: savings + checking >= 0 Savings: 0
T0 commits
T0:
if savings + checking >= 100 savings -= 100 Savings: 100 Checking: 50
T1:
if savings + checking >= 75 checking -= 75 Constraint: savings + checking >= 0
T0 commits
Savings: 0 Checking: -25
T1 commits
T0:
if savings + checking >= 100 savings -= 100 Savings: 100 Checking: 50
T1:
if savings + checking >= 75 checking -= 75 Constraint: savings + checking >= 0 Savings: 0 Checking: -25
T0 commits T1 commits
T0:
if savings + checking >= 100 savings -= 100 Savings: 100 Checking: 50
T1:
if savings + checking >= 75 checking -= 75 Constraint: savings + checking >= 0 Savings: 0 Checking: -25
T0 commits T1 commits
T0:
savings += 100 begin: end: Savings: 25 begin: 0 end: 10 Savings: 75 begin: 10 end: inf
Monotonic timestamp generator
T0:
savings += 100 begin: end: Savings: 25 begin: 0 end: 10 Savings: 75 begin: 10 end: inf
Monotonic timestamp generator
T0:
savings += 100 begin: 12 end: Savings: 25 begin: 0 end: 10 Savings: 75 begin: 10 end: inf
Monotonic timestamp generator Determines snapshot visible to txn
T0:
savings += 100 begin: 12 end: Savings: 25 begin: 0 end: 10 Savings: 75 begin: 10 end: inf
Monotonic timestamp generator
T0:
savings += 100 begin: 12 end: 18 Savings: 25 begin: 0 end: 10 Savings: 75 begin: 10 end: 18
Monotonic timestamp generator
Savings: 175 begin: 18 end: inf
Determines visibility of txn’s writes
T0:
savings += 100 begin: 12 end: 18 Savings: 25 begin: 0 end: 10 Savings: 75 begin: 10 end: 18
Monotonic timestamp generator
Savings: 175 begin: 18 end: inf
T0:
savings += 100 begin: 12 end: 18
Monotonic timestamp generator
Savings: 25 begin: 0 end: 10 Savings: 75 begin: 10 end: 18 Savings: 175 begin: 18 end: inf
version systems
version systems
Fundamental issue with concurrency control protocols Severe performance degradation on multi-core main-memory systems
dynamically
execution
version visibility
T0 T1 T2 T3 T4 T0 T1 T2 T4 T3
Concurrency Control Execution Determine legal schedule Perform logic
piece
their execution
a b h f
T200
threads
a e g
CC0
b c h
CC1
d f i
CC2
a b h f
T200
threads
version
a e g
CC0
b c h
CC1
d f i
CC2
a b h f
T200
threads
version
a e g
CC0
b c h
CC1
d f i
CC2
a e g begin: 0 end: inf
value0
a b h f
T200
threads
version
a e g
CC0
b c h
CC1
d f i
CC2
a e g begin: 0 end: 200 prev a b h f
T200
begin: 200 end: inf
value0
a b h f
T200
threads
version
a e g
CC0
b c h
CC1
d f i
CC2
a e g begin: 0 end: 200 prev a b h f
T200
begin: 200 end: inf
value0 Version contains txn reference No value yet
after concurrency control completes
data
a e g begin: 0 end: 200 prev a b h f
T200
begin: 200 end: inf
value0
after concurrency control completes
data
a e g begin: 0 end: 200 prev a b h f
T200
begin: 200 end: inf
value0 Replace txn reference with actual data
a e g begin: 0 end: 200 prev begin: 200 end: inf
value0 value1
after concurrency control completes
data Replace txn reference with actual data
a e g begin: 0 end: 200 prev a b h f
T200
begin: 200 end: inf
value0 Concurrency control fixes txn snapshots prior to their execution Execution only produces values No logical locking/validation
0.0 M 0.5 M 1.0 M 1.5 M 2.0 M 4 8 12 16 20 24 28 32 36 40 44 Throughput (txns/sec) Number of Threads Bohm SI Hekaton 2PL OCC
2x
read-write conflicts despite using multi-versioning
JMFALEIRO.COM JOSE.FALEIRO@YALE.EDU
0.0 M 0.5 M 1.0 M 1.5 M 2.0 M 2.5 M 3.0 M 3.5 M 4.0 M 4 8 12 16 20 24 28 32 36 40 44 Throughput (txns/sec) Number of Threads Bohm 2PL OCC SI Hekaton
3x
0.0 M 0.5 M 1.0 M 1.5 M 2.0 M 2.5 M 3.0 M 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Throughput (txns/sec) Theta OCC Bohm 2PL SI Hekaton
Increasing contention
1 K 10 K 100 K 1 25 50 75 100 Throughput (txns/sec) Percentage of Read-only Transactions Bohm SI Hekaton OCC 2PL