@Pause

Documentation

Home » Documentation » Using VoltDB

@Pause

@Pause — Initiates admin mode on the cluster.

Synopsis

@Pause

Description

The @Pause system procedure initiates admin mode on the cluster. In admin mode, no further transaction requests are accepted from clients on the client port. All interactions with a database in admin mode must occur through the admin port specified in the deployment file.

There may be existing transactions still in the queue after admin mode is initiated. Until these transactions are completed, the database is not entirely paused. You can use the @Statistics system procedure with the "LIVECLIENTS" keyword to determine how many transactions are outstanding for each client connection.

The goal of admin mode is to pause the system and ensure no further changes to the database can occur when performing sensitive administrative operations, such as taking a snapshot before shutting down.

Several important points to consider concerning @Pause are:

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

  • Although new stored procedure invocations received 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");