1<!--$Id: rep_request.so,v 1.5 2008/02/20 19:01:48 sue 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-&gt;rep_set_request</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-&gt;rep_set_request</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 &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;rep_set_request(DB_ENV *env, u_int32_t min, u_int32_t max);
26<p>
27int
28DB_ENV-&gt;rep_get_request(DB_ENV *env, u_int32_t *minp, u_int32_t *maxp);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DB_ENV-&gt;rep_set_request</b>
32<p>The DB_ENV-&gt;rep_set_request method sets a threshold for the minimum and maximum
33time that a client waits before requesting retransmission of a missing
34message.  Specifically, if the client detects a gap in the sequence
35of incoming log records or database pages, Berkeley DB will
36wait for at least <b>min</b> microseconds before requesting
37retransmission of the missing record.  Berkeley DB will double that
38amount before requesting the same missing record again, and so on, up
39to a maximum threshold of <b>max</b> microseconds.</p>
40<p>These values are thresholds only.  Since Berkeley DB has no thread available in
41the library as a timer, the threshold is only checked when a thread
42enters the Berkeley DB library to process an incoming replication message.
43Any amount of time may have passed since the last message arrived and
44Berkeley DB only checks whether the amount of time since a request was made
45is beyond the threshold value or not.</p>
46<p>By default the minimum is 40000 and the maximum is 1280000 (1.28 seconds).
47These defaults are fairly arbitrary and the application likely needs
48to adjust these.  The values should be based on expected load and
49performance characteristics of the master and client host platforms
50and transport infrastructure as well as round-trip message time.</p>
51<p>The database environment's replication subsystem may also be configured using the
52environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
53file is a single line with the string "rep_set_request", one or more whitespace
54characters, and the request times specified in two parts: the min and the max.
55For example, "rep_set_request 40000 1280000".
56Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
57is opened, it will silently overrule configuration done before that
58time.</p>
59<p>The DB_ENV-&gt;rep_set_request method configures a database environment, not only operations
60performed using the specified <a href="../api_c/env_class.html">DB_ENV</a> handle.</p>
61<p>The DB_ENV-&gt;rep_set_request method may be called at any time during the life of the
62application.</p>
63<p>The DB_ENV-&gt;rep_set_request method
64returns a non-zero error value on failure
65and 0 on success.
66</p>
67<b>Parameters</b> <br>
68 <b>max</b><ul compact><li>The maximum number of microseconds a client waits before
69requesting retransmission.</ul>
70 <b>min</b><ul compact><li>The minimum number of microseconds a client waits before
71requesting retransmission.</ul>
72<br>
73<br><b>Errors</b>
74<p>The DB_ENV-&gt;rep_set_request method
75may fail and return one of the following non-zero errors:</p>
76<br>
77<b>EINVAL</b><ul compact><li>An
78invalid flag value or parameter was specified.</ul>
79<br>
80<hr size=1 noshade>
81<b>Description: DB_ENV-&gt;rep_get_request</b>
82<p>The DB_ENV-&gt;rep_get_request method returns the minimum and maximum number of
83microseconds a client waits before requesting retransmission.</p>
84<p>The DB_ENV-&gt;rep_get_request method may be called at any time during the life of the
85application.</p>
86<p>The DB_ENV-&gt;rep_get_request method
87returns a non-zero error value on failure
88and 0 on success.
89</p>
90<b>Parameters</b> <br>
91 <b>maxp</b><ul compact><li>The <b>maxp</b> parameter references memory into which
92 the maximum number of microseconds a client will wait before requesting
93retransmission is copied.</ul> 
94 <b>minp</b><ul compact><li>The <b>minp</b> parameter references memory into which
95 the minimum number of microseconds a client will wait before requesting
96retransmission is copied.</ul> 
97<br>
98<hr size=1 noshade>
99<br><b>Class</b>
100<a href="../api_c/env_class.html">DB_ENV</a>
101<br><b>See Also</b>
102<a href="../api_c/rep_list.html">Replication and Related Methods</a>
103</tt>
104<table width="100%"><tr><td><br></td><td align=right>
105<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>
106</td></tr></table>
107<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
108</body>
109</html>
110