1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DbEnv::rep_set_request()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="rep.html" title="Chapter 11. Replication Methods" /> 11 <link rel="prev" href="reppriority.html" title="DbEnv::rep_set_priority()" /> 12 <link rel="next" href="repset_timeout.html" title="DbEnv::rep_set_timeout()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::rep_set_request()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="reppriority.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 11. 23 Replication Methods 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="repset_timeout.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="repset_request"></a>DbEnv::rep_set_request()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::rep_set_request(u_int32_t min, u_int32_t max); </pre> 42 <p> 43 The <code class="methodname">DbEnv::rep_set_request()</code> method sets a threshold for the 44 minimum and maximum time that a client waits before requesting retransmission of a missing 45 message. Specifically, if the client detects a gap in the sequence of incoming log records 46 or database pages, Berkeley DB will wait for at least <span class="bold"><strong>min</strong></span> 47 microseconds before requesting retransmission of the missing record. Berkeley DB will 48 double that amount before requesting the same missing record again, and so on, up to a 49 maximum threshold of <span class="bold"><strong>max</strong></span> microseconds. 50 </p> 51 <p> 52 These values are thresholds only. Since Berkeley DB has no thread 53 available in the library as a timer, the threshold is only checked 54 when a thread enters the Berkeley DB library to process an incoming 55 replication message. Any amount of time may have passed since the last 56 message arrived and Berkeley DB only checks whether the amount of time 57 since a request was made is beyond the threshold value or not. 58 </p> 59 <p> 60 By default the minimum is 40000 and the maximum is 1280000 (1.28 61 seconds). These defaults are fairly arbitrary and the application 62 likely needs to adjust these. The values should be based on expected 63 load and performance characteristics of the master and client host 64 platforms and transport infrastructure as well as round-trip message 65 time. 66 </p> 67 <p> 68 The database environment's replication subsystem may also be configured using the 69 environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The 70 syntax of the entry in that file is a single line with the string "rep_set_request", one or 71 more whitespace characters, and the request times specified in two parts: the min and the 72 max. For example, "rep_set_request 40000 1280000". Because the 73 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the 74 database environment is opened, it will silently overrule configuration done before that 75 time. 76 </p> 77 <p> 78 The <code class="methodname">DbEnv::rep_set_request()</code> method configures a database 79 environment, not only operations performed using the specified 80 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> handle. 81 </p> 82 <p> 83 The <code class="methodname">DbEnv::rep_set_request()</code> method may be called at any time during 84 the life of the application. 85 </p> 86 <p> 87 The <code class="methodname">DbEnv::rep_set_request()</code> <span> 88 89 <span> 90 method either returns a non-zero error value or throws an 91 exception that encapsulates a non-zero error value on 92 failure, and returns 0 on success. 93 </span> 94 </span> 95 </p> 96 <div class="sect2" lang="en" xml:lang="en"> 97 <div class="titlepage"> 98 <div> 99 <div> 100 <h3 class="title"><a id="id1703775"></a>Parameters</h3> 101 </div> 102 </div> 103 </div> 104 <div class="sect3" lang="en" xml:lang="en"> 105 <div class="titlepage"> 106 <div> 107 <div> 108 <h4 class="title"><a id="id1704071"></a>max</h4> 109 </div> 110 </div> 111 </div> 112 <p> 113 The maximum number of microseconds a client waits before requesting 114 retransmission. 115 </p> 116 </div> 117 <div class="sect3" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h4 class="title"><a id="id1704142"></a>min</h4> 122 </div> 123 </div> 124 </div> 125 <p> 126 The minimum number of microseconds a client waits before requesting 127 retransmission. 128 </p> 129 </div> 130 </div> 131 <div class="sect2" lang="en" xml:lang="en"> 132 <div class="titlepage"> 133 <div> 134 <div> 135 <h3 class="title"><a id="id1704143"></a>Errors</h3> 136 </div> 137 </div> 138 </div> 139 <p> 140 The <code class="methodname">DbEnv::rep_set_request()</code> <span> 141 142 <span> 143 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 144 exception, encapsulating one of the following non-zero errors, or return one 145 of the following non-zero errors: 146 </span> 147 </span> 148 </p> 149 <div class="sect3" lang="en" xml:lang="en"> 150 <div class="titlepage"> 151 <div> 152 <div> 153 <h4 class="title"><a id="id1704138"></a>EINVAL</h4> 154 </div> 155 </div> 156 </div> 157 <p> 158 An invalid flag value or parameter was specified. 159 </p> 160 </div> 161 </div> 162 <div class="sect2" lang="en" xml:lang="en"> 163 <div class="titlepage"> 164 <div> 165 <div> 166 <h3 class="title"><a id="id1704054"></a>Class</h3> 167 </div> 168 </div> 169 </div> 170 <p> 171 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> 172 </p> 173 </div> 174 <div class="sect2" lang="en" xml:lang="en"> 175 <div class="titlepage"> 176 <div> 177 <div> 178 <h3 class="title"><a id="id1703778"></a>See Also</h3> 179 </div> 180 </div> 181 </div> 182 <p> 183 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 184 </p> 185 </div> 186 </div> 187 <div class="navfooter"> 188 <hr /> 189 <table width="100%" summary="Navigation footer"> 190 <tr> 191 <td width="40%" align="left"><a accesskey="p" href="reppriority.html">Prev</a> </td> 192 <td width="20%" align="center"> 193 <a accesskey="u" href="rep.html">Up</a> 194 </td> 195 <td width="40%" align="right"> <a accesskey="n" href="repset_timeout.html">Next</a></td> 196 </tr> 197 <tr> 198 <td width="40%" align="left" valign="top">DbEnv::rep_set_priority() </td> 199 <td width="20%" align="center"> 200 <a accesskey="h" href="index.html">Home</a> 201 </td> 202 <td width="40%" align="right" valign="top"> DbEnv::rep_set_timeout()</td> 203 </tr> 204 </table> 205 </div> 206 </body> 207</html> 208