Network Partitions-Distributed and Parallel Data Management-Lecture Slides, Slides of Distributed Database Management Systems

Prof. Jitesh Bhaskar delivered this lecture for Distributed and Parallel Data Management course at Dhirubhai Ambani Institute of Information and Communication Technology. Its main point are: Network, Partitions, Data, Replication, Quorums, Commit, Protocol, Blocking, Transactions, Vote, Assignments

Typology: Slides

2011/2012

Uploaded on 07/16/2012

sambandam
sambandam 🇮🇳

4.3

(37)

154 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
5/7/2012
2
CS347 Notes11 7
Quorums can be implemented with vote
assignments
To commit 3
To abort 2
Votes to commit + votes to abort > total votes
1
1
1
1
.a
b..c
.d
CS347 Notes11 8
Commit protocol must enforce quorum
. b
a . . c
. d
If node knows transaction could have
committed (aborted), it cannot abort (commit)
even if abort (commit) quorum available
All commit protocols are blocking (with
network partitions)
can we do anything about it?
CS347 Notes11 9
3PC Example
To make commit decision: commit quorum
To make abort decision: abort quorum
•Example:
votes for commit VC= 3
votes for abort VA= 3
2
1
1
1
w
w
w
old
coordinator
new coordinator
CS347 Notes11 10
2
1
1
1
w
w
w
old
coordinator
new coordinator
VC= 3; VA= 3
Coordinator could NOT have committed
•Have abort quorum
Try to abort!
CS347 Notes11 11
Note: need to go to Prepare to Abort
state (PA), analogous to Prepare to
Commit state (PC)
1
1
1
w
w
w
w
PA
PA
PA
PA
PA
PA
PA
A
A
A
A
time
CS347 Notes11 12
What if new group has following states?
1
1
1
w
PC
PA
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Network Partitions-Distributed and Parallel Data Management-Lecture Slides and more Slides Distributed Database Management Systems in PDF only on Docsity!

CS347 Notes11 7

  • Quorums can be implemented with vote

assignments

To commit  3

To abort  2

Votes to commit + votes to abort > total votes

1. a

b..^ c

. d

CS347 Notes11 8

  • Commit protocol must enforce quorum

. b

a.. c

. d

  • If node knows transaction could have

committed (aborted), it cannot abort (commit)even if abort (commit) quorum available

  • All commit protocols are blocking (with

network partitions)

  • can we do anything about it?

CS347 Notes11 9

3PC Example

  • To make commit decision: commit quorum
  • To make abort decision: abort quorum
  • Example:
    • votes for commit V C = 3
    • votes for abort VA = 3

2

w w w

coordinatorold new coordinator CS347 Notes11 10

w w w

coordinatorold new coordinator

VC = 3; VA = 3
  • Coordinator could NOT have committed• Have abort quorum
 Try to abort!

CS347 Notes11 11

  • Note: need to go to Prepare to Abort

state (PA), analogous to Prepare to

Commit state (PC)

w w w

w P A P A

P A
P A
P A
P A
P A
A
A
A
A

time CS347 Notes11 12

  • What if new group has following states? 1 1 1

w P C P A

CS347 Notes11 13

  • What if new group has following states? 1 1 1

w P C P A

  • Can this happen? How?• Could transaction have aborted?
  • Could transaction have committed?• What do we do? Block? CS347 Notes11 14
P

w w

coordinatorold new coordinator

VC = 3; VA = 3

Another 3PC Example

CS347 Notes11 15

P

w w

coordinatorold new coordinator

VC = 3; VA = 3
  • Coordinator could not have aborted• Have commit quorum
 Try to commit!

Another 3PC Example

CS347 Notes11 16

P

w w

coordinatorold new coordinator

VC = 3; VA = 3

Yet Another 3PC Example

CS347 Notes11 17

P

w w

coordinatorold new coordinator

VC = 3; VA = 3
  • Not enough votes!  Block!

Yet Another 3PC Example

CS347 Notes11 18

Not all quorums can be implemented via votes

C 2 = {{a,b}, {c,d}}

A 2 = {{a,c}, {a,d}, {b,c}, {b,d}}

a

b d c

CS347 Notes11 25

Note

  • Note: not all coteries have vote assignments

CS347 Notes11 26

Note

  • Note: not all coteries have vote assignments

Nodes = {a,b,c,d,e,f}

C = { {a,b}, {a,c,d}, {a,c,e}, {a,d,f},

{a,e,f}, {b,c,f}, {b,d,e} }

CS347 Notes11 27

A Problem

Example: a 3 node system, 1 vote each

node, replicated data

Now: T 1. a T 1 is committed at a,b

T 1. b. c

CS347 Notes11 28

Later: T 1. a T 2 reads at c

(not seeing T 1 );

. b. c then writes and commitsat a, c

CS347 Notes11 29

Solution

  • each node keeps list of committed transactions
  • compare list at read site with those at write sites
  • update sites that missed transactions

CS347 Notes11 30

Example Revisited

Initially

T 0,T 1. a

T 0 ,T 1. b. c

T 0

CS347 Notes11 31

T 0,T 1. a T 2 Coordinator

T 0 ,T 1. b. C READ List = T 0

T 0

CS347 Notes11 32

T 0,T 1. a T 2

T 0 ,T 1. b. C “EXEC” List = T 0

T 0

“EXEC” List = T

CS347 Notes11 33

T 0,T 1. a T 2

T 0 ,T 1. b. C Get new data(T 1) from a!

T 0
NOK!

CS347 Notes11 34

  • Each node must keep updates for

transactions until all nodes have seen

them

  • interesting problem...

CS347 Notes11 35

DB 3

DB o DB 1 DB 4

DB 2

Separate Operational Groups

CS347 Notes11 36

For integration

(1) Compensate transactions to make

schedules match

(2) Data-patch: semantic fix

CS347 Notes11 43

For X: site 1 winsFor Y: latest timestamp wins
For Z: add increments
a
b 5 ts=

xy z

c
d 7 ts=

xy z

e
xyz f ts=

both copies site 2

site 1

c
f 8 ts=

xy z

both copies(integrated)

8 = 5 + site 1 incrementfor Z:

  • site 2 increment = 5 + 2 + 1 CS347 Notes11 44

Network Partitions: Summary

  • No replicated data
    • abort, commit quorums
    • commit protocols
  • Replicated data
    • at most one operational group
      • coterie
      • propagation of updates
    • multiple operational groups