Compare commits

...

6 Commits

Author SHA1 Message Date
Martín Marqués
c9c380a022 Provide fix for failing pg_rewind with non-superuser
Issue #829 was opened indicating, with a reproducible, that repmgr
was not able to run `node rejoin` with minimal privileged user. The
main obstacle is that pg_rewind is not able to execute the rewind
operation if the user has REPLICATION privileges, but the user
repmgr uses requires REPLICATION. This is a typical catch22.

The solution provided here adds a --superuser, similar to what
other commands have, to `node rejoin`

AI-assisted development notes:

    The approach was designed and directed by Martín Marqués, who
    also reviewed and refined the output. Code was written by Claude
    (AI), with some additions from Martín in the documentation.

Fixes #829

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Martín Marqués <martin.marques@enterprisedb.com>
2026-03-28 17:01:48 +01:00
Arthur Nascimento
e696e28f43 install-requirements.xml: fix compatibility matrix
The same document states that "repmgr 5.5.0 is compatible with all
supported PostgreSQL versions from 13.x", so 12 shouldn't be listed in
the matrix.

Moreover, 14 is missing in 5.5 and 5.4.1, which looks like an accidental
omission that might have happened when support for 15 was added on a
version that only advertized 13 up to that point. 14 should have been
added along with 15 then.
2025-04-17 11:27:45 -04:00
Ian Barwick
8a3cdcd1b9 doc: update README
Update contributors list to reflect current status.
2025-01-21 10:47:05 +09:00
Mario Gonzalez
682bd7306d Update product matrix and copyright date
References: https://github.com/EnterpriseDB/repmgr/issues/879
2025-01-15 15:42:38 -03:00
Mario Gonzalez
c0d9dc6dac Update HISTORY and appendix for v5.5.0
References: HL-38
2024-11-22 11:34:48 -03:00
Mario Gonzalez
836894c965 Bump repmgr.control to 5.5
References: HL-38
2024-11-21 14:42:50 +01:00
12 changed files with 138 additions and 29 deletions

View File

@@ -1,4 +1,9 @@
5.4.1 2023-??-??
5.5.0 2024-11-20
Support for PostgreSQL 17 added
Fix warnings detected by the -Wshadow=compatible-local
added in PostgreSQL 16
5.4.1 2023-07-04
repmgrd: ensure witness node metadata is updated (Ian)
5.4.0 2023-03-16

View File

@@ -68,7 +68,6 @@ news are always welcome.
Thanks from the repmgr core team.
* Ian Barwick
* Israel Barth
* Mario González
* Martín Marqués
@@ -76,6 +75,7 @@ Thanks from the repmgr core team.
Past contributors:
* Ian Barwick
* Jaime Casanova
* Abhijit Menon-Sen
* Simon Riggs

View File

@@ -16,9 +16,24 @@
</para>
<!-- remember to update the release date in ../repmgr_version.h.in -->
<sect1 id="release-5.5.0">
<title>Release 5.5.0</title>
<para><emphasis>Wed 20 November, 2024</emphasis></para>
<para>
&repmgr; 5.5.0 is a major release.
</para>
<para>
This release adds support for PostgreSQL 17
</para>
<para>
Fixes warnings detected by the -Wshadow gcc flag added in PostgreSQL 16.
</para>
</sect1>
<sect1 id="release-5.4.1">
<title id="release-current">Release 5.4.1</title>
<para><emphasis>??? ?? ??????, 202?</emphasis></para>
<para><emphasis>Tue 04 Jul, 2023</emphasis></para>
<para>
&repmgr; 5.4.1 is a minor release providing ...
</para>

View File

@@ -192,6 +192,9 @@
<listitem>
<simpara><link linkend="repmgr-node-service">repmgr node service</link> (to execute <command>CHECKPOINT</command> via the <option>--checkpoint</option>; note this is also called by <link linkend="repmgr-standby-switchover">repmgr standby switchover</link>)</simpara>
</listitem>
<listitem>
<simpara><link linkend="repmgr-node-rejoin">repmgr node rejoin</link> (to execute <command>repmgr node rejoin --force-rewind</command>)</simpara>
</listitem>
</itemizedlist>
</para>
</sect3>

View File

