1<!--$Id: rep_timeout.so,v 1.12 2008/04/29 22:55:48 mbrey Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DB_ENV->rep_set_timeout</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DB_ENV->rep_set_timeout</b> 14</td> 15<td align=right> 16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db.h> 23<p> 24int 25DB_ENV->rep_set_timeout(DB_ENV *env, int which, u_int32_t timeout); 26<p> 27int 28DB_ENV->rep_get_timeout(DB_ENV *env, int which, u_int32_t *timeoutp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DB_ENV->rep_set_timeout</b> 32<p>The DB_ENV->rep_set_timeout method specifies a variety of replication timeout 33values.</p> 34<p>The database environment's replication subsystem may also be configured using the 35environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file. The syntax of the entry in that 36file is a single line with the string "rep_set_timeout", one or more whitespace 37characters, and the <b>which</b> parameter specified as a string and the timeout 38specified as two parts. 39For example, "rep_set_timeout DB_REP_CONNECTION_RETRY 15000000" 40specifies the connection retry timeout for 15 seconds. 41Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment 42is opened, it will silently overrule configuration done before that 43time.</p> 44<p>The DB_ENV->rep_set_timeout method configures a database environment, not only operations 45performed using the specified <a href="../api_c/env_class.html">DB_ENV</a> handle.</p> 46<p>The DB_ENV->rep_set_timeout method may be called at any time during the life of the 47application.</p> 48<p>The DB_ENV->rep_set_timeout method 49returns a non-zero error value on failure 50and 0 on success. 51</p> 52<b>Parameters</b> <br> 53 <b>which</b><ul compact><li>The <b>which</b> parameter must be set to one of the following values: 54<br> 55<b><a name="DB_REP_ACK_TIMEOUT">DB_REP_ACK_TIMEOUT</a></b><ul compact><li>Configure the amount of time the replication manager's transport 56function waits to collect enough acknowledgments from replication group 57clients, before giving up and returning a failure indication. The 58default wait time is 1 second.</ul> 59<b><a name="DB_REP_CHECKPOINT_DELAY">DB_REP_CHECKPOINT_DELAY</a></b><ul compact><li>Configure the amount of time a master site will delay between 60completing a checkpoint and writing a checkpoint record into the log. 61This delay allows clients to complete their own checkpoints before the 62master requires completion of them. The default is 30 seconds. 63If all databases in the environment, and the environment's 64transaction log, are configured to reside in memory (never 65preserved to disk), then, although checkpoints are still 66necessary, the delay is not useful and should be set to 0.</ul> 67<b><a name="DB_REP_CONNECTION_RETRY">DB_REP_CONNECTION_RETRY</a></b><ul compact><li>Configure the amount of time the replication manager will wait before 68trying to re-establish a connection to another site after a communication 69failure. The default wait time is 30 seconds.</ul> 70<b><a name="DB_REP_ELECTION_TIMEOUT">DB_REP_ELECTION_TIMEOUT</a></b><ul compact><li>The timeout period for an election. The default timeout is 2 seconds.</ul> 71<b><a name="DB_REP_ELECTION_RETRY">DB_REP_ELECTION_RETRY</a></b><ul compact><li>Configure the amount of time the replication manager will wait before 72retrying a failed election. The default wait time is 10 seconds.</ul> 73<b><a name="DB_REP_FULL_ELECTION_TIMEOUT">DB_REP_FULL_ELECTION_TIMEOUT</a></b><ul compact><li>An optional configuration timeout period to wait for full election 74participation the first time the replication group finds a master. 75By default this option is turned off and normal election 76timeouts are used. 77(See the <a href="../ref/rep/elect.html">Elections</a> 78section in the Berkeley DB Reference Guide for more information.)</ul> 79<b><a name="DB_REP_HEARTBEAT_MONITOR">DB_REP_HEARTBEAT_MONITOR</a></b><ul compact><li>The amount of time the replication manager, running at a client site, 80waits for some message activity on the connection from the master 81(heartbeats or other messages) before concluding that the connection 82has been lost. When 0 (the default), no monitoring is performed. 83</ul> 84<b><a name="DB_REP_HEARTBEAT_SEND">DB_REP_HEARTBEAT_SEND</a></b><ul compact><li>The frequency at which the replication manager, running at a master site, 85broadcasts a heartbeat message in an otherwise idle system. When 0 86(the default), no heartbeat messages will be sent.</ul> 87<b><a name="DB_REP_LEASE_TIMEOUT">DB_REP_LEASE_TIMEOUT</a></b><ul compact><li>Configure the amount of time a client grants its master lease 88to a master. When using master leases all sites in a replication 89group must use the same lease timeout value. There is no default 90value. If leases are desired, this method must be called prior 91to calling <a href="../api_c/rep_start.html">DB_ENV->rep_start</a> method. See also <a href="../api_c/rep_clockskew.html">DB_ENV->rep_set_clockskew</a> method, 92<a href="../api_c/rep_config.html">DB_ENV->rep_set_config</a> method or 93<a href="../ref/rep/lease.html">Master leases</a>.</ul> 94<br> 95 <b>timeout</b><ul compact><li>The <b>timeout</b> parameter is the timeout value. It must be specified 96as an unsigned 32-bit number of microseconds, limiting the maximum timeout 97to roughly 71 minutes.</ul></ul> 98<br> 99<br><b>Errors</b> 100<p>The DB_ENV->rep_set_timeout method 101may fail and return one of the following non-zero errors:</p> 102<br> 103<b>EINVAL</b><ul compact><li>An 104invalid flag value or parameter was specified.</ul> 105<br> 106<hr size=1 noshade> 107<b>Description: DB_ENV->rep_get_timeout</b> 108<p>The DB_ENV->rep_get_timeout method returns the timeout value for the specified 109<b>which</b> parameter.</p> 110<p>The DB_ENV->rep_get_timeout method may be called at any time during the life of the 111application.</p> 112<p>The DB_ENV->rep_get_timeout method 113returns a non-zero error value on failure 114and 0 on success. 115</p> 116<b>Parameters</b> <br> 117 <b>which</b><ul compact><li>The <b>which</b> parameter is the timeout value for which the value 118is being returned.</ul> 119 <b>timeoutp</b><ul compact><li>The <b>timeoutp</b> parameter references memory into which 120 the timeout value of the specified <b>which</b> parameter is copied.</ul> The returned <b>timeout</b> value is in microseconds. 121<br> 122<hr size=1 noshade> 123<br><b>Class</b> 124<a href="../api_c/env_class.html">DB_ENV</a> 125<br><b>See Also</b> 126<a href="../api_c/rep_list.html">Replication and Related Methods</a> 127</tt> 128<table width="100%"><tr><td><br></td><td align=right> 129<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 130</td></tr></table> 131<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 132</body> 133</html> 134