2020 2021 http www cslab ece ntua grcoursesdistrib
Αντίγραφα Κατανεμημένα Συστήματα 2020 -2021 http: //www. cslab. ece. ntua. gr/courses/distrib 17/12/2021 Big Data related projects
View synchronous επικοινωνία • View Synchronous Communication = Group Membership Service + Reliable multicast • "What happens in the view, stays in the view" 17/12/2021 Big Data related projects
Παραδείγματα a (allowed). b (allowed). p crashes p p q q r r view (p, q, r) view (q, r) c (disallowed). view (p, q, r) d (disallowed). p crashes p p q q r r view (p, q, r) 17/12/2021 Big Data related projects view (q, r) view (p, q, r) view (q, r)
Παράδειγμα Client 1 Client 2 set. Balance. B(x, 1) set. Balance. A(y, 2) get. Balance. A(y) -> 2 get. Balance. A(x) -> 0 O Replica Manager B πεθαίνει αμέσως μετά το set. Balance. B(x, 1) 17/12/2021 Big Data related projects
Θέματα linearizability • Clear-cut (black---write & red---read) • Not-so-clear-cut (parallel) – Case 1: – Case 2: – Case 3: 17/12/2021 Big Data related projects
Θέματα linearizability • Εγγύηση • Χαλαρή εγγύηση σε αλληλοεπικάλυψη • Case 1 • Case 2 • Case 3 17/12/2021 Big Data related projects
Chain Replication • One technique to provide linearizability Reads Writes N 0 Head 17/12/2021 Big Data related projects N 1 Replies N 2 Tail
Παραδείγματα • Example 1 Legit – – P 1: a. write(A) P 2: a. write(B) P 3: a. read()->B a. read()->A P 4: a. read()->B a. read()->A W 2(x)b R 3(x)b R 4(x)b W 1(x)a R 3(x)a R 4(x)a • Example 2 not legit – – P 1: a. write(A) P 2: a. write(B) P 3: a. read()->B a. read()->A P 4: a. read()->A a. read()->B W 2(x)b R 3(x)b W 1(x)a R 4(x)a R 3(x)a R 4(x)b 17/12/2021 Big Data related projects
Παράδειγμα 1 Causally related P 1: Concurrent writes W(x) 3 W(x)1 P 2: P 3: P 4: R(x)1 W(x)2 R(x)1 R(x)3 R(x)2 R(x) 3 This sequence obeys causal consistency 17/12/2021 Big Data related projects
Παράδειγμα 2 • Causally consistent? Causally related P 1: W(x)1 P 2: P 3: P 4: • No! 17/12/2021 Big Data related projects R(x)1 W(x)2 R(x)1 R(x) 2
Παράδειγμα 3 • Causally consistent? P 1: W(x)1 P 2: P 3: P 4: • Yes! 17/12/2021 Big Data related projects W(x)2 R(x)1 R(x) 2
FIFO consistency • Writes of a single process are seen by all other processes in the order in which they were issued, but writes of different processes may be seen in a different order by different processes. • In other words: There are no guarantees about the order in which different processes see writes, except that two or more writes of the same process must arrive in order (that is, all writes generated by different processes are concurrent). 17/12/2021 Big Data related projects
Παράδειγμα FIFO • A valid sequence of events of FIFO consistency • Guarantee: – writes from a single source must arrive in order – no other guarantees. Easy to implement! 17/12/2021 Big Data related projects
Consistency under network partition • Το βασικό πρόβλημα εδώ είναι το network partition Client + front end T withdraw(B, 4) Network partition Client + front end U deposit(B, 3); B B 17/12/2021 Big Data related projects B Replica managers B
Παράδειγμα 17/12/2021 Big Data related projects
Συνέχεια 17/12/2021 Big Data related projects
Multicast Κόμβος με πληροφορία που πρέπει να μοιραστεί με όλους Distributed Group of “Nodes”= Processes at Internetbased hosts 17/12/2021 Big Data related projects
Fault-Tolerance και Scalability Multicast sender X X Multicast Protocol 17/12/2021 Big Data related projects Κόμβοι μπορεί να αποτύχουν n Πακέτα μπορεί να χαθούν n Χιλιάδες κόμβοι n
B-Multicast Η απλούστερη υλοποίηση n Προβλήματα; n UDP/TCP packets 17/12/2021 Big Data related projects
R-Multicast Αυστηρότερες εγγυήσεις n nΤο UDP/TCP packets 17/12/2021 Big Data related projects οverhead είναι ανάλογο του Ν 2
Μια άλλη προσέγγιση Multicast sender 17/12/2021 Big Data related projects
Μια άλλη προσέγγιση Periodically, transmit to b random targets 17/12/2021 Big Data related projects Gossip messages (UDP)
Μια άλλη προσέγγιση Other nodes do same after receiving multicast 17/12/2021 Big Data related projects Gossip messages (UDP)
Μια άλλη προσέγγιση 17/12/2021 Big Data related projects
“Gossip” (or “Epidemic”) Multicast Infected Protocol crounds (local clock) b random targets per round Gossip Message (UDP) Uninfected 17/12/2021 Big Data related projects
Gossip για ανίχνευση σφαλμάτων pi Using gossip to spread heartbeats gives better accuracy All-to-all heartbeating • Κάθε διεργασία στέλνει heartbeat σε όλες τις άλλες • Μείον: Μια αργή διαδικασία δημιουργεί false positives 17/12/2021 Big Data related projects 64
Gossip για ανίχνευση σφαλμάτων 1 10118 64 2 10110 64 1 10120 66 3 10090 58 2 10103 62 4 10111 65 3 10098 63 4 10111 65 2 1 Address Time (local) Heartbeat Counter 4 Πρωτόκολλο: • Οι διεργασίες περιοδικά επικοινωνούν με gossip τη λίστα μελών • Κατά την παραλαβή ενημερώνονται οι τοπικές λίστες 17/12/2021 Big Data related projects 3 1 10120 70 2 10110 64 3 10098 63 4 10111 65 Current time : 70 at process 2 (asynchronous clocks)
Gossip για ανίχνευση σφαλμάτων • Αν κάποια διεργασία σβηστεί αμέσως μετά από Tfail seconds? 1 10120 66 2 10110 64 1 10120 66 3 4 10098 10111 75 50 65 2 10103 62 4 10111 65 3 10098 55 2 1 • Fix: Το κρατάει για άλλα Tfail • Αγνοούνται τα gossip μηνύματα για μέλη που έχουν πεθάνει 4 10111 65 3 17/12/2021 Big Data related projects Current time : 75 at process 2 4
- Slides: 68