Test #2 - Client switches over and binds to backup replica when primary fails

Functionality
Fault-Tolerant Baseline

Use Case
When you are performing an operation with the client and the server you were communicating with fails, the client will automatically connect to a replicated server.

Test Distribution
All details about setting-up the environment and running the application are given in Building the Fault-Tolerant Baseline Application. It is assumed that the environment is working and that you have everything compiled correctly.

Test Sequence

  • Launch the replication manager:
    java Replication.UniReplication -ORBInitialHost localhost -ORBInitialPort 1500

  • Launch the client:
    java Client.UniClient -ORBInitialHost localhost -ORBInitialPort 1500

  • Perform an operation on the client, in the replicas status window you will see that the client is bound to this server and the transaction taking place.

  • Now kill the primary replica

  • In the client, execute another command to the server
You will notice that when the primary replica is killed, its icon in the replication manager is shaded grey, indicating that this replica is no longer active. After it is re-launched its icon will be shaded green indicating that it is active, but not the primary replica. The replica immediately to its right will now be shaded red indicating that this is the new primary. When you execute the command on the client, you can now switch over to the new primary replicas status window and you will see that the client has rebound to it. For each server that is killed the client will rebind to the next available replica. This can all be easily monitored by simply looking at the status window of the new replica.