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">
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" />
15 <div xmlns="" class="navheader">
17 <p>Library Version 11.2.5.3</p>
19 <table width="100%" summary="Navigation header">
21 <th colspan="3" align="center">Group Membership in Repmgr</th>
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
28 <td width="20%" align="right"> <a accesskey="n" href="upgrade_11gr2_52_heap.html">Next</a></td>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
37 <h2 class="title" style="clear: both"><a id="upgrade_11gr2_52_grp_mbr"></a>Group Membership in Repmgr</h2>
45 <a href="upgrade_11gr2_52_grp_mbr.html#idp676752">Upgrading</a>
50 <a href="upgrade_11gr2_52_grp_mbr.html#idp657144">New Functions</a>
55 <a href="upgrade_11gr2_52_grp_mbr.html#idp655568">Modified Functions</a>
60 <a href="upgrade_11gr2_52_grp_mbr.html#idp602496">New Events</a>
65 <a href="upgrade_11gr2_52_grp_mbr.html#idp684960">Removed Functions</a>
70 <a href="upgrade_11gr2_52_grp_mbr.html#idp650072">New Parameters</a>
75 <a href="upgrade_11gr2_52_grp_mbr.html#idp671784">New Structure</a>
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->repmgr_site()</a>, which now returns a
92 <code class="literal">DB_SITE</code> handle instead of a raw host/port
96 Replication Manager applications may no longer call the <a href="../api_reference/C/repnsites.html" class="olink">DB_ENV->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->rep_get_nsites()</a>, but only after a
100 successful call to <a href="../api_reference/C/repmgrstart.html" class="olink">DB_ENV->repmgr_start()</a>.
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->rep_set_nsites()</a> to change the group size
105 even when Master Leases are in use.
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>.
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).
118 <div class="sect2" lang="en" xml:lang="en">
119 <div class="titlepage">
122 <h3 class="title"><a id="idp676752"></a>Upgrading</h3>
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.
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.
149 <div class="sect2" lang="en" xml:lang="en">
150 <div class="titlepage">
153 <h3 class="title"><a id="idp657144"></a>New Functions</h3>
157 <div class="itemizedlist">
160 <a href="../api_reference/C/repmgr_site.html" class="olink">DB_ENV->repmgr_site()</a>
163 <a href="../api_reference/C/repmgr_site_by_eid.html" class="olink">DB_ENV->repmgr_site_by_eid()</a>
166 <a href="../api_reference/C/dbsite_set_config.html" class="olink">DB_SITE->set_config()</a>
169 <a href="../api_reference/C/dbsite_get_config.html" class="olink">DB_SITE->get_config()</a>
172 <a href="../api_reference/C/dbsite_remove.html" class="olink">DB_SITE->remove()</a>
175 <a href="../api_reference/C/dbsite_get_eid.html" class="olink">DB_SITE->get_eid()</a>
178 <a href="../api_reference/C/dbsite_get_address.html" class="olink">DB_SITE->get_address()</a>
181 <a href="../api_reference/C/dbsite_close.html" class="olink">DB_SITE->close()</a>
186 <div class="sect2" lang="en" xml:lang="en">
187 <div class="titlepage">
190 <h3 class="title"><a id="idp655568"></a>Modified Functions</h3>
194 <div class="itemizedlist">
196 <li><a href="../api_reference/C/repnsites.html" class="olink">DB_ENV->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
204 <div class="sect2" lang="en" xml:lang="en">
205 <div class="titlepage">
208 <h3 class="title"><a id="idp602496"></a>New Events</h3>
212 <div class="itemizedlist">
215 <code class="literal">DB_EVENT_REP_SITE_ADDED</code>
218 <code class="literal">DB_EVENT_REP_SITE_REMOVED</code>
221 <code class="literal">DB_EVENT_REP_LOCAL_SITE_REMOVED</code>
224 <code class="literal">DB_EVENT_REP_CONNECT_BROKEN</code>
227 <code class="literal">DB_EVENT_REP_CONNECT_ESTD</code>
230 <code class="literal">DB_EVENT_REP_CONNECT_TRY_FAILED</code>
233 <code class="literal">DB_EVENT_REP_INIT_DONE</code>
238 <div class="sect2" lang="en" xml:lang="en">
239 <div class="titlepage">
242 <h3 class="title"><a id="idp684960"></a>Removed Functions</h3>
246 <div class="itemizedlist">
249 <code class="methodname">DB_ENV->repmgr_set_local_site()</code>
252 <code class="methodname">DB_ENV->repmgr_add_local_site()</code>
255 <code class="methodname">DB_ENV->repmgr_add_remote_site()</code>
258 <code class="methodname">DB_ENV->repmgr_get_local_site()</code>
263 <div class="sect2" lang="en" xml:lang="en">
264 <div class="titlepage">
267 <h3 class="title"><a id="idp650072"></a>New Parameters</h3>
272 The following new parameters are passed to
273 <a href="../api_reference/C/dbsite_set_config.html" class="olink">DB_SITE->set_config()</a>.
275 <div class="itemizedlist">
278 <code class="literal">DB_BOOTSTRAP_HELPER</code>
281 <code class="literal">DB_GROUP_CREATOR</code>
284 <code class="literal">DB_LEGACY</code>
287 <code class="literal">DB_LOCAL_SITE</code>
290 <code class="literal">DB_REPMGR_PEER</code>
295 <div class="sect2" lang="en" xml:lang="en">
296 <div class="titlepage">
299 <h3 class="title"><a id="idp671784"></a>New Structure</h3>
303 <div class="itemizedlist">
305 <li><code class="literal">DB_REPMGR_CONN_ERR</code> encapsulates an EID
306 and an integer system error code.
312 <div class="navfooter">
314 <table width="100%" summary="Navigation footer">
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>
320 <td width="40%" align="right"> <a accesskey="n" href="upgrade_11gr2_52_heap.html">Next</a></td>
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>
327 <td width="40%" align="right" valign="top"> Heap Access Method</td>