Imported Upstream version 5.3.21
[platform/upstream/libdb.git] / docs / installation / upgrade_11gr2_52_grp_mbr.html
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>Group Membership in Repmgr</title>
7     <link rel="stylesheet" href="gettingStarted.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 Installation and Build Guide" />
10     <link rel="up" href="upgrade_52_toc.html" title="Chapter 10.  Upgrading Berkeley DB 11.2.5.1 applications to Berkeley DB 11.2.5.2" />
11     <link rel="prev" href="upgrade_11gr2_52_excl_txn_sql.html" title="Exclusive Transactions in the SQL Layer" />
12     <link rel="next" href="upgrade_11gr2_52_heap.html" title="Heap Access Method" />
13   </head>
14   <body>
15     <div xmlns="" class="navheader">
16       <div class="libver">
17         <p>Library Version 11.2.5.3</p>
18       </div>
19       <table width="100%" summary="Navigation header">
20         <tr>
21           <th colspan="3" align="center">Group Membership in Repmgr</th>
22         </tr>
23         <tr>
24           <td width="20%" align="left"><a accesskey="p" href="upgrade_11gr2_52_excl_txn_sql.html">Prev</a> </td>
25           <th width="60%" align="center">Chapter 10. 
26         Upgrading Berkeley DB 11.2.5.1 applications to Berkeley DB 11.2.5.2
27     </th>
28           <td width="20%" align="right"> <a accesskey="n" href="upgrade_11gr2_52_heap.html">Next</a></td>
29         </tr>
30       </table>
31       <hr />
32     </div>
33     <div class="sect1" lang="en" xml:lang="en">
34       <div class="titlepage">
35         <div>
36           <div>
37             <h2 class="title" style="clear: both"><a id="upgrade_11gr2_52_grp_mbr"></a>Group Membership in Repmgr</h2>
38           </div>
39         </div>
40       </div>
41       <div class="toc">
42         <dl>
43           <dt>
44             <span class="sect2">
45               <a href="upgrade_11gr2_52_grp_mbr.html#idp676752">Upgrading</a>
46             </span>
47           </dt>
48           <dt>
49             <span class="sect2">
50               <a href="upgrade_11gr2_52_grp_mbr.html#idp657144">New Functions</a>
51             </span>
52           </dt>
53           <dt>
54             <span class="sect2">
55               <a href="upgrade_11gr2_52_grp_mbr.html#idp655568">Modified Functions</a>
56             </span>
57           </dt>
58           <dt>
59             <span class="sect2">
60               <a href="upgrade_11gr2_52_grp_mbr.html#idp602496">New Events</a>
61             </span>
62           </dt>
63           <dt>
64             <span class="sect2">
65               <a href="upgrade_11gr2_52_grp_mbr.html#idp684960">Removed Functions</a>
66             </span>
67           </dt>
68           <dt>
69             <span class="sect2">
70               <a href="upgrade_11gr2_52_grp_mbr.html#idp650072">New Parameters</a>
71             </span>
72           </dt>
73           <dt>
74             <span class="sect2">
75               <a href="upgrade_11gr2_52_grp_mbr.html#idp671784">New Structure</a>
76             </span>
77           </dt>
78         </dl>
79       </div>
80       <p>
81         Replication Manager now manages group membership much more closely,
82         making it much easier for applications to add and remove sites from
83         a replication group without risk of transaction loss.  In order to
84         accomplish this, the API for configuring group membership has
85         changed significantly.  The
86         <code class="literal">repmgr_set_local_site()</code> and
87         <code class="literal">repmgr_add_remote_site()</code> methods no longer
88         exist; they are replaced by a new handle type,
89         <code class="literal">DB_SITE</code>.  The
90         <code class="literal">repmgr_get_local_site()</code> method has been replaced
91         by <a href="../api_reference/C/repmgr_site.html" class="olink">DB_ENV-&gt;repmgr_site()</a>, which now returns a
92         <code class="literal">DB_SITE</code> handle instead of a raw host/port
93         network address.
94     </p>
95       <p>
96         Replication Manager applications may no longer call the <a href="../api_reference/C/repnsites.html" class="olink">DB_ENV-&gt;rep_set_nsites()</a>
97         method, because the Replication Manager now tracks the number of
98         sites in the replication group for you.  Replication Manager
99         applications may still call <a href="../api_reference/C/repget_nsites.html" class="olink">DB_ENV-&gt;rep_get_nsites()</a>, but only after a
100         successful call to <a href="../api_reference/C/repmgrstart.html" class="olink">DB_ENV-&gt;repmgr_start()</a>.
101     </p>
102       <p>
103         For applications using the replication Base API there is no change,
104         except that they may now call <a href="../api_reference/C/repnsites.html" class="olink">DB_ENV-&gt;rep_set_nsites()</a> to change the group size
105         even when Master Leases are in use.
106     </p>
107       <p>
108         The new Replication Manager group membership functionality is
109         described in the <a href="../programmer_reference/group_membership.html" class="olink">Managing Replication Manager Group Membership</a> chapter in the 
110         <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
111     </p>
112       <p>
113         Replication Manager no longer prints an error message on a
114         connection failure.  Instead it generates an event with the
115         equivalent information (invoking the application's
116         event-handling call-back function).
117     </p>
118       <div class="sect2" lang="en" xml:lang="en">
119         <div class="titlepage">
120           <div>
121             <div>
122               <h3 class="title"><a id="idp676752"></a>Upgrading</h3>
123             </div>
124           </div>
125         </div>
126         <p>
127             An existing application running a previous version of BDB can do a
128             "live upgrade" so that only one site at a time has to be shut down.
129             To do this, restart each site in the group, with the old master
130             being shutdown last.  When each site is restarted, use
131             <code class="literal">DB_SITE</code> to configure the local site with the
132             flag <code class="literal">DB_LEGACY</code>, and create a
133             <code class="literal">DB_SITE</code> handle with a full specification of  all
134             the remote site addresses for all other sites currently in the
135             group, and configure each handle with the
136             <code class="literal">DB_LEGACY</code> flag.  When the old master is
137             restarted and a new master has been established, the new master is
138             ready to manage membership changes, and new sites can be added as
139             usual. But the application must not try to add new sites, or remove
140             existing sites, during the mixed-version transitional phase.
141         </p>
142         <p>
143             To do a non-live upgrade shutdown the entire replication group.
144             Then restart the group with each site configured with the
145             <code class="literal">DB_LEGACY</code> flag, and in
146             <code class="literal">DB_REP_ELECTION</code> mode.
147         </p>
148       </div>
149       <div class="sect2" lang="en" xml:lang="en">
150         <div class="titlepage">
151           <div>
152             <div>
153               <h3 class="title"><a id="idp657144"></a>New Functions</h3>
154             </div>
155           </div>
156         </div>
157         <div class="itemizedlist">
158           <ul type="disc">
159             <li>
160               <a href="../api_reference/C/repmgr_site.html" class="olink">DB_ENV-&gt;repmgr_site()</a>
161             </li>
162             <li>
163               <a href="../api_reference/C/repmgr_site_by_eid.html" class="olink">DB_ENV-&gt;repmgr_site_by_eid()</a>
164             </li>
165             <li>
166               <a href="../api_reference/C/dbsite_set_config.html" class="olink">DB_SITE-&gt;set_config()</a>
167             </li>
168             <li>
169               <a href="../api_reference/C/dbsite_get_config.html" class="olink">DB_SITE-&gt;get_config()</a>
170             </li>
171             <li>
172               <a href="../api_reference/C/dbsite_remove.html" class="olink">DB_SITE-&gt;remove()</a>
173             </li>
174             <li>
175               <a href="../api_reference/C/dbsite_get_eid.html" class="olink">DB_SITE-&gt;get_eid()</a>
176             </li>
177             <li>
178               <a href="../api_reference/C/dbsite_get_address.html" class="olink">DB_SITE-&gt;get_address()</a>
179             </li>
180             <li>
181               <a href="../api_reference/C/dbsite_close.html" class="olink">DB_SITE-&gt;close()</a>
182             </li>
183           </ul>
184         </div>
185       </div>
186       <div class="sect2" lang="en" xml:lang="en">
187         <div class="titlepage">
188           <div>
189             <div>
190               <h3 class="title"><a id="idp655568"></a>Modified Functions</h3>
191             </div>
192           </div>
193         </div>
194         <div class="itemizedlist">
195           <ul type="disc">
196             <li><a href="../api_reference/C/repnsites.html" class="olink">DB_ENV-&gt;rep_set_nsites()</a> is no longer used by the Replication Manager,
197                 but is still used by the Base API.  It can now be used to
198                 change the number of sites dynamically, even when master
199                 leases are in use.
200             </li>
201           </ul>
202         </div>
203       </div>
204       <div class="sect2" lang="en" xml:lang="en">
205         <div class="titlepage">
206           <div>
207             <div>
208               <h3 class="title"><a id="idp602496"></a>New Events</h3>
209             </div>
210           </div>
211         </div>
212         <div class="itemizedlist">
213           <ul type="disc">
214             <li>
215               <code class="literal">DB_EVENT_REP_SITE_ADDED</code>
216             </li>
217             <li>
218               <code class="literal">DB_EVENT_REP_SITE_REMOVED</code>
219             </li>
220             <li>
221               <code class="literal">DB_EVENT_REP_LOCAL_SITE_REMOVED</code>
222             </li>
223             <li>
224               <code class="literal">DB_EVENT_REP_CONNECT_BROKEN</code>
225             </li>
226             <li>
227               <code class="literal">DB_EVENT_REP_CONNECT_ESTD</code>
228             </li>
229             <li>
230               <code class="literal">DB_EVENT_REP_CONNECT_TRY_FAILED</code>
231             </li>
232             <li>
233               <code class="literal">DB_EVENT_REP_INIT_DONE</code>
234             </li>
235           </ul>
236         </div>
237       </div>
238       <div class="sect2" lang="en" xml:lang="en">
239         <div class="titlepage">
240           <div>
241             <div>
242               <h3 class="title"><a id="idp684960"></a>Removed Functions</h3>
243             </div>
244           </div>
245         </div>
246         <div class="itemizedlist">
247           <ul type="disc">
248             <li>
249               <code class="methodname">DB_ENV-&gt;repmgr_set_local_site()</code>
250             </li>
251             <li>
252               <code class="methodname">DB_ENV-&gt;repmgr_add_local_site()</code>
253             </li>
254             <li>
255               <code class="methodname">DB_ENV-&gt;repmgr_add_remote_site()</code>
256             </li>
257             <li>
258               <code class="methodname">DB_ENV-&gt;repmgr_get_local_site()</code>
259             </li>
260           </ul>
261         </div>
262       </div>
263       <div class="sect2" lang="en" xml:lang="en">
264         <div class="titlepage">
265           <div>
266             <div>
267               <h3 class="title"><a id="idp650072"></a>New Parameters</h3>
268             </div>
269           </div>
270         </div>
271         <p>
272             The following new parameters are passed to 
273             <a href="../api_reference/C/dbsite_set_config.html" class="olink">DB_SITE-&gt;set_config()</a>.
274         </p>
275         <div class="itemizedlist">
276           <ul type="disc">
277             <li>
278               <code class="literal">DB_BOOTSTRAP_HELPER</code>
279             </li>
280             <li>
281               <code class="literal">DB_GROUP_CREATOR</code>
282             </li>
283             <li>
284               <code class="literal">DB_LEGACY</code>
285             </li>
286             <li>
287               <code class="literal">DB_LOCAL_SITE</code>
288             </li>
289             <li>
290               <code class="literal">DB_REPMGR_PEER</code>
291             </li>
292           </ul>
293         </div>
294       </div>
295       <div class="sect2" lang="en" xml:lang="en">
296         <div class="titlepage">
297           <div>
298             <div>
299               <h3 class="title"><a id="idp671784"></a>New Structure</h3>
300             </div>
301           </div>
302         </div>
303         <div class="itemizedlist">
304           <ul type="disc">
305             <li><code class="literal">DB_REPMGR_CONN_ERR</code> encapsulates an EID
306                 and an integer system error code.
307             </li>
308           </ul>
309         </div>
310       </div>
311     </div>
312     <div class="navfooter">
313       <hr />
314       <table width="100%" summary="Navigation footer">
315         <tr>
316           <td width="40%" align="left"><a accesskey="p" href="upgrade_11gr2_52_excl_txn_sql.html">Prev</a> </td>
317           <td width="20%" align="center">
318             <a accesskey="u" href="upgrade_52_toc.html">Up</a>
319           </td>
320           <td width="40%" align="right"> <a accesskey="n" href="upgrade_11gr2_52_heap.html">Next</a></td>
321         </tr>
322         <tr>
323           <td width="40%" align="left" valign="top">Exclusive Transactions in the SQL Layer </td>
324           <td width="20%" align="center">
325             <a accesskey="h" href="index.html">Home</a>
326           </td>
327           <td width="40%" align="right" valign="top"> Heap Access Method</td>
328         </tr>
329       </table>
330     </div>
331   </body>
332 </html>