Bumper: Sheltering Transactions from Conflicts
Nuno Diegues and Paolo Romano
ndiegues@gsd.inesc-id.pt www.cloudtm.eu
Nuno Diegues 1/27
Bumper : Sheltering Transactions from Conflicts Nuno Diegues and - - PowerPoint PPT Presentation
Bumper : Sheltering Transactions from Conflicts Nuno Diegues and Paolo Romano ndiegues@gsd.inesc-id.pt www.cloudtm.eu Nuno Diegues 1/27 Context: scalability Large-scale systems powered by the cloud computing paradigm Nuno Diegues 2/27
ndiegues@gsd.inesc-id.pt www.cloudtm.eu
Nuno Diegues 1/27
Nuno Diegues 2/27
BigTable Dynamo Cassandra 2006 2007 2008
Weak Consistency
Nuno Diegues 2/27
BigTable Dynamo Cassandra 2006 2007 2008
Weak Consistency
Nuno Diegues 2/27
BigTable Dynamo Cassandra Azure Megastore SCORe Spanner 2006 2007 2008 2011 2012
Weak Consistency Strong Consistency
Nuno Diegues 3/27
Nuno Diegues 4/27
Nuno Diegues 4/27
access
Nuno Diegues 4/27
commit?
Nuno Diegues 4/27
read-only transaction
Nuno Diegues 4/27
read-only transaction update transaction
Nuno Diegues 4/27
read-only transaction update transaction
modify
Nuno Diegues 4/27
read-only transaction update transaction
modify
2 2 2 2 1 1 1 1 1 1
Nuno Diegues 4/27
read-only transaction update transaction consistent reads 2 2 1 1 1 1 2 2 1 1
Nuno Diegues 4/27
read-only transaction update transaction consistent reads 2 2 1 1 1 1 2 2 1 1
Nuno Diegues 4/27
Nuno Diegues 5/27
5000 10000 15000 20000 20 40 60 80 100 120 140 160
throughput (txs/s)
#machines
Nuno Diegues 5/27
5000 10000 15000 20000 20 40 60 80 100 120 140 160
throughput (txs/s)
#machines
Nuno Diegues 5/27
Nuno Diegues 6/27
Nuno Diegues 6/27
read x
T1
read y Nuno Diegues 6/27
read x
T1
read y read x write x
T2
Nuno Diegues 6/27
read x
T1
read y write y read x write x
T2
Nuno Diegues 6/27
read x
T1
read y write y read x write x
rw
T2
Nuno Diegues 6/27
read x
T1
read y write y read x write x
rw
T2
Nuno Diegues 6/27
Nuno Diegues 7/27
read z write z
T1
Nuno Diegues 7/27
read z write z read z write z
T2 T1
Nuno Diegues 7/27
read z write z read z write z
rw rw
T2 T1
Nuno Diegues 7/27
Nuno Diegues 8/27
2000 4000 6000 8000 10000 12000 14000 20 40 60 80 100 120 140 160
throughput (txs/s)
#machines
SCORe
Nuno Diegues 8/27
2000 4000 6000 8000 10000 12000 14000 20 40 60 80 100 120 140 160
throughput (txs/s)
#machines
Bumper SCORe
Nuno Diegues 8/27
◮ automatically avoid benign conflicts Nuno Diegues 9/27
◮ automatically avoid benign conflicts
◮ circumvent contention hotspots Nuno Diegues 9/27
◮ automatically avoid benign conflicts
◮ circumvent contention hotspots
Nuno Diegues 9/27
Nuno Diegues 10/27
read x
T1
read y write y read x write x
rw
T2
Nuno Diegues 10/27
read x
T1
read y write y read x write x
rw
T2 T2 T1
time serialization Nuno Diegues 10/27
read x
T1
read y write y read x write x
rw
T2 T2 T1
time
rw
serialization Nuno Diegues 10/27
read x
T1
read y write y read x write x
rw
T2 T2
serialization Nuno Diegues 10/27
read x
T1
read y write y read x write x
rw
T2 T2
serialization
T1
rw
Nuno Diegues 10/27
read x
T1
read y write y read x write x
rw
T2 T2
serialization
T1
rw
Nuno Diegues 10/27
Nuno Diegues 11/27
Nuno Diegues 11/27
1 tsC orders transactions after dependencies (read-from) Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) 2 before transactions that were missed Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed
read x
T1
read y read x write x
T2
ts = 1
Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed
read x
T1
read y read x write x
T2
ts = 1
Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed ◮ Otherwise, serialize before earliest transaction missed
read x
T1
read y read x write x
T2
ts = 1
Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed ◮ Otherwise, serialize before earliest transaction missed ◮ earliest missed T2: T1.tsC = T2.tsC − ǫ
read x
T1
read y read x write x
T2
ts = 1
Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed ◮ Otherwise, serialize before earliest transaction missed ◮ earliest missed T2: T1.tsC = T2.tsC − ǫ
read x
T1
read y write y read x write x
T2
ts = 1
Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed ◮ Otherwise, serialize before earliest transaction missed ◮ earliest missed T2: T1.tsC = T2.tsC − ǫ
read x
T1
read y write y read x write x
rw
T2
ts = 1
Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed ◮ Otherwise, serialize before earliest transaction missed ◮ earliest missed T2: T1.tsC = T2.tsC − ǫ
read x
T1
read y write y read x write x
rw
T2
ts = 1 ts = 1 - ε
Nuno Diegues 12/27
1 tsC orders transactions after dependencies (read-from) ◮ In the absence of stale reads, T2.tsC = scalar clock 2 before transactions that were missed ◮ Otherwise, serialize before earliest transaction missed ◮ earliest missed T2: T1.tsC = T2.tsC − ǫ
read x
T1
read y write y read x write x
rw
T2
ts = 1 ts = 1 - ε write z
T3
ts = 2
Nuno Diegues 12/27
Nuno Diegues 13/27
Nuno Diegues 13/27
◮ a triad
A
write y read y
rw
T
write x
B
read x
rw
Nuno Diegues 13/27
◮ a triad
◮ the pivot
A
write y read y
rw
T
write x
B
read x
rw
Pivot Nuno Diegues 13/27
◮ a triad
◮ the pivot
◮ Completes a triad ◮ Whose pivot time-warp
commits
A
write y read y
rw
T
write x
B
read x
rw
Pivot Nuno Diegues 13/27
read access
read-set
Nuno Diegues 14/27
read access
stamp: <ts, tid>
read-set
Nuno Diegues 14/27
read-only transaction
stamp: <ts, tid>
read-set
Nuno Diegues 14/27
stamp: <ts, tid>
read write
stamp: <ts, tid>
read-set write-set
Nuno Diegues 14/27
stamp: <10, T> stamp: <10, T> validate writes T.start = 9 may time-warp?
read-set write-set
Nuno Diegues 14/27
stamp: <10, T> stamp: <10, T> validate writes T.start = 9 may time-warp? Yes
read-set write-set
Nuno Diegues 14/27
stamp: <10, T> stamp: <10, T> validate reads need time-warp? T.start = 9 may time-warp? Yes
read-set write-set
Nuno Diegues 14/27
stamp: <10, T> stamp: <10, T> validate reads need time-warp? No T.start = 9 may time-warp? Yes
read-set write-set
1 1
1 1
Nuno Diegues 14/27
stamp: <10, T> stamp: <10, T> validate reads need time-warp? Yes T.start = 9 may time-warp? Yes
read-set write-set
2 1
1 1
new version missed!
1
Nuno Diegues 14/27
stamp: <10, T> stamp: <11, Z> need time-warp? Yes T.start = 9 may time-warp? No
read-set write-set
2 1
1 1
1
Nuno Diegues 14/27
read z write z read z write z
rw rw
T2 T1
Nuno Diegues 15/27
read z write z read z write z
rw rw
T2 T1
Nuno Diegues 15/27
read z write z read z write z
rw rw
T2 T1
Nuno Diegues 15/27
Nuno Diegues 15/27
Nuno Diegues 15/27
Nuno Diegues 15/27
T1 T2
Server
read read start start
...
read balance write balance write balance read balance
... ... ...
try commit try commit
abort Nuno Diegues 16/27
T1 T2
Server
read read start start
...
read balance write balance write balance read balance
... ... ...
try commit try commit
abort Nuno Diegues 16/27
T1 T2
Server
read read start start
... ...
try commit try commit
delay T1 delay T2
Nuno Diegues 16/27
Nuno Diegues 17/27
◮ outcome does not affect the transaction
Nuno Diegues 17/27
◮ outcome does not affect the transaction ◮ require programmer’s knowledge
Nuno Diegues 17/27
◮ outcome does not affect the transaction ◮ require programmer’s knowledge
Nuno Diegues 17/27
◮ outcome does not affect the transaction ◮ require programmer’s knowledge
◮ delayed to commit-time Nuno Diegues 17/27
◮ outcome does not affect the transaction ◮ require programmer’s knowledge
◮ delayed to commit-time ◮ use the latest snapshot Nuno Diegues 17/27
◮ outcome does not affect the transaction ◮ require programmer’s knowledge
◮ delayed to commit-time ◮ use the latest snapshot ◮ ensure it cannot be invalidated Nuno Diegues 17/27
Nuno Diegues 18/27
Nuno Diegues 18/27
Nuno Diegues 18/27
◮ over-approximate for dynamic structures Nuno Diegues 18/27
◮ over-approximate for dynamic structures
Nuno Diegues 18/27
◮ over-approximate for dynamic structures
◮ atomically execute delayed actions Nuno Diegues 18/27
◮ over-approximate for dynamic structures
◮ atomically execute delayed actions ◮ write-back deferred updates Nuno Diegues 18/27
◮ over-approximate for dynamic structures
◮ atomically execute delayed actions ◮ write-back deferred updates ◮ atomicity enforced with sequential confirmation thread per machine Nuno Diegues 18/27
Nuno Diegues 19/27
Nuno Diegues 19/27
Nuno Diegues 19/27
Nuno Diegues 19/27
Nuno Diegues 20/27
Nuno Diegues 20/27
Nuno Diegues 20/27
2000 4000 6000 8000 10000 12000 20 40 60 80 100 120 140 160 20 40 60 80 100 throughput (txs/s) aborted transactions (%)
#nodes
Bumper throughput SCORe throughput Bumper aborts SCORe aborts Nuno Diegues 21/27
2000 4000 6000 8000 10000 20 40 60 80 100 120 140 160 20 40 60 80 100 throughput (txs/s) aborted transactions (%)
#nodes
SCORe throughput SCORe aborts
Nuno Diegues 22/27
2000 4000 6000 8000 10000 20 40 60 80 100 120 140 160 20 40 60 80 100 throughput (txs/s) aborted transactions (%)
#nodes
Bumper throughput SCORe throughput Bumper aborts SCORe aborts
Nuno Diegues 22/27
1000 2000 3000 4000 5000 6000 7000 20 40 60 80 100 120 140 160 20 40 60 80 100 throughput (txs/s) aborted transactions (%)
#nodes
SCORe throughput SCORe aborts
Nuno Diegues 23/27
1000 2000 3000 4000 5000 6000 7000 20 40 60 80 100 120 140 160 20 40 60 80 100 throughput (txs/s) aborted transactions (%)
#nodes
Bumper throughput SCORe throughput Bumper aborts SCORe aborts
Nuno Diegues 23/27
1000 3000 5000 7000 9000 11000 13000 20 40 60 80 100 120 140 160 20 40 60 80 100 throughput (txs/s) aborted transactions (%)
#nodes
SCORe throughput SCORe aborts
Nuno Diegues 24/27
1000 3000 5000 7000 9000 11000 13000 20 40 60 80 100 120 140 160 20 40 60 80 100 throughput (txs/s) aborted transactions (%)
#nodes
Bumper throughput SCORe throughput Bumper aborts SCORe aborts
Nuno Diegues 24/27
1000 2000 3000 4000 5000 6000 20 40 60 80 100 120 140 160 20 40 60 80 100
throughput (txs/s) aborted transactions (%)
#nodes Bumper throughput SCORe throughput Bumper aborts SCORe aborts 5000 10000 15000 20000 20 40 60 80 100 120 140 160
throughput (txs/s)
#nodes Bumper throughput SCORe throughput
Nuno Diegues 25/27
Nuno Diegues 26/27
Nuno Diegues 26/27
◮ benign conflicts that do not threat serializability Nuno Diegues 26/27
◮ benign conflicts that do not threat serializability ◮ hotspots of contention Nuno Diegues 26/27
◮ benign conflicts that do not threat serializability ◮ hotspots of contention
Nuno Diegues 26/27
◮ benign conflicts that do not threat serializability ◮ hotspots of contention
Nuno Diegues 26/27
Nuno Diegues 27/27
Nuno Diegues 28/27
read x:0 write x=1
T1
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
T1 T2
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
T1 T2
read z:0 write z=1
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
rw
T1 T2
read z:0 write z=1
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
rw
T1 T2
read z:0 write z=1 read z:0 write z=1
T3
read x:1
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
rw rw
T1 T2
read z:0 write z=1 read z:0 write z=1
T3
read x:1
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
rw rw
T1 T2
read z:0 write z=1 read z:0 write z=1
T3
read x:1
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
rw rw
T1 T2
read z:0 write z=1 read z:0 write z=1
T3
read x:1
Nuno Diegues 28/27
read x:0 write x=1 read x:0 delayed:z
rw rw
T1 T2
read z:0 write z=1 read z:0 write z=1
T3
read x:1
Nuno Diegues 28/27
Nuno Diegues 29/27
Nuno Diegues 29/27
Nuno Diegues 29/27
Nuno Diegues 29/27
Nuno Diegues 30/27
Nuno Diegues 30/27
Nuno Diegues 30/27
write x read x write y
rw
T1 T2
read z
T3 inConflict = true inConflict = true
Nuno Diegues 31/27
write x read x write y
rw
T1 T2
read z
T3
Nuno Diegues 31/27
Nuno Diegues 32/27
Nuno Diegues 32/27
Nuno Diegues 33/27
Nuno Diegues 33/27