Samstag, 19. Februar 2011

CS6223 Distributed Systems -- assignment

Fault-tolerant Banking System
Team Work (20% of final marks) : 2 students
Due:

1. You are to design and implement a reliable banking system. The system is based on the client/server model where all system functions are provided by servers and clients invoke server’s functions via remote procedure calls (RPC).

To make the system fault-tolerant, there are two replicated servers with the same interface: primary and backup, as shown in the Figure below.

2. The primary and backup servers are located on different machines. On the client side, it is a piece of client program running on the client machine. The client’s request is always first sent to the primary server if it is in service; otherwise it switches to the backup.

3. When the primary server is in service, the backup is passive. Each time when the primary server completes serving an update request, it forwards the request to the backup, so that to keep the backup server’s database up to date. The communication between the two servers is also via RPC (you need to modify stub procedures for this purpose).

4. There is a possibility that the primary fails when serving a request. Upon the detecting out a failure of primary server (i.e., the client receives an error return from RPC), the client program will switch to the backup server. The backup then becomes the primary and the all subsequent requests from the client will be sent to the new primary server.

5. During the time when one server is failed, the working server saves all update requests it has served into a log file. When the failed server recovers, it will obtain this log file from the working server and bring its local database up to date. This recovery operation is also done via RPC. The probability of simultaneous failure of both servers is assumed to be negligible.

To simulate the failure of the server program, you may explicitly kill a server process. You may restart a server program as the simulation of a server’s recovery from a failure. The client program knows the addresses of both primary and backup servers.

6. The bank database is implemented as a structured file. Each file record is for a customer’s account information. Note: the primary server and backup server should use different files to store their data. For simplicity each record only consists of the following information:
account name;
account number;
balance;

The Client program repeatedly displays the following menu on the screen (text interface):

1. balance
2. transfer
3. exit (program)

After serving each request, it should return to this menu for the next user, a user chooses the exit, which terminates the program.

7. For unspecified design and implementation details, make your own reasonable assumptions and decisions.


Testing. Your server program will run on machines S1 and S2, and your client program on C1. You need to test your programs in the following steps:
a) normal cases where both servers are working;
b) kill the server on S1. The client should automatically switch to the server on S2;
c) restart S1. The data on S1 should be automatically brought up to date.
d) kill the server on S2. The client should automatically switch to the server on S1.


8. Demonstration. You need to demonstrate your program at the specified time on the due date (NO late submission allowed).

Submit the following at demonstration time:

1. a copy of design document (3 pages maximum), including your names (or student IDs), system structure, design strategies, implementations, and testing results.
2. a copy of full program listing.

Your assignment will be evaluated based on the following criteria:
• documentation and design of the client/server system (25%)
• implementation (source code) and programming styles (75%)



1 Kommentar:

Anonym hat gesagt…

leave the code plz