Mind map
Distributed systems: transactions

Map content
Distributed systems: transactions
Transaction Protocols
- Need higher level abstraction
- Transactions can be completed or be abandoned
Assumptions
- Reliable communication
- Lower layers handle lost messages
- Have strong back up mechanisms (host crashes / disk failures)
- Reliable communication
Properties of transactions
- Atomic
- Transaction indivisible
- Takes pace or doesn't happen at all
- Transaction indivisible
- Consistent
- Maintain system invariants
- E.G. no seat booked for 2 people
- Maintain system invariants
- Isolated
- Concurrent transactions do not interfere
- Sell 2 different seats at same time
- Concurrent transactions do not interfere
- Durable
- Once transaction finished, changes are permanent
- E.G. book confirmation
- Once transaction finished, changes are permanent
- Atomic
Implementation - two methods for working with data
- Private workspace
- Copy files to host executing the transaction
- Copy results back afterwards
- Copy files to host executing the transaction
- Writeahead log
- Modify files locally and log changes
- Can undo changes (unravel)
- Modify files locally and log changes
- Private workspace
Two-phase commit protocol
- AIM to achieve atomicity
- Has coordinator that tells others whether they can enter the critical section
- Have subordinate that is interested in critical section
- Checks with co-ordinator that all others agree with request for entrance
- Central log that has messages
- "Prepare", "Ready" , "commit"
- AIM to achieve atomicity
Concurrency control
- File locking
- Only one file process allowed to access file
- Avoid inconsistency
- First acquire all locks (growing phase), perform operations, release locks (shrinking phase)
- Deadlock possible
- Avoid using global order of files
- If lock not available, release all others and wait for random interval
- Optimistic concurrency control
- Check which files have been written
- Any files written twice then abort transaction
- Use WA log
- Detect problems before committing
- Any files written twice then abort transaction
- Advantage: deadlock free and maximum parallelism (don't hold locks)
- Refinement: Use timestamps and abort only if transaction with higher TS wants to write
- Check which files have been written
- File locking
Dealing with failure
- DS should cope with failure of one site
- Silent failure: host does not respond
- Byzantine: host sends false information
- DS should cope with failure of one site
Failure detection 2-way: handshake protocol
- If answer exceeds timeout then try again
- Give up after fixed number of attempts
- Works for silent failure, not byzantine
- If answer exceeds timeout then try again
Byzantine failure
- Assume processots faulty but communication reliable
- Need to achieve agreement between working processors
- More than 2/3 processors need to be working
- Majority voting
- Every processor sends to other one value of local variable
- Honest processors send real value, faulty ones can send junk
- Processors pass on all values to all others
- Values received judged by each processor based on majority (honest processors should be identified)
- Every processor sends to other one value of local variable
- Need to achieve agreement between working processors
- Assume processots faulty but communication reliable
Images and files in the map
Information
- Description
- Masters Computer Science (OS) Mind Map on Distributed systems: transactions, created by Ar B on 03/05/2016.
- Created by
- Ar B
- Views
- 0
- Rating










