Messages
T_ACK
T_ACK message is sent from server to the client.
T_ACK message is to reply the request message.
The fields will depend on the request.
T_INIT
It is used to exchange the parameters with the quorum server.
When
When client (quorum plugin) connects to quorum server, the first message is T_INIT.
Fields
- cl_name : the name of the cluster which the client belong to
- t_timeout : the timeout value of the client
- t_giveup : how long will take for the client to give up all it's resources
- client_id : (optional) the id of the client
Server Actions
- add a new client to the cluster named with cl_name. if there is a client_id field, use the existing client with the same id
- reply the message with the timeout of cluster
- start a remove-client timer with the value of client's timeout, the action of the timer is to remove the client
Expect Reply
- result : "fail" or "ok"
- timeout : the timeout value of the server
- client_id : the id of the client
Client Actions
- record the timeout of cluster, and the client_id
- start a periodic timer to send T_QUORUM message to server
T_QUORUM
It is used to get the the quorum information from the quorum server. And same time, it's a kind of heartbeat to tell the server that the client is alive.
When
A periodic timer will invoke the sending of T_QUORUM message after T_INIT message successed.
Fields
None
Server Actions
- calculate the quorum of the cluster
- if the quorum is not changed, reply the quorum to the client
- if the quorum changed, change to wait_for_change status. the status will last for timeout+giveup of the client which takes the quorum. during this period, all T_QUORUOM message will be replied with NO_QUORUM.
- restart the remove-client timer for the client.
Expect Reply
- result : "fail" or "ok"
- quorum : 0 or 1
Client Actions
- store the quorum status
T_BRB
Tell the quorum server that current connection will be broken but will come back soon.
When
When the leader of the partation will change soon.
Fields
- t_brb : how long will take for the client to change the leader (when the connect broken, the client data will be remained for t_changeleader)
Server Actions
- set the brb timeout value to the client.
- when the client disconnects, the data will be keeped for brb timeout.
Expect Reply
Client Actions