Efficient Snapshot Implementations in Distributed Systems

Faster than Optimal Snapshots
(for a While)
James Aspnes, Yale University
Hagit Attiya, Technion
Keren Censor-Hillel, MIT
Faith Ellen, University of Toronto
 
Snapshot Objects
p
1
p
2
p
n
update(
v
)
scan
2
update your
location
Model
3
System of 
n
 processes, 
m 
multi-writer
 registers
Asynchronous
 schedule controlled by an adversary
Crash failures 
– require 
wait-free
 implementations
Linearizable 
implementations
p
1
p
2
R
1
p
n
R
2
R
m
read
v
write(
v
)
ok
Snapshots - Step Complexity
4
 
Using multi-writer registers:
 
can be done in 
O(n)
 steps 
[Inoue and Chen, WDAG 1994]
 
and requires 
Ω
(n)
 steps 
[Jayanti, Tan, and Toueg,  SICOMP 1996]
 
Goal:
a faster snapshot implementation (sub-linear)
 
This talk:
snapshot implementation in 
O(log
3
(n))
 steps per operation
 
for polynomially many update operations
(limited-use snapshot object)
5
s
1
s
2
s
3
s
4
s
1
+s
2
s
3
+s
4
s
1
+...+s
4
Array of views
Pointer to array
location
5
Tree structure, Updates help Scans
Polylogarithmic snapshots
6
s
1
s
2
s
3
s
4
s
1
+s
2
s
3
+s
4
s
1
+...+s
4
5
Need to cope with slow
operations: use a 
max
register
Max register: returns largest value
previously written
[Aspnes, Attiya, and Censor-Hillel, JACM 2012]
Polylogarithmic snapshots
7
s
1
s
2
s
3
s
4
s
1
+s
2
s
3
+s
4
s
1
+...+s
4
5
To guarantee that a view
location always holds the same
view, different processes need
to sum up two max registers in
a comparable way
 
2-component max array
p
1
p
2
p
n
max  1
max  2
 
update(
v,1
)
 
scan
8
 
update(
v,2
)
2-component max array
9
Simply reading one max register and then the
other does not work
max  1
max  2
 
1. p
1
 read 0
 
2
.
 
p
2
 
w
r
i
t
e
(
1
0
0
)
 
3. p
3
 read 100
 
4. p
3
 read 0
 
5
.
 
p
2
 
w
r
i
t
e
(
1
0
0
)
 
6. p
1
 read 100
 
p
1
 
returns
(0,100)
 
p
3
 
returns
(100,0)
2-component max array
10
 
Read max registers again to see if they change
Might change many times
What if they were only binary?
(0,0) and (1,1) are comparable with any pair
If you see (0,1) or (1,0) read again
max  1
max  2
1. p
1
 read 0
2
.
 
p
2
 
w
r
i
t
e
(
1
0
0
)
3. p
3
 read 100
4. p
3
 read 0
5
.
 
p
2
 
w
r
i
t
e
(
1
0
0
)
6. p
1
 read 100
Max register – recursive construction
[Aspnes, Attiya, and Censor-Hillel, JACM 2012]
11
MaxReg
k
 supports values in {0,…,k-1}
Built from two MaxReg
k/2
 objects with values in {0,…,k/2-1}
and one additional multi-writer register “switch”
MaxReg
k/2
MaxReg
k/2
MaxReg
k
switch
WriteMax
t
t
 
< k/2 ?
t
t
-k/2
ReadMax
=1
 
= ?
t
t
 
switch=
0
 : return 
t
 
switch=
1
 : return 
t
+k/2
MaxReg
k
 unfolded
12
switch
MaxReg
0
switch
switch
switch
MaxReg
0
MaxReg
0
MaxReg
0
MaxReg
0
MaxReg
k
0
1
2
k-1
Complexity does not depend on 
n
:
WriteMax
 
and 
ReadMax
in
 
O(log
k
)
 
steps
O(log
k
)
 
A 2-component max array
13
MaxReg
k/2
MaxReg
k/2
MaxReg
k
switch
MaxReg
l
MaxReg
l
MaxReg
l
Write
Read
 
switch=
0
 :
 
switch=
1
 :
v,1
v,2
 
x=ReadMax component 2
 
WriteMax(x,2) to left subtree
 
Return (
Read 
left subtree)
 
x=ReadMax component 2
 
WriteMax(x,2) to right subtree
 
Return (k/2,0)+(
Read 
right subtree)
x
x
 
= ?
A 2-component max array
14
MaxReg
k/2
MaxReg
k/2
MaxReg
k
switch
MaxReg
l
MaxReg
l
MaxReg
l
Write
Read
switch=
0
 :
switch=
1
 : 
x=ReadMax component 2
WriteMax(x,2) to left subtree
Return (
Read 
left subtree)
x=ReadMax component 2
WriteMax(x,2) to right subtree
Return (k/2,0)+(
Read 
right subtree)
A 2-component max array unfolded
15
switch
MaxReg
0
switch
switch
switch
MaxReg
0
MaxReg
0
MaxReg
0
MaxReg
0
MaxReg
k
MaxReg
l
MaxReg
l
MaxReg
l
MaxReg
l
MaxReg
l
MaxReg
l
MaxReg
l
MaxReg
l
MaxReg
l
Complexity is
O(log
k 
log
l
)
 
