Professional Documents
Culture Documents
NEWCASTLE UNIVERSITY
Assessment 2
DISTRIBUTED SYSTEMS
Instructions to candidates:
Answer ALL questions
The total marks available for this exam are 100
Marks shown for sub-sections are indicative only
[Turn Over]
[CSC3121]
Question 1.
(Both parts of this question require familiarity with the
implementation of “at most once” RPC system discussed in
lectures – e.g., see #rpc28.)
a) Consider an RPC system in which clients initiate their calls
with call sequence numbers which are also included when
clients retry their calls after a timeout. The server maintains
in its main memory the final results computed for the latest
RPC received from each client and returns the results if a
call is detected to be a retry. Assume that (i) the clients
never crash, (ii) the server can crash and a crashed server
recovers after some time and (iii) no communication failure
occurs. Identify the type of semantics guaranteed by this
RPC system and explain the reasons for your answer.
[5 marks]
b) Suppose that communication failures do not permanently
block inter-process communication and that any crashed
node eventually recovers. Using the principles of the two-
phase commit protocol, describe an RPC implementation
scheme that would guarantee “exactly once” RPC
semantics when both the server and the client nodes are
prone to crashing. [15 marks]
Hints: As in two-phase commit protocol, you can assume
that each node has a recovery manager and maintains in
its crash-proof store a ‘log’ with atomic-write capability. You
can also assume that an RPC involves only one server and
does not lead to making another RPC in another server.
Page 2 of 7
[CSC3121]
Question 2.
(Based on the formative assessment whose model answer was
discussed on Monday of week 15)
a) A total order message delivery service is to be built for a
system of at least 4 distributed processes. The following
five assumptions should be made:
A1) Processes have access to synchronised physical
clocks; for the sake of simplicity, perfect clock
synchronisation can be assumed i.e., the synchronisation
error can be assumed to be zero;
A2) The underlying communication subsystem guarantees
that a sent message is delivered to every destination, with
a minimum delay of d and with a maximum delay being
finite but unknown; thus, if a process sends m at time t1 as
per its local clock, m will be received at some time t 2 as per
the destination process’ local clock and t2 ≥ t1 + d.
A3) For any two processes, say, p1 and p2, messages
sent by p1 to p2 are received in the sent order;
A4) Sending of a given message to one or more
destinations is a single event within the sending process
and a message is stamped with the sending time according
to the sending process’ clock; and,
A5) Processes never crash and their identifiers are
uniquely ranked; this ranking is known to all processes.
The service must satisfy the following three conditions in
delivering the received messages to processes:
(C1) Suppose that messages m and m' are sent to a
process, say p1. If sending of m happens before sending of
m', then m is delivered to p1 before m' is delivered.
[Turn Over]
[CSC3121]
Page 4 of 7
[CSC3121]
no S1 S1
commit
yes S2 S2
C C commit
yes
S3 S3
(i) (ii)
yes S1
yes S2
C
yes
S3
(iii)
(i) Fig. (i): In phase one, the three servers respond to the co-
ordinator as shown. Then S2 crashes before it receives the
decision from the co-ordinator.
[Turn Over]
[CSC3121]
c
P Q
c'
Page 6 of 7
[CSC3121]
Global P c c’ Q
State
S1 <m1, m2, ? ? <M1,
M1> m1>
S2 ? <> <M2> ?
S3 <m1, m2, M1, ? <M3> ?
M2>
S4 ? <m3> ? <M1,
m1, m2,
M2, M3>
END
[Turn Over]