-
Notifications
You must be signed in to change notification settings - Fork 736
Databus 2.0 Client State Machine
Following 2 diagrams depict the sequence of events and state transitions involved for getting Databus events from the Relay server to the Event Buffer
- First diagram gives the overview of the initiation sequence.
- Second diagram details the actual flow of event records.
OVERVIEW
REQUEST STREAM (RELAY) #CUSTOM_ID REQUEST_STREAM_RELAY
The high level description is as follows:
- On client startup the state is in PICK SERVER. The client attempts to establish connection with a random relay. It does this until MAX_RETRIES. After this an exception is created
- After a relay is selected, the client goes into Request sources state and retrieves the source list from the server (relay).
1+. Source match error: If the source ID check in the received response (including the order of sources) is incorrect, the client switches back to Pick Relay state.
- After this step, the client goes into Request Register state (Register for sources). As before, if the received source schema size is wrong, the state is switched back to Pick Server.
- If the source list and schema is correct, set up the Generic dispatcher to start dispatching events received over the stream.
- At this point, the state is switched to one of the following modes (depending on config)
1+ BOOTSTRAP 1+ REQUEST STREAM
REQUEST STREAM events (brief description):
- NULL Relay filter : Relay filter is undefined. In this case, initialize the relay filter from the config (in addition do merging and de-dup)
- NULL channel : Signifies that connection to the Relay server (picker earlier) is lost. Signal an exception to the end client to restart the process.
Following diagram depicts the failure handling:
For most of the requests to the Relay server, there are two kinds of errors that might occur:
- Request error : An error occured during the HTTP request.
- Response error : An error occured during the HTTP response.
Following 2 diagrams depict the sequence of events and state transitions involved for getting the client bootstrapped
- First diagram gives the overview of the initiation sequence.
- Second diagram details the actual flow of event records (snapshot and catchup).
OVERVIEW
REQUEST STREAM (BOOTSTRAP)
The high level description is as follows:
- If a valid checkpoint does not exist, it is reset to the Window SCN. Either ways, proceed to select a bootstrap server (Selection is similar to that of relay servers).
- After connecting to a bootstrap server, if there is no valid resume checkpoint, the client requests the start SCN from the server.
OVERVIEW
DATA EVENT PROCESSING