Title: Fundamentals Stream: Lecture 4
1Fundamentals Stream Lecture 4
- Overview of Lecture
- Group communication
- Introducing group communication
- Focus on reliability and ordering
- Support for availability
- Active and passive replication
- Distributed transactions
- Fundamentals of transactions
- Added complexity of distribution
- Additional reading
- CDK chapter 11, section 11.4, chapter 14,
sections 14.1-14.2 - CDK chapters 12, 13
2Introducing Group Communication
- What is group communication?
- Enables the multicasting of a message to a group
of processes as a single action - Sender is unaware of the destinations for the
message - Why group communication?
- Support for replication/ fault tolerance
- Support the efficient dissemination of data
3A Typical Group Service
PROCEDURE groupCreate() groupID //
creates a new group and returns the groups
UID PROCEDURE groupJoin(group groupID, port
portID) // adds the named port to the
named group PROCEDURE groupLeave(group groupID,
port portID) // removes the named port
from teh named group PROCEDURE multicast(order
orderType, group groupID, m msg, nRepliesint,
replies ARRAY of msg) // multicasts a
message to the named group with // the
specified delivery semantics, and //
optionally collects a number of replies
Crucial issue of delivery semantics (reliability,
ordering
4Reliability Guarantees
- Unreliable multicast
- Message sent to all members and may or may not
arrive - Reliable multicast
- Reasonable efforts are made to ensure delivery
- Can be based on positive or negative
acknowledgement schemes - Atomic multicast
- All members receive message, or none do
5Implementing Atomic Multicast
1. Originator sends a message to each member of
the group, and awaits acknowledgements 2. If
some acknowledgements are not received in a given
period of time,re-send message repeat this n
times if necessary 3. If all acknowledgements
received then report success
else remove offending members(s) from
group 4. Each member must monitor the
originator On failure -gt elect a
new 'originator' 5. Each member must also
monitor for completion -gt Await
arrival of a next message from the
same originator to indicate previous
multicast completed
6Ordering Guarantees
- Unreliable multicast
- Messages sent from different processes may be
delivered in different orders at different sites - Totally ordered multicast
- Consider messages m1 and m2 sent to the group by
(potentially) different processes - Either m1 will be delivered before m2 or vice
versa for all members of the group - Causally ordered multicast
- As above, except the ordering of m1 and m2 is
only important if a happened-before relationship
exists between the messages
7Implementing Total Ordering
- The sequencer approach
- Other approaches
- Distributed agreement to generate ids (as in
Isis) - Assign timestamps from a (global) logical or
physical clock
1. All requests must be sent to a sequencer,
where they are given an identifier 2. The
sequencer assings consecutive increasing
identifiers as it receives requests 3. Requested
arriving at sites are held back until they are
next in sequence
8Total Ordering vs Causal Ordering
9Example Isis
- What is Isis?
- A framework for reliable distributed computing
based on process groups - Offers a range of delivery semantics
- Unordered (FBCAST), causally ordered (CBCAST),
totally ordered (ABCAST), etc - Also provides group-view management and state
transfer on join - Status
- A successful product
- Ongoing research on Horus, Ensemble, Java Groups
10Introducing Replication
- Why replicate?
- Performance
- E.g. replication of heavily loaded web servers
- Availability
- availability 1-pn (where n no of replicas, p
probability of individual failure) - Requirements for a replication service
- Replication transparency ...
- in spite of network partitions, disconnections,
etc.
11Focus on Availability
12A Generic Replication Architecture
13Passive Replication
- What is passive replication (primary backup)?
- FEs communicate with a single primary RM, which
must then communicate with secondary RMs (slaves) - Requires election of new primary in case of
primary failure
14Active Replication
- What is active replication?
- FEs multicast requests to every RM, using an
appropriate reliable group communications
protocol, also offering ordering guarantees
15Alternative Approach 1 Gossip Protocols
- What is a gossip protocol?
- An approach to replication designed to provide
high availability - Replication strategy
- Clients send queries and updates to any RM
- Updates are carried out immediately on the chosen
RM then are propagated in a lazy fashion (using
gossip messages) - Queries may be blocked to maintain desired level
of integrity
16Alternative Approach 2 The Coda File System
- What is Coda?
- A distributed file system, based on AFS
- Designed esp. for disconnected operation
- Replication strategy
- File system consists of n volume storage groups
- Whole files also cached (and hoarded) locally
- Optimistic replication strategy in that files may
be modified (in cache) when disconnected - Conflicts detected for manual repair
17Introducing Atomic Transactions
- What is a transaction?
- Ensures that a set of objects can move from one
consistent state to another in spite of
concurrent access and partial failure
(concurrency and recovery transparency) - ACID properties
- Atomicity - all or nothing
- Consistency - moving between consistent states
- Isolation - dealing with concurrency
- Durability - permanence of results
See also FOCS course on databases
18Approaches to Concurrency Control
- Locking (pessimistic concurrency control)
- Requires use of two-phase locking to ensure
serial equivalence - Potential problem of deadlocks
- Optimistic concurrency control
- Assumes that conflicts will not occur
- Check status at commit time, and abort erroneous
transactions - Timestamp ordering
- Validate each operation as it is carried out
depending on timestamp value
19Recovery
- Undo logs (optimistic approach)
- Make changes to the original data, and maintain
log of inverse operations (undo log) - On failure, execute undo log operations to last
checkpoint - Intentions logs (pessimistic approach)
- Record required operations in a log
- On commit, ensure log is executed in entirety
- Shadow versions (also pessimistic)
- Make changes to shadow version and make visible
on commit
20Distributed Transactions
- What is a distributed transaction?
- A transaction where operations involve multiple
servers - Issues
- Need distributed algorithms for concurrency
control and recovery schemes mentioned above - Must deal with added difficulty of distributed
deadlock - Crucial issue of atomic commit protocols
21The Two-phase Commit Protocol
22The Two-phase Commit Protocol (continued)
23Transactional Middleware TP Monitors
- Standards
- X/Open DTP, OMG Corba OTS
- Key products
- IBMs CICS and Encina (Transarc)
- BEAs Tuxedo
- Microsofts MTS (included in COM)
- SUNs Enterprise JavaBeans (see lecture 4)
24Expected Learning Outcomes
- You should be able to appreciate the relative
roles of group communications, replication
strategies and atomic transactions in supporting
more robust distributed applications - You should understand the basic principles
underpinning group communication, including
techniques for reliability and ordering - You should also understand the basic principles
behind replication strategies including active vs
passive replication
25Expected Learning Outcomes (continued)
- You should appreciate the potential role of group
communication protocols in supporting replication
management - You should have an understanding of the impact of
distribution on atomic transactions and also a
general appreciation of the various techniques
employed
26Exam Question of the Week
- A) Discuss the motivation for introducing
replication in a distributed system and comment
on how replication can enhance the three-tier
approach to distributed systems design.
4 marks - B) Describe the service offered by a typical
group communications protocol, and explain
carefully the role of such a protocol in
supporting replication management. Discuss in
detail the potential semantics offered by a group
communications protocol with emphasis on the
options for reliability and ordering.
10 marks - C) Briefly outline the replication strategy
underpinning Coda, and explain how this approach
can be exploited to support mobile users.
6 marks