Synchronization Sequence

Putting together all the parts indicated in the previous section (see Read and Write Locks), the full synchronization sequence is:

1.  RPC Manager obtains a Write lock on the client.

2.  When the Write lock has been obtained, RPC Manager launches GetClientRevision() on the client, into the service scope and on the service's thread.

3.  RPC Manager launches GetClientChanges() on the client, into the service scope and on the service's thread. This is done after step 2, but RPC Manager does not wait for GetClientRevision to complete before launching GetClientChanges().

4.  RPC Manager then waits for both GetClientRevision() and GetClientChanges() to terminate (by slaying themselves, or by returning Invalid), and then sends the client revision and changes streams to the server.

5.  RPC Manager on the server, obtains either a Read or a Write lock, depending on whether there is a client changes stream.

6.  When the lock has been obtained, RPC Manager launches GetServerChanges() on the server.

7.  When GetServerChanges() terminates (by slaying itself, or by returning Invalid), RPC Manager queues the RPC package from GetServerChanges() for transmission to the client. If an RPC package was received from the client, RPC Manager (on the server), now processes that call package, calling the RPC subroutines within the package, and then waits for SetSyncComplete() to be called on the server.

8.  RPC Manager (on the client) executes the RPC package from the server and waits for the client service instance to call SetSyncComplete(). When SetSyncComplete() is called, the client instance is marked as ready, and the Write lock obtained in 1, is released.

9.  When the server sees the client instance marked as ready (and step 7 (above) has completed), any "diverted" RPCs from the service are queued for transmission to the client and synchronization terminates, clearing the Read or Write lock that was obtained in step 5 above.

Topics in this section:

Alternate Status

Sticky Status

Preventing Synchronization with Lower-Order Servers

Server Evaluation Rules