



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




To ensure replicas end up in the same state
Tag each data item with a timestamp
A transaction updates the value and timestamp of data items(timestamps monotonically increase)
An update to a replica is applied only if the update’s timestampis greater than the data item’s timestamp
You only need timestamps of data items that were recentlyupdated (where an older update could still be floating aroundthe system)
All multi-master products use some variation of this
Robert Thomas,
, June ’
Same article that invented majority consensus
1
: read x=0 (TS=0)
1
Initially x=0,TS=0Send (X=1, TS=1)
1
: read x=0 (TS=0) T
2
Send (X=1, TS=1)
Send (X=2, TS=2)
Replicas end in the same state, but neither T
1
nor T
2
reads
the other’s output, so the execution isn’t serializable.
Send (X=2, TS=2)
Multi-master replication without a primary
Each row R of a table has 4 additional columns
globally unique id (GUID)
generation number, to determine which updates from otherreplicas have been applied
version number = the number of updates to R
array of [replica, version number] pairs, identifying the largestversion number it got for R from every other replica
Uses Thomas’ write rule, based on version numbers
Access uses replica id to break ties. SQL Server 7 usessubscriber priority or custom conflict resolution.
Each replica has a current generation number
A replica updates a row’s generation numberwhenever it updates the row
A replica knows the generation number it had when itlast exchanged updates with R´, for every replica R´.
A replica increments its generation number everytime it exchanges updates with another replica.
So, when exchanging updates with R
, it should send
all rows with a generation number larger than what ithad when it last exchanged updates with R
Non-transactional replication using timestampedupdates and variations of Thomas’ write rule
directory services are managed this way
Quorum consensus per-transaction
Read and write a quorum of copies
Each data item has a version number and timestamp
Each read chooses a replica with largest version number
Each write increments version number one greater than anyone it has seen
No special work needed during a failure or recovery