@@ -14,7 +14,7 @@
</para>
<para>
&repmgr; &repmgrversion; is compatible with all PostgreSQL versions from 9.4. See
&repmgr; &repmgrversion; is compatible with all supported PostgreSQL versions from 13.x. See
section <link linkend="install-compatibility-matrix">&repmgr; compatibility matrix</link>
for an overview of version compatibility.
</para>
@@ -45,7 +45,7 @@
of incompatibilities.
</simpara>
<simpara>
If different &quot;major&quot; &repmgr; versions (e.g. 4.1.x and &repmgrversion;.x)
If different &quot;major&quot; &repmgr; versions (e.g. 5.2.x and &repmgrversion;)
are installed on different nodes, in the best case &repmgr; (in particular &repmgrd;)
will not run. In the worst case, you will end up with a broken cluster.
</simpara>
@@ -89,7 +89,6 @@
which PostgreSQL version.
</para>
<table id="repmgr-compatibility-matrix">
<title>&repmgr; compatibility matrix</title>
@@ -117,16 +116,16 @@
<tbody>
<row>
<entry>
&repmgr; 5.4
&repmgr; 5.5
</entry>
<entry>
(dev)
Yes
</entry>
<entry>
<link linkend="release-current">&repmgrversion;</link> (&releasedate;)
<link linkend="release-5.5.0">&repmgrversion;</link> (&releasedate;)
</entry>
<entry>
9.4, 9.5, 9.6, 10, 11, 12, 13, 15
13, 14, 15, 16, 17
</entry>
<entry>
&nbsp;
@@ -135,13 +134,31 @@
<row>
<entry>
&repmgr; 5.3
&repmgr; 5.4.1
</entry>
<entry>
YES
Yes
</entry>
<entry>
<link linkend="release-current">&repmgrversion;</link> (&releasedate;)
<link linkend="release-5.4.1">5.4.1</link> (2023-04-04)
</entry>
<entry>
10, 11, 12, 13, 14, 15
</entry>
<entry>
&nbsp;
</entry>
</row>
<row>
<entry>
&repmgr; 5.3.1
</entry>
<entry>
Yes
</entry>
<entry>
<link linkend="release-5.3.1">5.3.1</link> (2022-02-15)
</entry>
<entry>
9.4, 9.5, 9.6, 10, 11, 12, 13, 14, 15
@@ -156,7 +173,7 @@
&repmgr; 5.2
</entry>
<entry>
NO
No
</entry>
<entry>
<link linkend="release-5.2.1">5.2.1</link> (2020-12-07)
@@ -174,7 +191,7 @@
&repmgr; 5.1
</entry>
<entry>
NO
No
</entry>
<entry>
<link linkend="release-5.1.0">5.1.0</link> (2020-04-13)
@@ -192,7 +209,7 @@
&repmgr; 5.0
</entry>
<entry>
NO
No
</entry>
<entry>
<link linkend="release-5.0">5.0</link> (2019-10-15)
@@ -211,7 +228,7 @@
&repmgr; 4.x
</entry>
<entry>
NO
No
</entry>
<entry>
<link linkend="release-4.4">4.4</link> (2019-06-27)
@@ -229,7 +246,7 @@
&repmgr; 3.x
</entry>
<entry>
NO
No
</entry>
<entry>
<ulink url="https://repmgr.org/release-notes-3.3.2.html">3.3.2</ulink> (2017-05-30)
@@ -247,7 +264,7 @@
&repmgr; 2.x
</entry>
<entry>
NO
No
</entry>
<entry>
<ulink url="https://repmgr.org/release-notes-2.0.3.html">2.0.3</ulink> (2015-04-16)
@@ -266,12 +283,12 @@
<important>
<para>
The &repmgr; 2.x and 3.x series are no longer maintained or supported.
The &repmgr; series older than 5.x are no longer maintained or supported.
We strongly recommend upgrading to the latest &repmgr; version.
</para>
<para>
Following the release of &repmgr; 5.0, there will be no further releases of
the &repmgr; 4.x series. Note that &repmgr; 5.x is an incremental development
the &repmgr; 4.x series or older. Note that &repmgr; 5.x is an incremental development
of the 4.x series and &repmgr; 4.x users should upgrade to this as soon as possible.
</para>
</important>

View File

@@ -1,9 +1,9 @@
<!-- doc/legal.xml -->
<date>2022</date>
<date>2025</date>
<copyright>
<year>2010-2022</year>
<year>2010-2025</year>
<holder>EDB</holder>
</copyright>
@@ -11,7 +11,7 @@
<title>Legal Notice</title>
<para>
<productname>repmgr</productname> is Copyright &copy; 2010-2022
<productname>repmgr</productname> is Copyright &copy; 2010-2025
by EDB All rights reserved.
</para>

