Berkeley DB Reference Version 5.3.33

DB_ENV->rep_set_timeout()

#include <db.h>

int
DB_ENV->rep_set_timeout(DB_ENV *env, int which, u_int32_t timeout);  

The DB_ENV->rep_set_timeout() method specifies a variety of replication timeout values.

The database environment's replication subsystem may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "rep_set_timeout", one or more whitespace characters, and the which parameter specified as a string and the timeout specified as two parts. For example, "rep_set_timeout DB_REP_CONNECTION_RETRY 15000000" specifies the connection retry timeout for 15 seconds. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DB_ENV->rep_set_timeout() method configures a database environment, not only operations performed using the specified DB_ENV handle.

The DB_ENV->rep_set_timeout() method may not be called to set the master lease timeout after the DB_ENV->repmgr_start() method or the DB_ENV->rep_start() method is called. For all other timeouts, the DB_ENV->rep_set_timeout() method may be called at any time during the life of the application.

The DB_ENV->rep_set_timeout() method returns a non-zero error value on failure and 0 on success.

Parameters

timeout

The timeout parameter is the timeout value. It must be specified as an unsigned 32-bit number of microseconds, limiting the maximum timeout to roughly 71 minutes.

which

The which parameter must be set to one of the following values:

Errors

The DB_ENV->rep_set_timeout() method may fail and return one of the following non-zero errors:

EINVAL

If setting the lease timeout and replication has already been started; if setting a Replication Manager timeout for a Base API application; or if an invalid flag value or parameter was specified.

Class

DB_ENV

See Also

Replication and Related Methods