update parallelism
play

Update Parallelism April 30, 2018 1 HW 3 Posted 2 Parallelism - PowerPoint PPT Presentation

Update Parallelism April 30, 2018 1 HW 3 Posted 2 Parallelism Models Option 4: Shared Nothing in which all communication is explicit. CPU Memory Disk Well be talking about shared nothing today. Other models are easier


  1. Failure Modes Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” Node “Commit” unreceived: (1) Re-sent “Prepare” can be ignored. (2) Node still able to abort. 55

  2. Failure Modes Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” CRASH! 56

  3. Failure Modes Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” CRASH! Node 2 crashes after responding: Restart from log 56

  4. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” “ACK” 57

  5. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” “ACK” Coordinator “Commit” unreceived: Commit must happen, coordinator resends 57

  6. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” CRASH! “ACK” 58

  7. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” CRASH! “ACK” Node 2 crash: Restart. Already logged “Commit” message, so all is well. 58

  8. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” “ACK” “ACK” 59

  9. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” “ACK” “ACK” Node “Ack” unreceived: Ok. Resent “Commit” ignored by node 59

  10. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” “ACK” “ACK” CRASH! 60

  11. Failure Cases Coordinator Node 1 Node 2 “Prepare” “Commit” “Commit” We are go for Commit “Commit” “ACK” “ACK” CRASH! Node crash after “Ack”: Ok. Log already recorded commit 60

  12. Replication • Mode 1 : Periodic Backups • Copy the replicated data nightly/hourly. • Mode 2 : Log Shipping • Only send changes (replica serves as the log). 61

  13. Replication • Mode 1 : Periodic Backups • Copy the replicated data nightly/hourly. • Mode 2 : Log Shipping • Only send changes (replica serves as the log). 61

  14. Replication • Ensuring durability • Ensuring write-consistency under 2PC • Ensuring read-consistency without 2PC 62

  15. Ensuring Durability When is a replica write durable? 63

  16. Ensuring Durability Never. 64

  17. Ensuring Durability Never. What you should be asking is how much durability do you need? 64

  18. Ensuring Durability For N Failures N+1 Replicas (Assuming Failure = Crash) 65

  19. Ensuring Write Consistency Coordinator Node 1 “Prepare” “Commit” Node 1 asserts that the commit is durable! What if Node 1 fails? 66

  20. Ensuring Write Consistency Coordinator Node 1 Replica “Prepare” “Prepare” “Commit” “Commit” 67

  21. Ensuring Write Consistency Coordinator Node 1 Replica “Prepare” “Prepare” “Commit” “Commit” Waiting for Node 1 to replicate is slooooow! Let the coordinator take over! 67

  22. Ensuring Write Consistency Coordinator Node 1 Replica “Prepare” “Commit” “Commit” 68

  23. Ensuring Write Consistency Coordinator Node 1 Replica “Prepare” “Commit” “Commit” Like 2PC… … but better. We may not need to wait for the replica 68

  24. Ensuring Write-Consistency Coordinator Coordinator Alice Bob A: Prepare A: Prepare A: Prepare B: Prepare B: Prepare B: Prepare Replica 1 Replica 2 Replica 3 69

  25. Ensuring Write-Consistency Coordinator Coordinator Alice Bob B: Prepare B: Prepare A: Prepare A: Prepare A: Prepare B: Prepare Replica 1 Replica 2 Replica 3 70

  26. Ensuring Write-Consistency Coordinator Coordinator Alice Bob B: Prepare B: Prepare A: Prepare Commit! Commit! Replica 1 Replica 2 Replica 3 71

  27. Ensuring Write-Consistency Majority Vote N Replicas ( N / 2 )+1 Votes Needed 72

  28. Ensuring Read Consistency Forget transactions, let’s go back to reads & writes Can we do better than 2PC if we don’t need xacts? 73

  29. (1) Alice writes ‘A’ Replica 1 W(A = 3) Replica 2 Replica 3 74

  30. (1) Alice writes ‘A’ Replica 1 W(A = 3) Replica 2 Replica 3 (2) Alice tells Bob 75

  31. (1) Alice writes ‘A’ (3) Bob reads ‘A’ Replica 1 W(A = 3) R(A) Replica 2 Replica 3 (2) Alice tells Bob 76

  32. (1) Alice writes ‘A’ (3) Bob reads ‘A’ Replica 1 W(A = 42) R(A) Replica 2 What can we do to guarantee Replica 3 that Bob will (2) Alice tells Bob see the 42? 77

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