View File

@@ -113,6 +113,29 @@
</varlistentry>
<varlistentry>
<term><option>-S/--superuser</option></term>
<listitem>
<para>
Specify a superuser to be used by <application>pg_rewind</application>
for its source server connection.
</para>
<para>
<application>pg_rewind</application> requires a normal (non-replication)
connection with <literal>pg_read_server_files</literal> privilege or
superuser rights. If the &repmgr; user has the <literal>REPLICATION</literal>
attribute but lacks these privileges, use this option to specify
a suitably privileged user for the <application>pg_rewind</application>
connection. The superuser's password should be configured in
<filename>.pgpass</filename>.
</para>
<para>
This option is only effective in combination with
<option>--force-rewind</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-W/--no-wait</option></term>
<listitem>
@@ -281,6 +304,23 @@
a &quot;magic bullet&quot; which can resolve all problematic replication situations.
</para>
<note>
<para>
<command>pg_rewind</command> requires a normal (non-replication) connection to
the source server. The user for this connection must have superuser rights or
the <literal>pg_read_server_files</literal> role.
</para>
<para>
If the &repmgr; user has the <literal>REPLICATION</literal> attribute but does
not have the privileges required by <command>pg_rewind</command>, use the
<option>-S/--superuser</option> option to specify a suitably privileged user
for the <command>pg_rewind</command> source connection. For example:
<programlisting>
repmgr node rejoin -f /etc/repmgr.conf -d 'host=node3 dbname=repmgr user=repmgr' \
--force-rewind -S postgres</programlisting>
</para>
</note>
<para>
A typical use-case for <command>pg_rewind</command> is when a scenario like the following
is encountered:

View File

@@ -26,7 +26,7 @@
<abstract>
<para>
This is the official documentation of &repmgr; &repmgrversion; for
use with PostgreSQL 9.4 - PostgreSQL 15.
use with PostgreSQL 12 - PostgreSQL 17.
</para>
<para>
&repmgr; is being continually developed and we strongly recommend using the

View File

@@ -2838,9 +2838,29 @@ do_node_rejoin(void)
appendShellString(&command,
config_file_options.data_directory);
appendPQExpBuffer(&command,
" --source-server='%s'",
primary_node_record.conninfo);
if (runtime_options.superuser[0] != '\0')
{
t_conninfo_param_list rewind_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
char *rewind_conninfo_str = NULL;
initialize_conninfo_params(&rewind_conninfo, false);
parse_conninfo_string(primary_node_record.conninfo, &rewind_conninfo, NULL, false);
param_set(&rewind_conninfo, "user", runtime_options.superuser);
rewind_conninfo_str = param_list_to_string(&rewind_conninfo);
appendPQExpBuffer(&command,
" --source-server='%s'",
rewind_conninfo_str);
pfree(rewind_conninfo_str);
free_conninfo_params(&rewind_conninfo);
}
else
{
appendPQExpBuffer(&command,
" --source-server='%s'",
primary_node_record.conninfo);
}
if (runtime_options.dry_run == true)
{
@@ -3698,6 +3718,7 @@ do_node_help(void)
printf(_(" --config-archive-dir directory to temporarily store retained configuration files\n" \
" (default: /tmp)\n"));
printf(_(" -W, --no-wait don't wait for the node to rejoin cluster\n"));
printf(_(" -S, --superuser=USERNAME superuser to use for pg_rewind if repmgr user is not superuser\n"));
puts("");
printf(_("NODE SERVICE\n"));

View File

@@ -5359,6 +5359,13 @@ do_standby_switchover(void)
}
appendPQExpBufferChar(&node_rejoin_options, ' ');
if (runtime_options.superuser[0] != '\0')
{
appendPQExpBuffer(&node_rejoin_options,
"--superuser=%s ",
runtime_options.superuser);
}
}
key_value_list_free(&remote_config_files);

View File

@@ -1761,6 +1761,7 @@ check_cli_parameters(const int action)
case STANDBY_SWITCHOVER:
case NODE_CHECK:
case NODE_SERVICE:
case NODE_REJOIN:
break;
default:
item_list_append_format(&cli_warnings,

View File

@@ -1,6 +1,6 @@
# repmgr extension
comment = 'Replication manager for PostgreSQL'
default_version = '5.4'
default_version = '5.5'
module_pathname = '$libdir/repmgr'
relocatable = false
schema = repmgr