High Availability Guide : Server state transitions : HotStandby state transition diagram
  
HotStandby state transition diagram
The diagram in this section shows the state transitions that can occur, and the circumstances under which they may occur.
For example, you can change the state of a server from PRIMARY UNCERTAIN to PRIMARY ALONE by executing the command
'hsb set primary alone': ADMIN COMMAND 'hsb Set Primary Alone';
As you use this diagram, remember the following:
1 The complete syntax of the commands is not shown. For example, it shows:
'hsb set primary alone'
rather than
ADMIN COMMAND 'hsb Set Primary Alone';
2 The state transition paths shown for 'hsb copy' also apply to 'hsb netcopy'.
3 Some commands may 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': 'Disconnect' failed.
4 In some situations, the behavior depends upon the setting of the solid.ini configuration parameter named AutoPrimaryAlone. The abbreviation “APA” is often used to represent this parameter.
5 When the diagram refers to “events”, it refers to internally-generated notifications. These are not the same as the “events” that users can post and wait on, as described in the SQL commands for CREATE EVENT, for example.
6 Near the top left of the diagram, you will see the text “Start with '-x backupserver'”. If you want to start a new Secondary server and you want it to get a copy of the database from the Primary via the “netcopy” command, 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. Note that while the server is waiting to receive the netcopy, the server will not respond to queries about its state (or role). For example, if you issue the command:
ADMIN COMMAND 'hsb state';
the server will not respond and therefore you will not actually see it return the state “OFFLINE”.
7 “rpc” stands for “Remote Procedure Call”. “rpc broken” means that the Primary and Secondary lost connection with each other without doing an explicit Disconnect. The connection may be lost if the network fails, or if one server crashes, for example.
8 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 following table shows server states and the ways in which a HotStandby command can change the server state.
Server state
If this condition occurs, or if this HSB command is issued...
Then server state becomes...
If command is unsuccessful, then the state is...
OFFLINE
If the Primary server executes ADMIN COMMAND 'hotstandby netcopy' then the Secondary's state will change 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 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 is broken.
PRIMARY UNCERTAIN
(Not applicable)
PRIMARY ACTIVE
ADMIN COMMAND 'hotstandby set standalone' at the Primary
STANDALONE
Unchanged
PRIMARY ACTIVE
ADMIN COMMAND 'hotstandby switch secondary' at the Primary or ADMIN COMMAND 'hotstandby switch primary' at the Secondary.
SECONDARY ACTIVE
SECONDARY ALONE
PRIMARY ACTIVE
ADMIN COMMAND 'hotstandby disconnect' at the Primary.
PRIMARY ALONE
PRIMARY ALONE
PRIMARY ALONE
ADMIN COMMAND 'hotstandby copy' or ADMIN COMMAND 'hotstandby netcopy' at the Primary.
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 issue the “connect” command: ADMIN COMMAND 'hotstandby connect';
Note If you are using a diskless server without file access to the Secondary server, you must use netcopy, not copy.
PRIMARY ALONE
PRIMARY ALONE
PRIMARY ALONE
ADMIN COMMAND 'hotstandby connect' at the Primary
Note The above command is used to connect to the Secondary server, which is now fixed, or a server other than the failed Secondary.
PRIMARY ACTIVE (after the catchup is completed)
Unchanged
PRIMARY ALONE
ADMIN COMMAND 'hotstandby set standalone' at the Primary or the transaction log is full.
STANDALONE
Unchanged
PRIMARY ALONE
ADMIN COMMAND 'hotstandby set secondary alone' or ADMIN COMMAND 'hotstandby switch secondary' at the Primary.
SECONDARY ALONE
SECONDARY ALONE
PRIMARY UNCERTAIN
ADMIN COMMAND 'hotstandby set primary alone' at the Primary server
PRIMARY ALONE
Unchanged
PRIMARY UNCERTAIN
ADMIN COMMAND 'hotstandby connect' at the Primary.
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.
PRIMARY ACTIVE
Unchanged
PRIMARY UNCERTAIN (HSB timeout has occurred for connecting to the Secondary)
ADMIN COMMAND 'hotstandby set standalone' at the Primary
STANDALONE
Unchanged
PRIMARY UNCERTAIN
ADMIN COMMAND 'hotstandby set secondary alone' or ADMIN COMMAND 'hotstandby switch secondary' at the Primary.
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 is broken.
SECONDARY ALONE
(not applicable)
SECONDARY ACTIVE
ADMIN COMMAND 'hotstandby switch secondary' at the Primary or ADMIN COMMAND 'hotstandby switch primary' at the Secondary.
PRIMARY ACTIVE
Unchanged
SECONDARY ACTIVE
ADMIN COMMAND 'hotstandby set primary alone' at the Secondary.
PRIMARY ALONE
Unchanged
SECONDARY ACTIVE
ADMIN COMMAND 'hotstandby disconnect' at the Secondary or Primary.
SECONDARY ALONE
SECONDARY ALONE
SECONDARY ALONE
ADMIN COMMAND 'hotstandby connect' at the Secondary or Primary
SECONDARY ACTIVE
Unchanged
SECONDARY ALONE
ADMIN COMMAND 'hotstandby set standalone' at the Secondary.
STANDALONE
Unchanged
SECONDARY ALONE
ADMIN COMMAND 'hotstandby set primary alone' or ADMIN COMMAND 'hotstandby switch primary' at the Secondary
PRIMARY ALONE
Unchanged
See also
Server state transitions