solidDB Help : solidDB reference : HotStandby server states : Server state transitions
  
Server state transitions
There are a number of possible server state transitions in HotStandby (HSB), for example, transition from OFFLINE to SECONDARY ALONE.
For a description of each of the server states, see HotStandby server states.
HotStandby state transition diagram
The following diagram shows the state transitions that can occur, and the circumstances under which they can occur.
For example, you can change the state of a server from PRIMARY UNCERTAIN to PRIMARY ALONE by executing the following command:
ADMIN COMMAND 'hsb Set Primary Alone';
Notes:
The complete syntax of the commands is not shown. For example, the diagram shows:
'hsb set primary alone'
rather than
ADMIN COMMAND 'hsb set primary alone';
The state transition paths shown for 'hsb copy' also apply to 'hsb netcopy'.
Some commands might fail when they are executed. When a command might succeed or fail, both possibilities are shown. If the branch is intended to describe what happens if the command fails, it will have the word "failed": for example, 'hsb connect' failed.
In some situations, the behavior depends upon the setting of the solid.ini configuration parameter AutoPrimaryAlone. The abbreviation "APA" is used to represent this parameter.
EVENT is used in the diagram to refer to internally-generated notifications. These are not the same as the "events" that users can post and wait on, as described in the SQL statement for CREATE EVENT, for example.
If you want to start a new secondary server and get a copy of the database from the primary server by using ADMIN COMMAND 'hsb netcopy', then you start the server (from the operating system command line) with the command-line option -x backupserver. This tells the server to wait for a netcopy from the primary server. Note that while the server is waiting to receive the netcopy, the server does not respond to queries about its state (or role). For example, if you run the following command:
ADMIN COMMAND 'hsb state';
the server does not respond and therefore does not actually return the state "OFFLINE".
"rpc" stands for "Remote Procedure Call". "rpc broken" means that the primary and secondary servers lost connection with each other without doing an explicit disconnect. The connection might be lost if the network fails, or if one server crashes, for example.
When an arrow loops back to the same state that it started from, it means that the state does not change. For example, if a server is in the state PRIMARY ALONE, and if it tries to connect to the other server but fails, then the state remains PRIMARY ALONE.
The diagram is explained in the surrounding text
The following table shows server states and the ways in which an HSB command can change the server state.
 
Server state
If this condition occurs, or if this HSB command is run...
Then server state becomes...
If command is unsuccessful, then the state is...
OFFLINE
If the primary server executes ADMIN COMMAND 'hotstandby netcopy' then the state of the secondary server changes to SECONDARY ALONE after the database has been copied.
SECONDARY ALONE
Unchanged
PRIMARY ACTIVE
HotStandby timeout (automatic) when AutoPrimaryAlone=Yes.
Note The HSB timeout occurs automatically when the secondary server is down or a connection between the primary and secondary server is broken.
PRIMARY ALONE
(Not applicable)
PRIMARY ACTIVE
HotStandby timeout (automatic) when AutoPrimaryAlone=No.
Note The HSB timeout occurs automatically when the secondary server is down or a connection between the primary and secondary servers is broken.
PRIMARY UNCERTAIN
(Not applicable)
PRIMARY ACTIVE
ADMIN COMMAND 'hotstandby set standalone' on the primary server.
STANDALONE
Unchanged
PRIMARY ACTIVE
ADMIN COMMAND 'hotstandby switch secondary' on the primary server or ADMIN COMMAND 'hotstandby switch primary' on the secondary server.
SECONDARY ACTIVE
SECONDARY ALONE
PRIMARY ACTIVE
ADMIN COMMAND 'hotstandby disconnect' on the primary server.
PRIMARY ALONE
PRIMARY ALONE
PRIMARY ALONE
ADMIN COMMAND 'hotstandby copy' or ADMIN COMMAND 'hotstandby netcopy' on the primary server.
Note that the state of the primary server does not change. The server stays in PRIMARY ALONE state. To change the state to PRIMARY ACTIVE, you must run the following command:
ADMIN COMMAND 'hotstandby connect';
Note If you are using a diskless server without file access to the secondary server, you must use the netcopy command rather than the copy command.
PRIMARY ALONE
PRIMARY ALONE
PRIMARY ALONE
ADMIN COMMAND 'hotstandby connect' on the primary server.
Note The above command is used to connect to the secondary server, which is now fixed, or a server other than the failed secondary server.
PRIMARY ACTIVE (after the catchup is completed)
Unchanged
PRIMARY ALONE
ADMIN COMMAND 'hotstandby set standalone' on the primary server or the transaction log is full.
STANDALONE
Unchanged
PRIMARY ALONE
ADMIN COMMAND 'hotstandby set secondary alone' or ADMIN COMMAND 'hotstandby switch secondary' on the primary server.
SECONDARY ALONE
SECONDARY ALONE
PRIMARY UNCERTAIN
ADMIN COMMAND 'hotstandby set primary alone' on the primary server.
PRIMARY ALONE
Unchanged
PRIMARY UNCERTAIN
ADMIN COMMAND 'hotstandby connect' on the primary server.
Note The above command is used to connect to the secondary server (which is now fixed) or to connect to a server other than the failed secondary server.
PRIMARY ACTIVE
Unchanged
PRIMARY UNCERTAIN (HSB timeout has occurred for connecting to the secondary server)
ADMIN COMMAND 'hotstandby set standalone' on the primary server.
STANDALONE
Unchanged
PRIMARY UNCERTAIN
ADMIN COMMAND 'hotstandby set secondary alone' or ADMIN COMMAND 'hotstandby switch secondary' on the primary server.
SECONDARY ALONE
Unchanged
SECONDARY ACTIVE
HotStandby timeout (automatic).
Note The HSB timeout occurs automatically when the secondary server is down or a connection between the primary and secondary servers is broken.
SECONDARY ALONE
(not applicable)
SECONDARY ACTIVE
ADMIN COMMAND 'hotstandby switch secondary' on the primary server or ADMIN COMMAND 'hotstandby switch primary' on the secondary server.
PRIMARY ACTIVE
Unchanged
SECONDARY ACTIVE
ADMIN COMMAND 'hotstandby set primary alone' on the secondary server.
PRIMARY ALONE
Unchanged
SECONDARY ACTIVE
ADMIN COMMAND 'hotstandby disconnect' on the primary or secondary server.
SECONDARY ALONE
SECONDARY ALONE
SECONDARY ALONE
ADMIN COMMAND 'hotstandby connect' on the primary or secondary servers.
SECONDARY ACTIVE
Unchanged
SECONDARY ALONE
ADMIN COMMAND 'hotstandby set standalone' on the secondary server.
STANDALONE
Unchanged
SECONDARY ALONE
ADMIN COMMAND 'hotstandby set primary alone' or ADMIN COMMAND 'hotstandby switch primary' on the secondary server.
PRIMARY ALONE
Unchanged
Go up to
HotStandby server states