steps
Summary
16
 
For 
b
-limited use snapshot we get 
O(log
2
b logn) 
steps
This is 
O(log
3
(n)) 
steps for polynomially many updates
 
Paper also shows:
Multi-writer snapshot implementation: every process can
update each location
c-component max arrays
 
Open problems:
Snapshot implementations using single-writer registers
Lower bounds
Randomized implementations and lower bounds
Slide Note
Embed
Share

This content discusses various snapshot implementations in distributed systems, focusing on achieving faster and sub-linear snapshot complexity. It covers topics such as multi-writer registers, tree structures, polylogarithmic snapshots, and the challenges of ensuring consistency across processes. The discussion emphasizes the need for efficient algorithms to handle slow operations and maintain synchronized views across different processes.


Uploaded on Sep 23, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Faster than Optimal Snapshots (for a While) James Aspnes, Yale University Hagit Attiya, Technion Keren Censor-Hillel, MIT Faith Ellen, University of Toronto

  2. Snapshot Objects scan update(v) update your location p1 p2 pn 2

  3. Model System of n processes, m multi-writer registers Asynchronous schedule controlled by an adversary Crash failures require wait-free implementations Linearizable implementations R1 R2 Rm read write(v) v ok p1 p2 pn 3

  4. Snapshots - Step Complexity Using multi-writer registers: can be done in O(n) steps [Inoue and Chen, WDAG 1994] and requires (n) steps [Jayanti, Tan, and Toueg, SICOMP 1996] Goal: a faster snapshot implementation (sub-linear) This talk: snapshot implementation in O(log3(n)) steps per operation for polynomially many update operations (limited-use snapshot object) 4

  5. Tree structure, Updates help Scans Array of views Pointer to array location 5 s1+...+s4 s1+s2 s3+s4 s1 s2 s3 s4 5

  6. Polylogarithmic snapshots Max register: returns largest value previously written [Aspnes, Attiya, and Censor-Hillel, JACM 2012] Need to cope with slow operations: use a max register 5 s1+...+s4 s1+s2 s3+s4 s1 s2 s3 s4 6

  7. Polylogarithmic snapshots To guarantee that a view location always holds the same view, different processes need to sum up two max registers in a comparable way 5 s1+...+s4 s1+s2 s3+s4 s1 s2 s3 s4 7

  8. 2-component max array max 1 max 2 update(v,1) update(v,2) scan p1 p2 pn 8

  9. 2-component max array Simply reading one max register and then the other does not work 4. p3 read 0 5. p2 write(100) 6. p1 read 100 1. p1 read 0 2. p2 write(100) 3. p3 read 100 max 1 max 2 p1returns(0,100) p3returns(100,0) 9

  10. 2-component max array Read max registers again to see if they change Might change many times What if they were only binary? (0,0) and (1,1) are comparable with any pair If you see (0,1) or (1,0) read again 4. p3 read 0 5. p2 write(100) 6. p1 read 100 1. p1 read 0 2. p2 write(100) 3. p3 read 100 max 1 max 2 10

  11. Max register recursive construction [Aspnes, Attiya, and Censor-Hillel, JACM 2012] MaxRegk supports values in {0, ,k-1} Built from two MaxRegk/2 objects with values in {0, ,k/2-1} and one additional multi-writer register switch =1 WriteMax t t < k/2 ? = ? switch t-k/2 t ReadMax t t switch=0 : return t MaxRegk/2 MaxRegk/2 switch=1 : return t+k/2 MaxRegk 11

  12. MaxRegk unfolded MaxRegk switch Complexity does not depend on n: WriteMax and ReadMax in O(logk) steps switch O(logk) switch switch MaxReg0 MaxReg0 MaxReg0 MaxReg0 MaxReg0 0 1 2 k-1 12

  13. A 2-component max array Write v,1 v,2 = ? Read switch MaxReg xx x=ReadMax component 2 switch=0 : WriteMax(x,2) to left subtree Return (Read left subtree) MaxRegk/2 MaxRegk/2 switch=1 : MaxRegk MaxReg MaxReg x=ReadMax component 2 WriteMax(x,2) to right subtree Return (k/2,0)+(Read right subtree) 13

  14. A 2-component max array Key idea: a reader going right at the switch always sees a value for component 2 that is at least as large as any value that a reader going left sees Write Read switch MaxReg x=ReadMax component 2 switch=0 : WriteMax(x,2) to left subtree Return (Read left subtree) MaxRegk/2 MaxRegk/2 switch=1 : MaxRegk MaxReg MaxReg x=ReadMax component 2 WriteMax(x,2) to right subtree Return (k/2,0)+(Read right subtree) 14

  15. A 2-component max array unfolded MaxRegk switch MaxReg Complexity is O(logk log ) steps switch MaxReg switch switch MaxReg MaxReg MaxReg0 MaxReg0 MaxReg0 MaxReg0 MaxReg0 MaxReg MaxReg MaxReg MaxReg MaxReg 15

  16. Summary For b-limited use snapshot we get O(log2b logn) steps This is O(log3(n)) steps for polynomially many updates Paper also shows: Multi-writer snapshot implementation: every process can update each location c-component max arrays Open problems: Snapshot implementations using single-writer registers Lower bounds Randomized implementations and lower bounds 16

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#