@Pause

Documentation

VoltDB Home » Documentation » Using VoltDB

@Pause

@Pause — Initiates read-only mode on the cluster.

Synopsis

@Pause

Description

The @Pause system procedure initiates admin mode on the cluster. Admin mode puts the database into read-only mode and ensures no further changes to the database can be made through the client port when performing sensitive administrative operations, such as taking a snapshot before shutting down.

While in admin mode, any write transactions on the client port are rejected and return an error status. Read-only transactions, including system procedures, are allowed. However, write transactions such as inserts, deletes, or schema changes are only allowed through the admin port.

Several important points to consider concerning @Pause are:

  • @Pause must be called through the admin port, not the standard client port.

  • Although write transactions on the client port are rejected in admin mode, existing connections from client applications are not removed.

  • To return to normal database operation, you must call the system procedure @Resume on the admin port.

Return Values

Returns one VoltTable with one row.

NameDatatypeDescription
STATUSBIGINTAlways returns the value zero (0) indicating success.

Examples

It is possible to call @Pause using the sqlcmd utility. However, you must explicitly connect to the admin port when starting sqlcmd to do this. Also, it is often easier to use the voltadmin utility, which connects to the admin port by default. For example, the following commands demonstrate pausing and resuming the database using both sqlcmd and voltadmin:

$ sqlcmd --port=21211
1> exec @Pause;
2> exec @Resume;
$ voltadmin pause
$ voltadmin resume

The following program example, if called through the admin port, initiates admin mode on the database cluster.

client.callProcedure("@Pause");