mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 15:16:29 +00:00
Compare commits
19 Commits
dev/drop_r
...
test-UPM-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb06228760 | ||
|
|
3b89731899 | ||
|
|
138bee98e9 | ||
|
|
83ffe84ff5 | ||
|
|
bb3206a2bf | ||
|
|
49dfaea471 | ||
|
|
8edc64f64e | ||
|
|
3ce646f960 | ||
|
|
dc0e89e234 | ||
|
|
41b6194580 | ||
|
|
d501781a5f | ||
|
|
de5265f594 | ||
|
|
66ac4183b4 | ||
|
|
59e5bc1500 | ||
|
|
8164914598 | ||
|
|
eb867516ff | ||
|
|
6b961ab6a7 | ||
|
|
7e2d14d225 | ||
|
|
a90d1cf3dd |
2
.github/workflows/sonarqube-scan.yml
vendored
2
.github/workflows/sonarqube-scan.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
ref: '${{ github.head_ref }}'
|
ref: '${{ github.head_ref }}'
|
||||||
|
|
||||||
- name: Checkout GitHub Action Repo
|
- name: Checkout GitHub Action Repo
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v3.3.0
|
||||||
with:
|
with:
|
||||||
repository: EnterpriseDB/edb-github-actions.git
|
repository: EnterpriseDB/edb-github-actions.git
|
||||||
ref: master
|
ref: master
|
||||||
|
|||||||
11
HISTORY
11
HISTORY
@@ -1,8 +1,15 @@
|
|||||||
5.3.2 2022-??-??
|
5.3.3 2022-10-17
|
||||||
|
Support for PostgreSQL added
|
||||||
|
repmgrd: ensure event notification script is called for event
|
||||||
|
"repmgrd_upstream_disconnect"; GitHub #760 (Ian)
|
||||||
|
|
||||||
|
5.3.2 2022-05-25
|
||||||
standby clone: don't error out if unable to determine cluster size (Ian)
|
standby clone: don't error out if unable to determine cluster size (Ian)
|
||||||
node check: fix --downstream --nagios output; GitHub #749 (Ian)
|
node check: fix --downstream --nagios output; GitHub #749 (Ian)
|
||||||
repmgrd: ensure witness node marked active (hslightdb)
|
repmgrd: ensure witness node marked active (hslightdb)
|
||||||
repmgrd: improve walsender disable check (Ian)
|
repmgrd: improve walsender disable check (Ian)
|
||||||
|
general: ensure replication slots can be dropped by a
|
||||||
|
replication-only user (Ian)
|
||||||
|
|
||||||
5.3.1 2022-02-15
|
5.3.1 2022-02-15
|
||||||
repmgrd: fixes for potential connection leaks (hslightdb)
|
repmgrd: fixes for potential connection leaks (hslightdb)
|
||||||
@@ -67,7 +74,7 @@
|
|||||||
"standby clone" (Ian)
|
"standby clone" (Ian)
|
||||||
repmgr: add --upstream option to "node check"
|
repmgr: add --upstream option to "node check"
|
||||||
repmgr: report error code on follow/rejoin failure due to non-available
|
repmgr: report error code on follow/rejoin failure due to non-available
|
||||||
0 replication slot (Ian)
|
replication slot (Ian)
|
||||||
repmgr: ensure "node rejoin" checks for available replication slots (Ian)
|
repmgr: ensure "node rejoin" checks for available replication slots (Ian)
|
||||||
repmgr: improve "standby switchover" completion checks (Ian)
|
repmgr: improve "standby switchover" completion checks (Ian)
|
||||||
repmgr: add replication configuration file ownership check to
|
repmgr: add replication configuration file ownership check to
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ configfile-scan.c: configfile-scan.l
|
|||||||
$(REPMGR_CLIENT_OBJS): repmgr-client.h repmgr_version.h
|
$(REPMGR_CLIENT_OBJS): repmgr-client.h repmgr_version.h
|
||||||
|
|
||||||
repmgr: $(REPMGR_CLIENT_OBJS)
|
repmgr: $(REPMGR_CLIENT_OBJS)
|
||||||
$(CC) $(CFLAGS) $(REPMGR_CLIENT_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X)
|
$(CC) $(CFLAGS) $(REPMGR_CLIENT_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
repmgrd: $(REPMGRD_OBJS)
|
repmgrd: $(REPMGRD_OBJS)
|
||||||
$(CC) $(CFLAGS) $(REPMGRD_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X)
|
$(CC) $(CFLAGS) $(REPMGRD_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
|
||||||
|
|
||||||
$(REPMGR_CLIENT_OBJS): $(HEADERS)
|
$(REPMGR_CLIENT_OBJS): $(HEADERS)
|
||||||
$(REPMGRD_OBJS): $(HEADERS)
|
$(REPMGRD_OBJS): $(HEADERS)
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -7,8 +7,8 @@ replication capabilities with utilities to set up standby servers, monitor
|
|||||||
replication, and perform administrative tasks such as failover or switchover
|
replication, and perform administrative tasks such as failover or switchover
|
||||||
operations.
|
operations.
|
||||||
|
|
||||||
The most recent `repmgr` version (5.2.1) supports all PostgreSQL versions from
|
The most recent `repmgr` version (5.3.2) supports all PostgreSQL versions from
|
||||||
9.5 to 13. PostgreSQL 9.4 is also supported, with some restrictions.
|
9.5 to 14. PostgreSQL 9.4 is also supported, with some restrictions.
|
||||||
|
|
||||||
`repmgr` is distributed under the GNU GPL 3 and maintained by EnterpriseDB.
|
`repmgr` is distributed under the GNU GPL 3 and maintained by EnterpriseDB.
|
||||||
|
|
||||||
@@ -19,14 +19,6 @@ The full `repmgr` documentation is available here:
|
|||||||
|
|
||||||
> [repmgr documentation](https://repmgr.org/docs/current/index.html)
|
> [repmgr documentation](https://repmgr.org/docs/current/index.html)
|
||||||
|
|
||||||
The old `README` file for `repmgr` 3.x is available here:
|
|
||||||
|
|
||||||
> https://github.com/EnterpriseDB/repmgr/blob/REL3_3_STABLE/README.md
|
|
||||||
|
|
||||||
Note that the `repmgr` 3.x series is no longer supported and contains known bugs;
|
|
||||||
please upgrade to the [current repmgr version](https://repmgr.org/docs/current/appendix-release-notes.html)
|
|
||||||
as soon as possible.
|
|
||||||
|
|
||||||
Versions
|
Versions
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|||||||
@@ -4616,17 +4616,17 @@ drop_replication_slot_replprot(PGconn *repl_conn, char *slot_name)
|
|||||||
initPQExpBuffer(&query);
|
initPQExpBuffer(&query);
|
||||||
|
|
||||||
appendPQExpBuffer(&query,
|
appendPQExpBuffer(&query,
|
||||||
"DROP_REPLICATION_SLOT %s",
|
"DROP_REPLICATION_SLOT %s;",
|
||||||
slot_name);
|
slot_name);
|
||||||
|
|
||||||
log_verbose(LOG_DEBUG, "drop_replication_slot_replprot():\n %s", query.data);
|
log_verbose(LOG_DEBUG, "drop_replication_slot_replprot():\n %s", query.data);
|
||||||
|
|
||||||
res = PQexec(repl_conn, query.data);
|
res = PQexec(repl_conn, query.data);
|
||||||
|
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK || !PQntuples(res))
|
||||||
{
|
{
|
||||||
log_db_error(repl_conn, query.data,
|
log_db_error(repl_conn, query.data,
|
||||||
_("drop_replication_slot_sql(): unable to drop replication slot \"%s\""),
|
_("drop_replication_slot_replprot(): unable to drop replication slot \"%s\""),
|
||||||
slot_name);
|
slot_name);
|
||||||
|
|
||||||
success = false;
|
success = false;
|
||||||
|
|||||||
@@ -16,12 +16,45 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<!-- remember to update the release date in ../repmgr_version.h.in -->
|
<!-- remember to update the release date in ../repmgr_version.h.in -->
|
||||||
|
<sect1 id="release-5.3.3">
|
||||||
|
<title id="release-current">Release 5.3.3</title>
|
||||||
|
<para><emphasis>Mon 17 October, 2022</emphasis></para>
|
||||||
|
<para>
|
||||||
|
&repmgr; 5.3.3 is a minor release providing support for
|
||||||
|
<ulink url="https://www.postgresql.org/docs/15/release-15.html">PostgreSQL 15</ulink>
|
||||||
|
and a &repmgrd; bug fix.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
If upgrading from an earlier &repmgr; version, any running &repmgrd; instances should be restarted.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
If upgrading from &repmgr; 5.2.1 or earlier, a PostgreSQL restart <emphasis>is</emphasis> required.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<sect2>
|
||||||
|
<title>Bug fixes</title>
|
||||||
|
<para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
&repmgrd;: ensure <link linkend="event-notifications">event notification</link> script is called for event
|
||||||
|
<literal>repmgrd_upstream_disconnect</literal>. GitHub #760.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
|
</sect2>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="release-5.3.2">
|
<sect1 id="release-5.3.2">
|
||||||
<title id="release-current">Release 5.3.2</title>
|
<title>Release 5.3.2</title>
|
||||||
<para><emphasis>??? ??? ???, 2022</emphasis></para>
|
<para><emphasis>Wed 25 May, 2022</emphasis></para>
|
||||||
<para>
|
<para>
|
||||||
&repmgr; 5.3.2 is a minor release.
|
&repmgr; 5.3.2 is a minor release.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
Any running &repmgrd; instances should be restarted following this upgrade.
|
||||||
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If upgrading from &repmgr; 5.2.1 or earlier, a PostgreSQL restart <emphasis>is</emphasis> required.
|
If upgrading from &repmgr; 5.2.1 or earlier, a PostgreSQL restart <emphasis>is</emphasis> required.
|
||||||
</para>
|
</para>
|
||||||
@@ -61,6 +94,13 @@
|
|||||||
&repmgr; is a superuser before attempting to disable the WAL receiver.
|
&repmgr; is a superuser before attempting to disable the WAL receiver.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If the &repmgr; user is a non-superuser, and a replication-only user exists,
|
||||||
|
ensure redundant replication slots are dropped correctly even
|
||||||
|
if the <option>-S/--superuser</option> option is not provided.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|||||||
@@ -108,10 +108,31 @@
|
|||||||
<entry>
|
<entry>
|
||||||
Supported PostgreSQL versions
|
Supported PostgreSQL versions
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry>
|
||||||
|
Notes
|
||||||
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<row>
|
||||||
|
<entry>
|
||||||
|
&repmgr; 5.4
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
(dev)
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<link linkend="release-current">&repmgrversion;</link> (&releasedate;)
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
9.4, 9.5, 9.6, 10, 11, 12, 13, 15
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
|
||||||
|
</entry>
|
||||||
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry>
|
<entry>
|
||||||
&repmgr; 5.3
|
&repmgr; 5.3
|
||||||
@@ -123,7 +144,10 @@
|
|||||||
<link linkend="release-current">&repmgrversion;</link> (&releasedate;)
|
<link linkend="release-current">&repmgrversion;</link> (&releasedate;)
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
9.4, 9.5, 9.6, 10, 11, 12, 13, 14
|
9.4, 9.5, 9.6, 10, 11, 12, 13, 14, 15
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
PostgreSQL 15 supported from &repmgr; 5.3.3
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@@ -140,6 +164,9 @@
|
|||||||
<entry>
|
<entry>
|
||||||
9.4, 9.5, 9.6, 10, 11, 12, 13
|
9.4, 9.5, 9.6, 10, 11, 12, 13
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry>
|
||||||
|
|
||||||
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -155,6 +182,9 @@
|
|||||||
<entry>
|
<entry>
|
||||||
9.3, 9.4, 9.5, 9.6, 10, 11, 12
|
9.3, 9.4, 9.5, 9.6, 10, 11, 12
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry>
|
||||||
|
|
||||||
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -170,6 +200,9 @@
|
|||||||
<entry>
|
<entry>
|
||||||
9.3, 9.4, 9.5, 9.6, 10, 11, 12
|
9.3, 9.4, 9.5, 9.6, 10, 11, 12
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry>
|
||||||
|
|
||||||
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
|
||||||
@@ -186,6 +219,9 @@
|
|||||||
<entry>
|
<entry>
|
||||||
9.3, 9.4, 9.5, 9.6, 10, 11
|
9.3, 9.4, 9.5, 9.6, 10, 11
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry>
|
||||||
|
|
||||||
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -201,6 +237,9 @@
|
|||||||
<entry>
|
<entry>
|
||||||
9.3, 9.4, 9.5, 9.6
|
9.3, 9.4, 9.5, 9.6
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry>
|
||||||
|
|
||||||
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -216,6 +255,9 @@
|
|||||||
<entry>
|
<entry>
|
||||||
9.0, 9.1, 9.2, 9.3, 9.4
|
9.0, 9.1, 9.2, 9.3, 9.4
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry>
|
||||||
|
|
||||||
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
|||||||
@@ -73,16 +73,16 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>--force-rewind[=/path/to/pg_rewind]</option></term>
|
<term><option>--force-rewind</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Execute <application>pg_rewind</application>.
|
Execute <application>pg_rewind</application>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
It is only necessary to provide the <application>pg_rewind</application> path
|
See <xref linkend="repmgr-node-rejoin-pg-rewind"/> for more details on using
|
||||||
if using PostgreSQL 9.4, and <application>pg_rewind</application>
|
<application>pg_rewind</application>.
|
||||||
is not installed in the PostgreSQL <filename>bin</filename> directory.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -261,8 +261,6 @@
|
|||||||
<para>
|
<para>
|
||||||
<command>repmgr node rejoin</command> can optionally use <command>pg_rewind</command> to re-integrate a
|
<command>repmgr node rejoin</command> can optionally use <command>pg_rewind</command> to re-integrate a
|
||||||
node which has diverged from the rest of the cluster, typically a failed primary.
|
node which has diverged from the rest of the cluster, typically a failed primary.
|
||||||
<command>pg_rewind</command> is available in PostgreSQL 9.5 and later as part of the core distribution,
|
|
||||||
and can be installed from external sources for PostgreSQL 9.4.
|
|
||||||
</para>
|
</para>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
@@ -271,6 +269,10 @@
|
|||||||
data checksums were enabled when the cluster was initialized. See the
|
data checksums were enabled when the cluster was initialized. See the
|
||||||
<ulink url="https://www.postgresql.org/docs/current/app-pgrewind.html"><command>pg_rewind</command> documentation</ulink> for details.
|
<ulink url="https://www.postgresql.org/docs/current/app-pgrewind.html"><command>pg_rewind</command> documentation</ulink> for details.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
Additionally, <varname>full_page_writes</varname> must be enabled; this is the default and
|
||||||
|
normally should never be disabled.
|
||||||
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@@ -382,6 +384,29 @@
|
|||||||
DETAIL: node 2 is now attached to node 3</programlisting>
|
DETAIL: node 2 is now attached to node 3</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="repmgr-node-rejoin-postgresql-94" xreflabel="pg_rewind and PostgreSQL 9.4">
|
||||||
|
|
||||||
|
<title><command>pg_rewind</command> and PostgreSQL 9.4</title>
|
||||||
|
|
||||||
|
<indexterm>
|
||||||
|
<primary>pg_rewind</primary>
|
||||||
|
<secondary>PostgreSQL 9.4</secondary>
|
||||||
|
</indexterm>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<application>pg_rewind</application> is available in PostgreSQL 9.5 and later as part of the core distribution.
|
||||||
|
Users of PostgreSQL 9.4 will need to manually install it; the source code is available here:
|
||||||
|
<ulink url="https://github.com/vmware/pg_rewind">https://github.com/vmware/pg_rewind</ulink>.
|
||||||
|
If the <application>pg_rewind</application>
|
||||||
|
binary is not installed in the PostgreSQL <filename>bin</filename> directory, provide
|
||||||
|
its full path on the demotion candidate with <option>--force-rewind</option>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Note that building the 9.4 version of <application>pg_rewind</application> requires the PostgreSQL
|
||||||
|
source code.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="repmgr-node-rejoin-caveats" xreflabel="Caveats">
|
<refsect1 id="repmgr-node-rejoin-caveats" xreflabel="Caveats">
|
||||||
@@ -426,7 +451,7 @@
|
|||||||
|
|
||||||
<warning>
|
<warning>
|
||||||
<para>
|
<para>
|
||||||
In all current PostgreSQL versions (as of September 2020), <application>pg_rewind</application>
|
In all PostgreSQL released before February 2021, <application>pg_rewind</application>
|
||||||
contains a corner-case bug which affects standbys in a very specific situation.
|
contains a corner-case bug which affects standbys in a very specific situation.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
@@ -456,8 +481,7 @@
|
|||||||
<para>
|
<para>
|
||||||
Currently it is not possible to resolve this situation using <application>pg_rewind</application>.
|
Currently it is not possible to resolve this situation using <application>pg_rewind</application>.
|
||||||
A <ulink url="https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2b4f3130382fe2f8705863e4d38589d4d69cd695">patch</ulink>
|
A <ulink url="https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2b4f3130382fe2f8705863e4d38589d4d69cd695">patch</ulink>
|
||||||
has been successfully submitted and will be included the next PostgreSQL minor release round, scheduled for
|
was submitted and is included in all PostgreSQL versions released in February 2021 or later.
|
||||||
February 2021.
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
As a workaround, start the primary server the standby was previously attached to,
|
As a workaround, start the primary server the standby was previously attached to,
|
||||||
@@ -475,7 +499,7 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See also</title>
|
<title>See also</title>
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="repmgr-standby-follow"/>
|
<xref linkend="repmgr-standby-follow"/>, <xref linkend="repmgr-standby-switchover"/>
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|||||||
@@ -154,9 +154,12 @@
|
|||||||
<para>
|
<para>
|
||||||
Use <application>pg_rewind</application> to reintegrate the old primary if necessary
|
Use <application>pg_rewind</application> to reintegrate the old primary if necessary
|
||||||
(and the prerequisites for using <application>pg_rewind</application> are met).
|
(and the prerequisites for using <application>pg_rewind</application> are met).
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
If using PostgreSQL 9.4, and the <application>pg_rewind</application>
|
If using PostgreSQL 9.4, and the <application>pg_rewind</application>
|
||||||
binary is not installed in the PostgreSQL <filename>bin</filename> directory,
|
binary is not installed in the PostgreSQL <filename>bin</filename> directory,
|
||||||
provide its full path. For more details see also <xref linkend="switchover-pg-rewind"/>.
|
provide its full path. For more details see also <xref linkend="switchover-pg-rewind"/>
|
||||||
|
and <xref linkend="repmgr-node-rejoin-pg-rewind"/>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<abstract>
|
<abstract>
|
||||||
<para>
|
<para>
|
||||||
This is the official documentation of &repmgr; &repmgrversion; for
|
This is the official documentation of &repmgr; &repmgrversion; for
|
||||||
use with PostgreSQL 9.4 - PostgreSQL 14.
|
use with PostgreSQL 9.4 - PostgreSQL 15.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
&repmgr; is being continually developed and we strongly recommend using the
|
&repmgr; is being continually developed and we strongly recommend using the
|
||||||
|
|||||||
@@ -345,14 +345,18 @@
|
|||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Indicates a preferred priority (default: <literal>100</literal>) for promoting nodes;
|
Indicates a preferred priority (default: <literal>100</literal>) for promoting nodes.
|
||||||
a value of zero prevents the node being promoted to primary.
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Note that the priority setting is only applied if two or more nodes are
|
Note that the priority setting is only applied if two or more nodes are
|
||||||
determined as promotion candidates; in that case the node with the
|
determined as promotion candidates; in that case the node with the
|
||||||
higher priority is selected.
|
higher priority is selected.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
A value of zero will always prevent the node being promoted to primary, even if there
|
||||||
|
is no other promotion candidate.
|
||||||
|
</para>
|
||||||
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
|||||||
@@ -242,21 +242,12 @@
|
|||||||
</simpara>
|
</simpara>
|
||||||
</note>
|
</note>
|
||||||
<para>
|
<para>
|
||||||
For more details on <application>pg_rewind</application>, see:
|
For more details on <application>pg_rewind</application>, see section <xref linkend="repmgr-node-rejoin-pg-rewind"/>
|
||||||
|
in the <link linkend="repmgr-node-rejoin"><command>repmgr node rejoin</command></link> documentation and
|
||||||
|
the PostgreSQL documentation at
|
||||||
<ulink url="https://www.postgresql.org/docs/current/app-pgrewind.html">https://www.postgresql.org/docs/current/app-pgrewind.html</ulink>.
|
<ulink url="https://www.postgresql.org/docs/current/app-pgrewind.html">https://www.postgresql.org/docs/current/app-pgrewind.html</ulink>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
|
||||||
<application>pg_rewind</application> has been part of the core PostgreSQL distribution since
|
|
||||||
version 9.5. Users of PostgreSQL 9.4 will need to manually install it; the source code is available here:
|
|
||||||
<ulink url="https://github.com/vmware/pg_rewind">https://github.com/vmware/pg_rewind</ulink>.
|
|
||||||
If the <application>pg_rewind</application>
|
|
||||||
binary is not installed in the PostgreSQL <filename>bin</filename> directory, provide
|
|
||||||
its full path on the demotion candidate with <option>--force-rewind</option>.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Note that building the 9.4 version of <application>pg_rewind</application> requires the PostgreSQL
|
|
||||||
source code.
|
|
||||||
</para>
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,12 @@
|
|||||||
<secondary>minor release</secondary>
|
<secondary>minor release</secondary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
A minor release upgrade involves updating &repmgr; from one minor release to another
|
||||||
|
minor release within the same major release (e.g. <literal>5.3.1</literal> to <literal>5.3.2</literal>).
|
||||||
|
An upgrade between minor releases of differing major releases (e.g. <literal>5.2.1</literal> to <literal>5.3.2</literal>)
|
||||||
|
is a <link linkend="upgrading-major-version">major upgrade</link>.
|
||||||
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The process for installing minor version upgrades is quite straightforward:
|
The process for installing minor version upgrades is quite straightforward:
|
||||||
|
|
||||||
@@ -105,15 +111,17 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A PostgreSQL restart is <emphasis>not</emphasis> required for minor version upgrades.
|
A PostgreSQL restart is usually <emphasis>not</emphasis> required for minor version upgrades
|
||||||
|
within the same major version (e.g. <literal>5.3.1</literal> to <literal>5.3.2</literal>).
|
||||||
|
Be sure to check the <link linkend="appendix-release-notes">release notes</link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
The same &repmgr; "major version" (e.g. <literal>4.2</literal>) must be
|
The same &repmgr; "major version" (e.g. <literal>5.3</literal>) must be
|
||||||
installed on all nodes in the replication cluster. While it's possible to have differing
|
installed on all nodes in the replication cluster. While it's possible to have differing
|
||||||
&repmgr; "minor versions" (e.g. <literal>4.2.1</literal>) on different nodes,
|
&repmgr; "minor versions" (e.g. <literal>5.3.1</literal> and <literal>5.3.2</literal>)
|
||||||
we strongly recommend updating all nodes to the latest minor version.
|
on different nodes, we strongly recommend updating all nodes to the latest minor version.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
|
|||||||
@@ -3634,8 +3634,8 @@ can_use_pg_rewind(PGconn *conn, const char *data_directory, PQExpBufferData *rea
|
|||||||
/* "full_page_writes" must be on in any case */
|
/* "full_page_writes" must be on in any case */
|
||||||
if (guc_set(conn, "full_page_writes", "=", "off"))
|
if (guc_set(conn, "full_page_writes", "=", "off"))
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(reason,
|
appendPQExpBufferStr(reason,
|
||||||
_("\"full_page_writes\" must be set to \"on\""));
|
_("\"full_page_writes\" must be set to \"on\""));
|
||||||
|
|
||||||
can_use = false;
|
can_use = false;
|
||||||
}
|
}
|
||||||
@@ -3653,18 +3653,18 @@ can_use_pg_rewind(PGconn *conn, const char *data_directory, PQExpBufferData *rea
|
|||||||
if (data_checksum_version == UNKNOWN_DATA_CHECKSUM_VERSION)
|
if (data_checksum_version == UNKNOWN_DATA_CHECKSUM_VERSION)
|
||||||
{
|
{
|
||||||
if (can_use == false)
|
if (can_use == false)
|
||||||
appendPQExpBuffer(reason, "; ");
|
appendPQExpBufferStr(reason, "; ");
|
||||||
|
|
||||||
appendPQExpBuffer(reason,
|
appendPQExpBufferStr(reason,
|
||||||
_("\"wal_log_hints\" is set to \"off\" but unable to determine data checksum version"));
|
_("\"wal_log_hints\" is set to \"off\" but unable to determine data checksum version"));
|
||||||
can_use = false;
|
can_use = false;
|
||||||
}
|
}
|
||||||
else if (data_checksum_version == 0)
|
else if (data_checksum_version == 0)
|
||||||
{
|
{
|
||||||
if (can_use == false)
|
if (can_use == false)
|
||||||
appendPQExpBuffer(reason, "; ");
|
appendPQExpBufferStr(reason, "; ");
|
||||||
|
|
||||||
appendPQExpBuffer(reason,
|
appendPQExpBufferStr(reason,
|
||||||
_("\"wal_log_hints\" is set to \"off\" and data checksums are disabled"));
|
_("\"wal_log_hints\" is set to \"off\" and data checksums are disabled"));
|
||||||
|
|
||||||
can_use = false;
|
can_use = false;
|
||||||
@@ -3873,19 +3873,17 @@ drop_replication_slot_if_exists(PGconn *conn, int node_id, char *slot_name)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool use_replication_protocol = false;
|
bool use_replication_protocol = false;
|
||||||
PGconn *slot_conn = NULL;
|
PGconn *slot_conn = _get_replication_slot_connection(conn,
|
||||||
|
replication_user,
|
||||||
slot_conn = _get_replication_slot_connection(conn,
|
&use_replication_protocol);
|
||||||
replication_user,
|
|
||||||
&use_replication_protocol);
|
|
||||||
|
|
||||||
if (use_replication_protocol == true)
|
if (use_replication_protocol == true)
|
||||||
{
|
{
|
||||||
success = drop_replication_slot_replprot(conn, slot_name);
|
success = drop_replication_slot_replprot(slot_conn, slot_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
success = drop_replication_slot_sql(conn, slot_name);
|
success = drop_replication_slot_sql(slot_conn, slot_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success == true)
|
if (success == true)
|
||||||
@@ -3965,9 +3963,13 @@ _determine_replication_slot_user(PGconn *conn, t_node_info *upstream_node_record
|
|||||||
/* This should never happen */
|
/* This should never happen */
|
||||||
log_error("unable to determine replication slot user");
|
log_error("unable to determine replication slot user");
|
||||||
if (upstream_node_record != NULL)
|
if (upstream_node_record != NULL)
|
||||||
|
{
|
||||||
log_debug("%i %s %s", upstream_node_record->node_id, upstream_node_record->repluser, PQuser(conn));
|
log_debug("%i %s %s", upstream_node_record->node_id, upstream_node_record->repluser, PQuser(conn));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
log_debug("upstream_node_record not provided");
|
log_debug("upstream_node_record not provided");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3984,13 +3986,13 @@ _get_replication_slot_connection(PGconn *conn, char *replication_user, bool *use
|
|||||||
switch (ReplicationSlotUser)
|
switch (ReplicationSlotUser)
|
||||||
{
|
{
|
||||||
case USER_TYPE_UNKNOWN:
|
case USER_TYPE_UNKNOWN:
|
||||||
log_error("unable to determine user for replication slot creation");
|
log_error("unable to determine user for managing replication slots");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
case REPMGR_USER:
|
case REPMGR_USER:
|
||||||
slot_conn = conn;
|
slot_conn = conn;
|
||||||
log_info(_("creating replication slot as user \"%s\""),
|
log_verbose(LOG_INFO, _("managing replication slot as user \"%s\""),
|
||||||
PQuser(conn));
|
PQuser(conn));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REPLICATION_USER_NODE:
|
case REPLICATION_USER_NODE:
|
||||||
@@ -4001,7 +4003,7 @@ _get_replication_slot_connection(PGconn *conn, char *replication_user, bool *use
|
|||||||
true);
|
true);
|
||||||
if (slot_conn == NULL || PQstatus(slot_conn) != CONNECTION_OK)
|
if (slot_conn == NULL || PQstatus(slot_conn) != CONNECTION_OK)
|
||||||
{
|
{
|
||||||
log_error(_("unable to create replication connection as user \"%s\""),
|
log_error(_("unable to manage replication connection as replication user \"%s\""),
|
||||||
runtime_options.replication_user);
|
runtime_options.replication_user);
|
||||||
log_detail("%s", PQerrorMessage(slot_conn));
|
log_detail("%s", PQerrorMessage(slot_conn));
|
||||||
|
|
||||||
@@ -4009,8 +4011,8 @@ _get_replication_slot_connection(PGconn *conn, char *replication_user, bool *use
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
*use_replication_protocol = true;
|
*use_replication_protocol = true;
|
||||||
log_info(_("creating replication slot as replication user \"%s\""),
|
log_verbose(LOG_INFO, _("managing replication slot as replication user \"%s\""),
|
||||||
replication_user);
|
replication_user);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -4021,7 +4023,7 @@ _get_replication_slot_connection(PGconn *conn, char *replication_user, bool *use
|
|||||||
false);
|
false);
|
||||||
if (slot_conn == NULL || PQstatus(slot_conn )!= CONNECTION_OK)
|
if (slot_conn == NULL || PQstatus(slot_conn )!= CONNECTION_OK)
|
||||||
{
|
{
|
||||||
log_error(_("unable to create super connection as user \"%s\""),
|
log_error(_("unable to create superuser connection as user \"%s\""),
|
||||||
runtime_options.superuser);
|
runtime_options.superuser);
|
||||||
log_detail("%s", PQerrorMessage(slot_conn));
|
log_detail("%s", PQerrorMessage(slot_conn));
|
||||||
|
|
||||||
@@ -4029,8 +4031,8 @@ _get_replication_slot_connection(PGconn *conn, char *replication_user, bool *use
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
log_info(_("creating replication slot as superuser \"%s\""),
|
log_verbose(LOG_INFO, _("creating replication slot as superuser \"%s\""),
|
||||||
runtime_options.superuser);
|
runtime_options.superuser);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
18
repmgr.c
18
repmgr.c
@@ -86,7 +86,6 @@ static shmem_request_hook_type prev_shmem_request_hook = NULL;
|
|||||||
static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
|
static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
|
||||||
|
|
||||||
void _PG_init(void);
|
void _PG_init(void);
|
||||||
void _PG_fini(void);
|
|
||||||
|
|
||||||
#if (PG_VERSION_NUM >= 150000)
|
#if (PG_VERSION_NUM >= 150000)
|
||||||
static void repmgr_shmem_request(void);
|
static void repmgr_shmem_request(void);
|
||||||
@@ -145,21 +144,6 @@ _PG_init(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Module unload callback
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
_PG_fini(void)
|
|
||||||
{
|
|
||||||
/* Uninstall hook */
|
|
||||||
#if (PG_VERSION_NUM >= 150000)
|
|
||||||
shmem_request_hook = prev_shmem_request_hook;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
shmem_startup_hook = prev_shmem_startup_hook;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if (PG_VERSION_NUM >= 150000)
|
#if (PG_VERSION_NUM >= 150000)
|
||||||
/*
|
/*
|
||||||
* shmem_requst_hook: request shared memory
|
* shmem_requst_hook: request shared memory
|
||||||
@@ -177,7 +161,7 @@ repmgr_shmem_request(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* shmem_ hook: allocate or attach to shared memory,
|
* shmem_startup hook: allocate or attach to shared memory
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
repmgr_shmem_startup(void)
|
repmgr_shmem_startup(void)
|
||||||
|
|||||||
@@ -1587,22 +1587,22 @@ monitor_streaming_standby(void)
|
|||||||
/* TODO: possibly add pre-action event here */
|
/* TODO: possibly add pre-action event here */
|
||||||
if (upstream_node_info.type == STANDBY)
|
if (upstream_node_info.type == STANDBY)
|
||||||
{
|
{
|
||||||
create_event_record(primary_conn,
|
create_event_notification(primary_conn,
|
||||||
&config_file_options,
|
&config_file_options,
|
||||||
config_file_options.node_id,
|
config_file_options.node_id,
|
||||||
"repmgrd_upstream_disconnect",
|
"repmgrd_upstream_disconnect",
|
||||||
true,
|
true,
|
||||||
event_details.data);
|
event_details.data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* primary connection lost - script notification only */
|
/* primary connection lost - script notification only */
|
||||||
create_event_record(NULL,
|
create_event_notification(NULL,
|
||||||
&config_file_options,
|
&config_file_options,
|
||||||
config_file_options.node_id,
|
config_file_options.node_id,
|
||||||
"repmgrd_upstream_disconnect",
|
"repmgrd_upstream_disconnect",
|
||||||
true,
|
true,
|
||||||
event_details.data);
|
event_details.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
log_warning("%s", event_details.data);
|
log_warning("%s", event_details.data);
|
||||||
@@ -2482,12 +2482,12 @@ monitor_streaming_witness(void)
|
|||||||
_("unable to connect to primary node \"%s\" (ID: %i)"),
|
_("unable to connect to primary node \"%s\" (ID: %i)"),
|
||||||
upstream_node_info.node_name, upstream_node_info.node_id);
|
upstream_node_info.node_name, upstream_node_info.node_id);
|
||||||
|
|
||||||
create_event_record(NULL,
|
create_event_notification(NULL,
|
||||||
&config_file_options,
|
&config_file_options,
|
||||||
config_file_options.node_id,
|
config_file_options.node_id,
|
||||||
"repmgrd_upstream_disconnect",
|
"repmgrd_upstream_disconnect",
|
||||||
true,
|
true,
|
||||||
event_details.data);
|
event_details.data);
|
||||||
termPQExpBuffer(&event_details);
|
termPQExpBuffer(&event_details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user