mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Compare commits
46 Commits
v5.5.0
...
REL4_4_STA
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1337f68caf | ||
|
|
00494f1a15 | ||
|
|
1460e6400a | ||
|
|
daa7de1cd0 | ||
|
|
0fbc0f42b5 | ||
|
|
34aa54b766 | ||
|
|
01ec64c330 | ||
|
|
41637f0c43 | ||
|
|
b61989bafe | ||
|
|
c2987b6c9b | ||
|
|
c6d151ef56 | ||
|
|
867ebcb52d | ||
|
|
9abf72af07 | ||
|
|
2256c0a81f | ||
|
|
701fdd9622 | ||
|
|
5c1ca6cba5 | ||
|
|
2dce4b06b4 | ||
|
|
f1716a67b0 | ||
|
|
1d43f1cdb5 | ||
|
|
7cc12f08ed | ||
|
|
8484bc6687 | ||
|
|
d92d008cb3 | ||
|
|
38adf5daca | ||
|
|
4a8684e37b | ||
|
|
9c9f4c8c32 | ||
|
|
0e1319d788 | ||
|
|
9c784f804e | ||
|
|
13097e30f0 | ||
|
|
40b6c92129 | ||
|
|
761d65526c | ||
|
|
a13a1232e9 | ||
|
|
65965b3ba4 | ||
|
|
629d2b8f85 | ||
|
|
23c285b73b | ||
|
|
915fb7d617 | ||
|
|
ae141b9d32 | ||
|
|
d035550723 | ||
|
|
c7692b5d84 | ||
|
|
08b7f1294b | ||
|
|
81d01bf0e8 | ||
|
|
089c778e49 | ||
|
|
b4b5681762 | ||
|
|
e5ef549aa7 | ||
|
|
cfc41392c3 | ||
|
|
55dc4f7a5f | ||
|
|
6616712346 |
10
HISTORY
10
HISTORY
@@ -1,4 +1,8 @@
|
||||
4.4 2019-??-??
|
||||
4.4.1 2019-??-??
|
||||
repmgr: improve data directory check (Ian)
|
||||
repmgr: improve extension check during "standby clone" (Ian)
|
||||
|
||||
4.4 2019-06-27
|
||||
repmgr: improve "daemon status" output (Ian)
|
||||
repmgr: add "--siblings-follow" option to "standby promote" (Ian)
|
||||
repmgr: add "--repmgrd-force-unpause" option to "standby switchover" (Ian)
|
||||
@@ -6,6 +10,8 @@
|
||||
an existing directory is being overwritten (Ian)
|
||||
repmgr: improve "--dry-run" behaviour for "standby promote" and
|
||||
"standby switchover" (Ian)
|
||||
repmgr: when running "standby clone" with the "--upstream-conninfo" option
|
||||
ensure that "application_name" is set correctly in "primary_conninfo" (Ian)
|
||||
repmgr: ensure "--dry-run" together with --force when running "standby clone"
|
||||
in barman mode does not modify an existing data directory (Ian)
|
||||
repmgr: improve "--dry-run" output when running "standby clone" in
|
||||
@@ -21,6 +27,8 @@
|
||||
repmgr: prevent a witness server being registered on the cluster primary (John)
|
||||
repmgr: ensure BDR2-specific functionality cannot be used on
|
||||
BDR3 and later (Ian)
|
||||
repmgr: canonicalize the data directory path (Ian)
|
||||
repmgr: note that "standby follow" requires a primary to be available (Ian)
|
||||
repmgrd: monitor standbys attached to primary (Ian)
|
||||
repmgrd: add "primary visibility consensus" functionality (Ian)
|
||||
repmgrd: fix memory leak which occurs while the monitored PostgreSQL
|
||||
|
||||
@@ -24,4 +24,5 @@ include $(PGXS)
|
||||
-include ${repmgr_abs_srcdir}/Makefile.custom
|
||||
|
||||
REPMGR_VERSION=$(shell awk '/^\#define REPMGR_VERSION / { print $3; }' ${repmgr_abs_srcdir}/repmgr_version.h.in | cut -d '"' -f 2)
|
||||
REPMGR_RELEASE_DATE=$(shell awk '/^\#define REPMGR_RELEASE_DATE / { print $3; }' ${repmgr_abs_srcdir}/repmgr_version.h.in | cut -d '"' -f 2)
|
||||
|
||||
|
||||
@@ -502,10 +502,15 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
|
||||
else if (strcmp(name, "conninfo") == 0)
|
||||
strncpy(options->conninfo, value, MAXLEN);
|
||||
else if (strcmp(name, "data_directory") == 0)
|
||||
{
|
||||
strncpy(options->data_directory, value, MAXPGPATH);
|
||||
canonicalize_path(options->data_directory);
|
||||
}
|
||||
else if (strcmp(name, "config_directory") == 0)
|
||||
{
|
||||
strncpy(options->config_directory, value, MAXPGPATH);
|
||||
|
||||
canonicalize_path(options->config_directory);
|
||||
}
|
||||
else if (strcmp(name, "replication_user") == 0)
|
||||
{
|
||||
if (strlen(value) < sizeof(options->replication_user))
|
||||
|
||||
72
dbutils.c
72
dbutils.c
@@ -336,12 +336,10 @@ establish_db_connection_by_params(t_conninfo_param_list *param_list,
|
||||
bool
|
||||
is_superuser_connection(PGconn *conn, t_connection_user *userinfo)
|
||||
{
|
||||
char *current_user = NULL;
|
||||
const char *superuser_status = NULL;
|
||||
bool is_superuser = false;
|
||||
const char *current_user = PQuser(conn);
|
||||
const char *superuser_status = PQparameterStatus(conn, "is_superuser");
|
||||
|
||||
current_user = PQuser(conn);
|
||||
superuser_status = PQparameterStatus(conn, "is_superuser");
|
||||
is_superuser = (strcmp(superuser_status, "on") == 0) ? true : false;
|
||||
|
||||
if (userinfo != NULL)
|
||||
@@ -356,6 +354,51 @@ is_superuser_connection(PGconn *conn, t_connection_user *userinfo)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
connection_has_pg_settings(PGconn *conn)
|
||||
{
|
||||
bool has_pg_settings = false;
|
||||
|
||||
/* superusers can always read pg_settings */
|
||||
if (is_superuser_connection(conn, NULL) == true)
|
||||
{
|
||||
has_pg_settings = true;
|
||||
}
|
||||
/* from PostgreSQL 10, a non-superuser may have been granted access */
|
||||
else if(PQserverVersion(conn) >= 100000)
|
||||
{
|
||||
PQExpBufferData query;
|
||||
PGresult *res;
|
||||
|
||||
initPQExpBuffer(&query);
|
||||
appendPQExpBufferStr(&query,
|
||||
" SELECT CASE "
|
||||
" WHEN pg_catalog.pg_has_role('pg_monitor','MEMBER') "
|
||||
" THEN TRUE "
|
||||
" WHEN pg_catalog.pg_has_role('pg_read_all_settings','MEMBER') "
|
||||
" THEN TRUE "
|
||||
" ELSE FALSE "
|
||||
" END AS has_pg_settings");
|
||||
|
||||
res = PQexec(conn, query.data);
|
||||
|
||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||
{
|
||||
log_db_error(conn, query.data,
|
||||
_("connection_has_pg_settings(): unable to query user roles"));
|
||||
}
|
||||
else
|
||||
{
|
||||
has_pg_settings = atobool(PQgetvalue(res, 0, 0));
|
||||
}
|
||||
termPQExpBuffer(&query);
|
||||
PQclear(res);
|
||||
}
|
||||
|
||||
return has_pg_settings;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
close_connection(PGconn **conn)
|
||||
{
|
||||
@@ -1865,8 +1908,20 @@ repmgrd_set_pid(PGconn *conn, pid_t repmgrd_pid, const char *pidfile)
|
||||
initPQExpBuffer(&query);
|
||||
|
||||
appendPQExpBuffer(&query,
|
||||
"SELECT repmgr.set_repmgrd_pid(%i, '%s')",
|
||||
(int) repmgrd_pid, pidfile);
|
||||
"SELECT repmgr.set_repmgrd_pid(%i, ",
|
||||
(int) repmgrd_pid);
|
||||
|
||||
if (pidfile != NULL)
|
||||
{
|
||||
appendPQExpBuffer(&query,
|
||||
" '%s')",
|
||||
pidfile);
|
||||
}
|
||||
else
|
||||
{
|
||||
appendPQExpBufferStr(&query,
|
||||
" '')");
|
||||
}
|
||||
|
||||
res = PQexec(conn, query.data);
|
||||
termPQExpBuffer(&query);
|
||||
@@ -2092,9 +2147,9 @@ get_repmgr_extension_status(PGconn *conn, t_extension_versions *extversions)
|
||||
appendPQExpBufferStr(&query,
|
||||
" SELECT ae.name, e.extname, "
|
||||
" ae.default_version, "
|
||||
" (((ae.default_version::NUMERIC::INT) * 10000) + (ae.default_version::NUMERIC - ae.default_version::NUMERIC::INT) * 1000)::INT AS available, "
|
||||
" (((FLOOR(ae.default_version::NUMERIC)::INT) * 10000) + (ae.default_version::NUMERIC - FLOOR(ae.default_version::NUMERIC)::INT) * 1000)::INT AS available, "
|
||||
" ae.installed_version, "
|
||||
" (((ae.installed_version::NUMERIC::INT) * 10000) + (ae.installed_version::NUMERIC - ae.installed_version::NUMERIC::INT) * 1000)::INT AS installed "
|
||||
" (((FLOOR(ae.installed_version::NUMERIC)::INT) * 10000) + (ae.installed_version::NUMERIC - FLOOR(ae.installed_version::NUMERIC)::INT) * 1000)::INT AS installed "
|
||||
" FROM pg_catalog.pg_available_extensions ae "
|
||||
"LEFT JOIN pg_catalog.pg_extension e "
|
||||
" ON e.extname=ae.name "
|
||||
@@ -5073,6 +5128,7 @@ init_replication_info(ReplInfo *replication_info)
|
||||
replication_info->receiving_streamed_wal = true;
|
||||
replication_info->wal_replay_paused = false;
|
||||
replication_info->upstream_last_seen = -1;
|
||||
replication_info->upstream_node_id = UNKNOWN_NODE_ID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -438,6 +438,7 @@ PGconn *get_primary_connection(PGconn *standby_conn, int *primary_id, char *p
|
||||
PGconn *get_primary_connection_quiet(PGconn *standby_conn, int *primary_id, char *primary_conninfo_out);
|
||||
|
||||
bool is_superuser_connection(PGconn *conn, t_connection_user *userinfo);
|
||||
bool connection_has_pg_settings(PGconn *conn);
|
||||
void close_connection(PGconn **conn);
|
||||
|
||||
/* conninfo manipulation functions */
|
||||
|
||||
@@ -31,6 +31,7 @@ ALLXML := $(wildcard $(srcdir)/*.xml) $(GENERATED_XML)
|
||||
version.xml: $(repmgr_top_builddir)/repmgr_version.h
|
||||
{ \
|
||||
echo "<!ENTITY repmgrversion \"$(REPMGR_VERSION)\">"; \
|
||||
echo "<!ENTITY releasedate \"$(REPMGR_RELEASE_DATE)\">"; \
|
||||
} > $@
|
||||
|
||||
##
|
||||
|
||||
@@ -16,8 +16,36 @@
|
||||
</para>
|
||||
|
||||
<sect1 id="release-4.4">
|
||||
<title>Release 4.4</title>
|
||||
<para><emphasis>?? June, 2019</emphasis></para>
|
||||
<title id="release-current">Release 4.4</title>
|
||||
<para><emphasis>27 June, 2019</emphasis></para>
|
||||
|
||||
<para>
|
||||
&repmgr; 4.4 is a major release.
|
||||
</para>
|
||||
<para>
|
||||
For details on how to upgrade an existing &repmgr; instrallation, see
|
||||
documentation section <link linkend="upgrading-major-version">Upgrading a major version release</link>.
|
||||
</para>
|
||||
<para>
|
||||
If &repmgrd; is in use, a PostgreSQL restart <emphasis>is</emphasis> required;
|
||||
in that case we suggest combining this &repmgr; upgrade with the next PostgreSQL
|
||||
minor release, which will require a PostgreSQL restart in any case.
|
||||
</para>
|
||||
|
||||
|
||||
<important>
|
||||
<para>
|
||||
On Debian-based systems, including Ubuntu, if using &repmgrd;
|
||||
please ensure that in the file <filename>/etc/init.d/repmgrd</filename>, the parameter
|
||||
<varname>REPMGRD_OPTS</varname> contains "<literal>--daemonize=false</literal>", e.g.:
|
||||
<programlisting>
|
||||
# additional options
|
||||
REPMGRD_OPTS="--daemonize=false"</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
For further details, see <link linkend="repmgrd-configuration-debian-ubuntu">repmgrd configuration on Debian/Ubuntu</link>.
|
||||
</para>
|
||||
</important>
|
||||
|
||||
<sect2>
|
||||
<title>repmgr client enhancements</title>
|
||||
@@ -43,6 +71,14 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<link linkend="repmgr-standby-follow"><command>repmgr standby follow</command></link>:
|
||||
note that an active, reachable cluster primary is required for this command;
|
||||
and provide a more helpful error message if no reachable primary could be found.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
||||
@@ -75,7 +111,6 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<link linkend="repmgr-standby-promote"><command>repmgr standby promote</command></link>:
|
||||
@@ -163,7 +198,7 @@
|
||||
execute a custom script.
|
||||
</para>
|
||||
<para>
|
||||
This provided an additional method for fencing an isolated primary node, and/or taking
|
||||
This provides an additional method for fencing an isolated primary node, and/or taking
|
||||
other action if one or more standys become disconnected.
|
||||
</para>
|
||||
<para>
|
||||
@@ -221,6 +256,14 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
&repmgr;: when executing <link linkend="repmgr-standby-clone"><command>repmgr standby clone</command></link>
|
||||
with the <option>--upstream-conninfo</option>, ensure that <varname>application_name</varname>
|
||||
is set correctly in <varname>primary_conninfo</varname>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>,
|
||||
@@ -229,6 +272,16 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
&repmgr;: canonicalize the data directory path when parsing the configuration file, so
|
||||
the provided path matches the path PostgreSQL reports as its data directory.
|
||||
Otherwise, if e.g. the data directory is configured with a trailing slash,
|
||||
<link linkend="repmgr-node-check"><command>repmgr node check --data-directory-config</command></link>
|
||||
will return a spurious error.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
&repmgrd;: fix memory leak which occurs while the monitored PostgreSQL node is <emphasis>not</emphasis>
|
||||
|
||||
@@ -52,6 +52,24 @@
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
|
||||
<note>
|
||||
<para>
|
||||
Currently &repmgr;'s support for cloning from Barman is implemented by using
|
||||
<productname>rsync</productname> to clone from the Barman server.
|
||||
</para>
|
||||
<para>
|
||||
It is therefore not able to make use of Barman's parallel restore facility, which
|
||||
is executed on the Barman server and clones to the target server.
|
||||
</para>
|
||||
<para>
|
||||
Barman's parallel restore facility can be used by executing it manually on
|
||||
the Barman server and integrating the resulting cloned standby using
|
||||
<command><link linkend="repmgr-standby-clone">repmgr standby clone --recovery-conf-only</link></command>.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
|
||||
<sect2 id="cloning-from-barman-prerequisites">
|
||||
<title>Prerequisites for cloning from Barman</title>
|
||||
<para>
|
||||
@@ -60,8 +78,7 @@
|
||||
<itemizedlist spacing="compact" mark="bullet">
|
||||
<listitem>
|
||||
<para>
|
||||
the <varname>barman_server</varname> setting in <filename>repmgr.conf</filename> is the same as the
|
||||
server configured in Barman;
|
||||
the Barman catalogue must include at least one valid backup for this server;
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@@ -72,19 +89,68 @@
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
the <varname>restore_command</varname> setting in <filename>repmgr.conf</filename> is configured to
|
||||
use a copy of the <command>barman-wal-restore</command> script shipped with the
|
||||
<literal>barman-cli</literal> package (see section <xref linkend="cloning-from-barman-restore-command"/>
|
||||
below).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
the Barman catalogue includes at least one valid backup for this server.
|
||||
the <varname>barman_server</varname> setting in <filename>repmgr.conf</filename> is the same as the
|
||||
server configured in Barman.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For example, assuming Barman is located on the host "<literal>barmansrv</literal>"
|
||||
under the "<literal>barman</literal>" user account,
|
||||
<filename>repmgr.conf</filename> should contain the following entries:
|
||||
<programlisting>
|
||||
barman_host=barman@barmansrv
|
||||
barman_server=somedb</programlisting>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
To use a non-default Barman configuration file on the Barman server,
|
||||
specify this in <filename>repmgr.conf</filename> with <filename>barman_config</filename>:
|
||||
<programlisting>
|
||||
barman_config=/path/to/barman.conf</programlisting>
|
||||
</para>
|
||||
</note>
|
||||
|
||||
|
||||
<para>
|
||||
We also recommend configuring the <varname>restore_command</varname> setting in <filename>repmgr.conf</filename>
|
||||
to use the <command>barman-wal-restore</command> script
|
||||
(see section <xref linkend="cloning-from-barman-restore-command"/> below).
|
||||
</para>
|
||||
|
||||
|
||||
<tip>
|
||||
<simpara>
|
||||
If you have a non-default SSH configuration on the Barman
|
||||
server, e.g. using a port other than 22, then you can set those
|
||||
parameters in a dedicated Host section in <filename>~/.ssh/config</filename>
|
||||
corresponding to the value of <varname>barman_host</varname> in
|
||||
<filename>repmgr.conf</filename>. See the <literal>Host</literal>
|
||||
section in <command>man 5 ssh_config</command> for more details.
|
||||
</simpara>
|
||||
</tip>
|
||||
<para>
|
||||
It's now possible to clone a standby from Barman, e.g.:
|
||||
<programlisting>
|
||||
$ repmgr -f /etc/repmgr.conf -h node1 -U repmgr -d repmgr standby clone
|
||||
NOTICE: destination directory "/var/lib/postgresql/data" provided
|
||||
INFO: connecting to Barman server to verify backup for "test_cluster"
|
||||
INFO: checking and correcting permissions on existing directory "/var/lib/postgresql/data"
|
||||
INFO: creating directory "/var/lib/postgresql/data/repmgr"...
|
||||
INFO: connecting to Barman server to fetch server parameters
|
||||
INFO: connecting to source node
|
||||
DETAIL: current installation size is 30 MB
|
||||
NOTICE: retrieving backup from Barman...
|
||||
(...)
|
||||
NOTICE: standby clone (from Barman) complete
|
||||
NOTICE: you can now start your PostgreSQL server
|
||||
HINT: for example: pg_ctl -D /var/lib/postgresql/data start</programlisting>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<simpara>
|
||||
Barman support is automatically enabled if <varname>barman_server</varname>
|
||||
@@ -94,37 +160,7 @@
|
||||
command line option.
|
||||
</simpara>
|
||||
</note>
|
||||
<tip>
|
||||
<simpara>
|
||||
If you have a non-default SSH configuration on the Barman
|
||||
server, e.g. using a port other than 22, then you can set those
|
||||
parameters in a dedicated Host section in <filename>~/.ssh/config</filename>
|
||||
corresponding to the value of<varname>barman_host</varname> in
|
||||
<filename>repmgr.conf</filename>. See the <literal>Host</literal>
|
||||
section in <command>man 5 ssh_config</command> for more details.
|
||||
</simpara>
|
||||
</tip>
|
||||
<para>
|
||||
It's now possible to clone a standby from Barman, e.g.:
|
||||
<programlisting>
|
||||
NOTICE: using configuration file "/etc/repmgr.conf"
|
||||
NOTICE: destination directory "/var/lib/postgresql/data" provided
|
||||
INFO: connecting to Barman server to verify backup for test_cluster
|
||||
INFO: checking and correcting permissions on existing directory "/var/lib/postgresql/data"
|
||||
INFO: creating directory "/var/lib/postgresql/data/repmgr"...
|
||||
INFO: connecting to Barman server to fetch server parameters
|
||||
INFO: connecting to upstream node
|
||||
INFO: connected to source node, checking its state
|
||||
INFO: successfully connected to source node
|
||||
DETAIL: current installation size is 29 MB
|
||||
NOTICE: retrieving backup from Barman...
|
||||
receiving file list ...
|
||||
(...)
|
||||
NOTICE: standby clone (from Barman) complete
|
||||
NOTICE: you can now start your PostgreSQL server
|
||||
HINT: for example: pg_ctl -D /var/lib/postgresql/data start</programlisting>
|
||||
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="cloning-from-barman-restore-command" xreflabel="Using Barman as a WAL file source">
|
||||
<title>Using Barman as a WAL file source</title>
|
||||
@@ -142,35 +178,28 @@
|
||||
</para>
|
||||
<para>
|
||||
<command>barman-wal-restore</command> is a Python script provided as part of the <literal>barman-cli</literal>
|
||||
package (Barman 2.0 and later; for Barman 1.x the script is provided separately as
|
||||
<command>barman-wal-restore.py</command>) which performs this function for Barman.
|
||||
package (Barman 2.0 ~ 2.7) or as part of the core Barman distribution (Barman 2.8 and later).
|
||||
</para>
|
||||
<para>
|
||||
To use <command>barman-wal-restore</command> with &repmgr;
|
||||
and assuming Barman is located on the <literal>barmansrv</literal> host
|
||||
To use <command>barman-wal-restore</command> with &repmgr;,
|
||||
assuming Barman is located on the host "<literal>barmansrv</literal>"
|
||||
under the "<literal>barman</literal>" user account,
|
||||
and that <command>barman-wal-restore</command> is located as an executable at
|
||||
<filename>/usr/bin/barman-wal-restore</filename>,
|
||||
<filename>repmgr.conf</filename> should include the following lines:
|
||||
<programlisting>
|
||||
barman_host=barmansrv
|
||||
barman_host=barman@barmansrv
|
||||
barman_server=somedb
|
||||
restore_command=/usr/bin/barman-wal-restore barmansrv somedb %f %p</programlisting>
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
<command>barman-wal-restore</command> supports command line switches to
|
||||
control parallelism (<literal>--parallel=N</literal>) and compression (
|
||||
<literal>--bzip2</literal>, <literal>--gzip</literal>).
|
||||
control parallelism (<literal>--parallel=N</literal>) and compression
|
||||
(<literal>--bzip2</literal>, <literal>--gzip</literal>).
|
||||
</simpara>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
To use a non-default Barman configuration file on the Barman server,
|
||||
specify this in <filename>repmgr.conf</filename> with <filename>barman_config</filename>:
|
||||
<programlisting>
|
||||
barman_config=/path/to/barman.conf</programlisting>
|
||||
</para>
|
||||
</note>
|
||||
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
||||
124
doc/configuration-file-optional-settings.xml
Normal file
124
doc/configuration-file-optional-settings.xml
Normal file
@@ -0,0 +1,124 @@
|
||||
<sect1 id="configuration-file-optional-settings" xreflabel="optional configuration file settings">
|
||||
|
||||
<title>Optional configuration file settings</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>repmgr.conf</primary>
|
||||
<secondary>optional settings</secondary>
|
||||
</indexterm>
|
||||
|
||||
<variablelist>
|
||||
|
||||
|
||||
<varlistentry id="repmgr-conf-config-directory" xreflabel="config_directory">
|
||||
<term><varname>config_directory</varname> (<type>string</type>)
|
||||
<indexterm>
|
||||
<primary><varname>config_directory</varname> configuration file parameter</primary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
If PostgreSQL configuration files are located outside the data
|
||||
directory, specify the directory where the main
|
||||
<filename>postgresql.conf</filename> file is located.
|
||||
</para>
|
||||
<para>
|
||||
This enables explicit provision of an external configuration file
|
||||
directory, which if set will be passed to <command>pg_ctl</command> as the
|
||||
<option>-D</option> parameter. Otherwise <command>pg_ctl</command> will
|
||||
default to using the data directory, which will cause some operations
|
||||
to fail if the configuration files are not present there.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This is implemented primarily for feature completeness and for
|
||||
development/testing purposes. Users who have installed &repmgr; from
|
||||
a package should <emphasis>not</emphasis> rely on to stop/start/restart PostgreSQL,
|
||||
instead they should set the appropriate <option>service_..._command</option>
|
||||
for their operating system. For more details see
|
||||
<xref linkend="configuration-file-service-commands"/>.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="repmgr-conf-replication-user" xreflabel="replication_user">
|
||||
<term><varname>replication_user</varname> (<type>string</type>)
|
||||
<indexterm>
|
||||
<primary><varname>replication_user</varname> configuration file parameter</primary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
PostgreSQL user to make replication connections with.
|
||||
If not set defaults, to the user defined in <xref linkend="repmgr-conf-conninfo"/>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
|
||||
<varlistentry id="repmgr-conf-replication-type" xreflabel="replication_type">
|
||||
<term><varname>replication_type</varname> (<type>string</type>)
|
||||
<indexterm>
|
||||
<primary><varname>replication_type</varname> configuration file parameter</primary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Must be one of <literal>physical</literal> (for standard streaming replication)
|
||||
or <literal>bdr</literal>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Replication type <literal>bdr</literal> can only be used with BDR 2.x
|
||||
</para>
|
||||
<para>
|
||||
BDR 3.x users should use <literal>physical</literal>.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="repmgr-conf-location" xreflabel="location">
|
||||
<term><varname>location</varname> (<type>string</type>)
|
||||
<indexterm>
|
||||
<primary><varname>location</varname> configuration file parameter</primary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
An arbitrary string defining the location of the node; this
|
||||
is used during failover to check visibility of the
|
||||
current primary node.
|
||||
</para>
|
||||
<para>
|
||||
For more details see <xref linkend="repmgrd-network-split"/>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="repmgr-conf-use-replication-slots" xreflabel="use_replication_slots">
|
||||
<term><varname>use_replication_slots</varname> (<type>boolean</type>)
|
||||
<indexterm>
|
||||
<primary><varname>use_replication_slots</varname> configuration file parameter</primary>
|
||||
</indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Whether to use physical replication slots.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
When using replication slots,
|
||||
<varname>max_replication_slots</varname> should be configured for
|
||||
at least the number of standbys which will connect
|
||||
to the primary.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
</variablelist>
|
||||
</sect1>
|
||||
@@ -96,33 +96,6 @@
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For a full list of annotated configuration items, see the file
|
||||
<ulink url="https://raw.githubusercontent.com/2ndQuadrant/repmgr/master/repmgr.conf.sample">repmgr.conf.sample</ulink>.
|
||||
</para>
|
||||
<para>
|
||||
For &repmgrd;-specific settings, see <xref linkend="repmgrd-configuration"/>.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
The following parameters in the configuration file can be overridden with
|
||||
command line options:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>-L/--log-level</literal> overrides <literal>log_level</literal> in
|
||||
<filename>repmgr.conf</filename>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>-b/--pg_bindir</literal> overrides <literal>pg_bindir</literal> in
|
||||
<filename>repmgr.conf</filename>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</note>
|
||||
|
||||
</sect1>
|
||||
|
||||
@@ -62,6 +62,70 @@ data_directory = /var/lib/pgsql/11/data</programlisting>
|
||||
</sect2>
|
||||
|
||||
|
||||
<sect2 id="configuration-file-items" xreflabel="configuration file items">
|
||||
|
||||
<title>Configuration file items</title>
|
||||
<para>
|
||||
The following sections document some sections of the configuration file:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xref linkend="configuration-file-settings"/>
|
||||
</simpara>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xref linkend="configuration-file-optional-settings"/>
|
||||
</simpara>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xref linkend="configuration-file-log-settings"/>
|
||||
</simpara>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xref linkend="configuration-file-service-commands"/>
|
||||
</simpara>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
|
||||
</para>
|
||||
<para>
|
||||
For a full list of annotated configuration items, see the file
|
||||
<ulink url="https://raw.githubusercontent.com/2ndQuadrant/repmgr/master/repmgr.conf.sample">repmgr.conf.sample</ulink>.
|
||||
</para>
|
||||
<para>
|
||||
For &repmgrd;-specific settings, see <xref linkend="repmgrd-configuration"/>.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
The following parameters in the configuration file can be overridden with
|
||||
command line options:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>-L/--log-level</literal> overrides <literal>log_level</literal> in
|
||||
<filename>repmgr.conf</filename>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<literal>-b/--pg_bindir</literal> overrides <literal>pg_bindir</literal> in
|
||||
<filename>repmgr.conf</filename>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</note>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="configuration-file-location" xreflabel="configuration file location">
|
||||
<title>Configuration file location</title>
|
||||
|
||||
@@ -305,6 +305,7 @@
|
||||
|
||||
&configuration-file;
|
||||
&configuration-file-required-settings;
|
||||
&configuration-file-optional-settings;
|
||||
&configuration-file-log-settings;
|
||||
&configuration-file-service-commands;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<!ENTITY configuration SYSTEM "configuration.xml">
|
||||
<!ENTITY configuration-file SYSTEM "configuration-file.xml">
|
||||
<!ENTITY configuration-file-required-settings SYSTEM "configuration-file-required-settings.xml">
|
||||
<!ENTITY configuration-file-optional-settings SYSTEM "configuration-file-optional-settings.xml">
|
||||
<!ENTITY configuration-file-log-settings SYSTEM "configuration-file-log-settings.xml">
|
||||
<!ENTITY configuration-file-service-commands SYSTEM "configuration-file-service-commands.xml">
|
||||
<!ENTITY cloning-standbys SYSTEM "cloning-standbys.xml">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
&repmgr; 4.x is compatible with all PostgreSQL versions from 9.3. See
|
||||
&repmgr; &repmgrversion; is compatible with all PostgreSQL versions from 9.3. See
|
||||
section <link linkend="install-compatibility-matrix">&repmgr; compatibility matrix</link>
|
||||
for an overview of version compatibility.
|
||||
</para>
|
||||
@@ -39,13 +39,13 @@
|
||||
|
||||
<note>
|
||||
<simpara>
|
||||
The same "major" &repmgr; version (e.g. <literal>4.2.x</literal>) <emphasis>must</emphasis>
|
||||
The same "major" &repmgr; version (e.g. <literal>&repmgrversion;.x</literal>) <emphasis>must</emphasis>
|
||||
be installed on all node in the replication cluster. We strongly recommend keeping all
|
||||
nodes on the same (preferably latest) "minor" &repmgr; version to minimize the risk
|
||||
of incompatibilities.
|
||||
</simpara>
|
||||
<simpara>
|
||||
If different "major" &repmgr; versions (e.g. 3.3.x and 4.1.x)
|
||||
If different "major" &repmgr; versions (e.g. 4.1.x and &repmgrversion;.x)
|
||||
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>
|
||||
@@ -114,7 +114,7 @@
|
||||
&repmgr; 4.x
|
||||
</entry>
|
||||
<entry>
|
||||
<link linkend="release-4.2">4.2</link> (2018-10-24)
|
||||
<link linkend="release-current">&repmgrversion;</link> (&releasedate;)
|
||||
</entry>
|
||||
<entry>
|
||||
9.3, 9.4, 9.5, 9.6, 10, 11
|
||||
@@ -158,7 +158,7 @@
|
||||
|
||||
|
||||
<para>
|
||||
Note that some &repmgr; functionality is not available in PostgreSQL 9.3 and PostgreSQL 9.4.
|
||||
Note that some &repmgr; functionality is not available in PostgreSQL 9.3 and PostgreSQL 9.4:
|
||||
</para>
|
||||
<itemizedlist spacing="compact" mark="bullet">
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
$ repmgr -f /etc/repmgr.conf cluster show
|
||||
|
||||
ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
|
||||
----+-------+---------+-----------+----------+----------+----------+-----------------------------------------
|
||||
----+-------+---------+-----------+----------+----------+----------+----------+-----------------------------------------
|
||||
1 | node1 | primary | * running | | default | 100 | 1 | host=db_node1 dbname=repmgr user=repmgr
|
||||
2 | node2 | standby | running | node1 | default | 100 | 1 | host=db_node2 dbname=repmgr user=repmgr
|
||||
3 | node3 | standby | running | node1 | default | 100 | 1 | host=db_node3 dbname=repmgr user=repmgr</programlisting>
|
||||
@@ -82,12 +82,12 @@
|
||||
(but <literal>node3</literal> is not attached to it, and its metadata has not yet been updated);
|
||||
<literal>node4</literal> is running but rejecting connections (from <literal>node3</literal> at least).
|
||||
<programlisting>
|
||||
ID | Name | Role | Status | Upstream | Location | Priority | Connection string
|
||||
----+-------+---------+----------------------+----------+----------+----------+-----------------------------------------
|
||||
1 | node1 | primary | ? unreachable | | default | 100 | host=db_node1 dbname=repmgr user=repmgr
|
||||
2 | node2 | standby | ! running as primary | node1 | default | 100 | host=db_node2 dbname=repmgr user=repmgr
|
||||
3 | node3 | standby | running | node1 | default | 100 | host=db_node3 dbname=repmgr user=repmgr
|
||||
4 | node4 | standby | ? running | node1 | default | 100 | host=db_node4 dbname=repmgr user=repmgr
|
||||
ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
|
||||
----+-------+---------+----------------------+----------+----------+----------+----------+-----------------------------------------
|
||||
1 | node1 | primary | ? unreachable | | default | 100 | 1 | host=db_node1 dbname=repmgr user=repmgr
|
||||
2 | node2 | standby | ! running as primary | node1 | default | 100 | 2 | host=db_node2 dbname=repmgr user=repmgr
|
||||
3 | node3 | standby | running | node1 | default | 100 | 1 | host=db_node3 dbname=repmgr user=repmgr
|
||||
4 | node4 | standby | ? running | node1 | default | 100 | ? | host=db_node4 dbname=repmgr user=repmgr
|
||||
|
||||
WARNING: following issues were detected
|
||||
- unable to connect to node "node1" (ID: 1)
|
||||
|
||||
@@ -202,6 +202,18 @@
|
||||
ensure the <filename>repmgr.conf</filename>
|
||||
file is created for the node, and that it has been registered using
|
||||
<command><link linkend="repmgr-standby-register">repmgr standby register</link></command>.
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
To register a standby which is not running, execute
|
||||
<link linkend="repmgr-standby-register">repmgr standby register --force</link>
|
||||
and provide the connection details for the primary.
|
||||
</para>
|
||||
<para>
|
||||
See <xref linkend="repmgr-standby-register-inactive-node"/> for more details.
|
||||
</para>
|
||||
</tip>
|
||||
<para>
|
||||
Then execute the command <command>repmgr standby clone --recovery-conf-only</command>.
|
||||
This will create the <filename>recovery.conf</filename> file needed to attach
|
||||
the node to its upstream, and will also create a replication slot on the
|
||||
@@ -326,9 +338,13 @@
|
||||
<term><option>--upstream-conninfo</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>primary_conninfo</literal> value to write in recovery.conf
|
||||
<literal>primary_conninfo</literal> value to write in <filename>recovery.conf</filename>
|
||||
when the intended upstream server does not yet exist.
|
||||
</para>
|
||||
<para>
|
||||
Note that &repmgr; may modify the provided value, in particular to set the
|
||||
correct <literal>application_name</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@@ -20,22 +20,17 @@
|
||||
("follow target"). Typically this will be the primary, but this
|
||||
command can also be used to attach the standby to another standby.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This command requires a valid
|
||||
<filename>repmgr.conf</filename> file for the standby, either specified
|
||||
explicitly with <literal>-f/--config-file</literal> or located in a
|
||||
This command requires a valid <filename>repmgr.conf</filename> file for the standby,
|
||||
either specified explicitly with <literal>-f/--config-file</literal> or located in a
|
||||
default location; no additional arguments are required.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
By default &repmgr; will attempt to attach the standby to the current primary.
|
||||
If <option>--upstream-node-id</option> is provided, &repmgr; will attempt
|
||||
to attach the standby to the specified node, which can be another standby.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This command will force a restart of the standby server, which must be
|
||||
running.
|
||||
<para>The standby node ("follow candidate") <emphasis>must</emphasis>
|
||||
be running. If the new upstream ("follow target") is not the primary,
|
||||
the cluster primary <emphasis>must</emphasis> be running and accessible from the
|
||||
standby node.
|
||||
</para>
|
||||
|
||||
<tip>
|
||||
@@ -45,6 +40,16 @@
|
||||
</para>
|
||||
</tip>
|
||||
|
||||
<para>
|
||||
By default &repmgr; will attempt to attach the standby to the current primary.
|
||||
If <option>--upstream-node-id</option> is provided, &repmgr; will attempt
|
||||
to attach the standby to the specified node, which can be another standby.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This command will force a restart of PostgreSQL on the standby node.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<command>repmgr standby follow</command> will wait up to
|
||||
<varname>standby_follow_timeout</varname> seconds (default: <literal>30</literal>)
|
||||
@@ -166,7 +171,7 @@
|
||||
be possible to follow the new upstream node, and &repmgr; will emit an error
|
||||
message like this:
|
||||
<programlisting>
|
||||
ERROR: this node cannot attach to follow target node 3
|
||||
ERROR: this node cannot attach to follow target node "node3" (ID 3)
|
||||
DETAIL: follow target server's timeline 2 forked off current database system timeline 1 before current recovery point 0/6108880</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
|
||||
@@ -75,10 +75,22 @@
|
||||
<para>
|
||||
Under some circumstances you may wish to register a standby which is not
|
||||
yet running; this can be the case when using provisioning tools to create
|
||||
a complex replication cluster. In this case, by using the <option>-F/--force</option>
|
||||
option and providing the connection parameters to the primary server,
|
||||
the standby can be registered.
|
||||
a complex replication cluster, or if the node was not cloned by &repmgr;.
|
||||
</para>
|
||||
<para>
|
||||
In this case, by using the <option>-F/--force</option>
|
||||
option and providing the connection parameters to the primary server,
|
||||
the standby can be registered even if it has not yet been started.
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
Connection parameters can either be provided either as a <literal>conninfo</literal> string
|
||||
(e.g. <option>-d 'host=node1 user=repmgr'</option> or as individual connection parameters
|
||||
(<option>-h/--host</option>, <option>-d/--dbname</option>,
|
||||
<option>-U/--user</option>, <option>-p/--port</option> etc.).
|
||||
</para>
|
||||
</tip>
|
||||
|
||||
<para>
|
||||
Similarly, with cascading replication it may be necessary to register
|
||||
a standby whose upstream node has not yet been registered - in this case,
|
||||
@@ -96,9 +108,10 @@
|
||||
<title>Registering a node not cloned by repmgr</title>
|
||||
<para>
|
||||
If you've cloned a standby using another method (e.g. <application>barman</application>'s
|
||||
<command>barman recover</command> command), first execute
|
||||
<command>barman recover</command> command), register the node as detailed in section
|
||||
<xref linkend="repmgr-standby-register-inactive-node"/> then execute
|
||||
<link linkend="repmgr-standby-create-recovery-conf">repmgr standby clone --recovery-conf-only</link>
|
||||
to add the <filename>recovery.conf</filename> file, then register the standby as usual.
|
||||
to generate the appropriate replication configuration.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -119,7 +132,7 @@
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-F</option><option>--force</option></term>
|
||||
<term><option>-F</option>/<option>--force</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Overwrite an existing node record
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
For more complex replication scenarios,e.g. with multiple datacentres, it may
|
||||
For more complex replication scenarios, e.g. with multiple datacentres, it may
|
||||
be preferable to use location-based failover, which ensures that only nodes
|
||||
in the same location as the primary will ever be promotion candidates;
|
||||
see <xref linkend="repmgrd-network-split"/> for more details.
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
</para>
|
||||
<para>
|
||||
&repmgrd; can be configured to provide failover
|
||||
capability in case the primary upstream node becomes unreachable, and/or
|
||||
capability in case the primary or upstream node becomes unreachable, and/or
|
||||
provide monitoring data to the &repmgr; metadatabase.
|
||||
</para>
|
||||
<para>
|
||||
From &repmgr; 4.4, when running on the primary node, &repmgrd; can also monitor
|
||||
standby disconnections/reconnections (see <xref linkend="repmgrd-primary-child-disconnection"/>).
|
||||
</para>
|
||||
|
||||
<sect1 id="repmgrd-basic-configuration">
|
||||
<title>repmgrd configuration</title>
|
||||
@@ -222,6 +226,17 @@
|
||||
Normally <option>promote_command</option> is set as &repmgr;'s
|
||||
<command><link linkend="repmgr-standby-promote">repmgr standby promote</link></command> command.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
When invoking <command>repmgr standby promote</command> (either directly via
|
||||
the <option>promote_command</option>, or in a script called
|
||||
via <option>promote_command</option>), <option>--siblings-follow</option>
|
||||
<emphasis>must not</emphasis> be included as a
|
||||
command line option for <command>repmgr standby promote</command>.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
It is also possible to provide a shell script to e.g. perform user-defined tasks
|
||||
before promoting the current node. In this case the script <emphasis>must</emphasis>
|
||||
@@ -554,7 +569,8 @@ repmgrd_service_stop_command='sudo systemctl repmgr11 stop'
|
||||
the option <option>monitor_interval_secs</option> (see above).
|
||||
</para>
|
||||
<para>
|
||||
For more details on monitoring, see <xref linkend="repmgrd-monitoring"/>.
|
||||
For more details on monitoring, see <xref linkend="repmgrd-monitoring"/>. For information on
|
||||
monitoring standby disconnections, see <xref linkend="repmgrd-primary-child-disconnection"/>.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
</para>
|
||||
<para>
|
||||
If &repmgrd; is in use, it's worth double-checking that
|
||||
all nodes are unpaused by executing <command><link linkend="repmgr-daemon-status">repmgr-daemon-status</link></command>.
|
||||
all nodes are unpaused by executing <command><link linkend="repmgr-daemon-status">repmgr daemon status</link></command>.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
|
||||
@@ -263,7 +263,7 @@ ALTER EXTENSION repmgr UPDATE</programlisting>
|
||||
<tip>
|
||||
<para>
|
||||
Use <command><link linkend="repmgr-node-check">repmgr node check</link></command>
|
||||
to determine which replacation slots need to be recreated.
|
||||
to determine which replication slots need to be recreated.
|
||||
</para>
|
||||
</tip>
|
||||
|
||||
|
||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
||||
LEFT JOIN repmgr.nodes un
|
||||
ON un.node_id = n.upstream_node_id;
|
||||
|
||||
|
||||
/* XXX update upgrade scripts! */
|
||||
CREATE TABLE repmgr.voting_term (
|
||||
term INT NOT NULL
|
||||
);
|
||||
|
||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
||||
LEFT JOIN repmgr.nodes un
|
||||
ON un.node_id = n.upstream_node_id;
|
||||
|
||||
|
||||
/* XXX update upgrade scripts! */
|
||||
CREATE TABLE repmgr.voting_term (
|
||||
term INT NOT NULL
|
||||
);
|
||||
|
||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
||||
LEFT JOIN repmgr.nodes un
|
||||
ON un.node_id = n.upstream_node_id;
|
||||
|
||||
|
||||
/* XXX update upgrade scripts! */
|
||||
CREATE TABLE repmgr.voting_term (
|
||||
term INT NOT NULL
|
||||
);
|
||||
|
||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
||||
LEFT JOIN repmgr.nodes un
|
||||
ON un.node_id = n.upstream_node_id;
|
||||
|
||||
|
||||
/* XXX update upgrade scripts! */
|
||||
CREATE TABLE repmgr.voting_term (
|
||||
term INT NOT NULL
|
||||
);
|
||||
|
||||
@@ -78,8 +78,6 @@ CREATE VIEW repmgr.show_nodes AS
|
||||
LEFT JOIN repmgr.nodes un
|
||||
ON un.node_id = n.upstream_node_id;
|
||||
|
||||
|
||||
/* XXX update upgrade scripts! */
|
||||
CREATE TABLE repmgr.voting_term (
|
||||
term INT NOT NULL
|
||||
);
|
||||
|
||||
@@ -1833,7 +1833,7 @@ do_node_check_data_directory(PGconn *conn, OutputMode mode, t_node_info *node_in
|
||||
* a superuser connection
|
||||
*/
|
||||
|
||||
if (is_superuser_connection(conn, NULL) == true)
|
||||
if (connection_has_pg_settings(conn) == true)
|
||||
{
|
||||
/* we expect to have a database connection */
|
||||
if (get_pg_setting(conn, "data_directory", actual_data_directory) == false)
|
||||
@@ -1878,7 +1878,7 @@ do_node_check_data_directory(PGconn *conn, OutputMode mode, t_node_info *node_in
|
||||
/* XXX add -S/--superuser option */
|
||||
if (PQserverVersion(conn) >= 100000)
|
||||
{
|
||||
log_hint(_("add the \"%s\" user to group \"pg_read_all_settings\""),
|
||||
log_hint(_("add the \"%s\" user to group \"pg_read_all_settings\" or \"pg_monitor\""),
|
||||
PQuser(conn));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ static void get_barman_property(char *dst, char *name, char *local_repmgr_direct
|
||||
static int get_tablespace_data_barman(char *, TablespaceDataList *);
|
||||
static char *make_barman_ssh_command(char *buf);
|
||||
|
||||
static bool create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_conninfo, char *dest, bool as_file);
|
||||
static bool create_recovery_file(t_node_info *node_record, t_conninfo_param_list *primary_conninfo, char *dest, bool as_file);
|
||||
static void write_primary_conninfo(PQExpBufferData *dest, t_conninfo_param_list *param_list);
|
||||
static bool check_sibling_nodes(NodeInfoList *sibling_nodes, SiblingNodeStats *sibling_nodes_stats);
|
||||
static bool check_free_wal_senders(int available_wal_senders, SiblingNodeStats *sibling_nodes_stats, bool *dry_run_success);
|
||||
@@ -1000,6 +1000,9 @@ _do_create_recovery_conf(void)
|
||||
/* check connection */
|
||||
source_conn = establish_db_connection_by_params(&source_conninfo, true);
|
||||
|
||||
/* Verify that source is a supported server version */
|
||||
(void) check_server_version(source_conn, "source node", true, NULL);
|
||||
|
||||
/* determine node for primary_conninfo */
|
||||
|
||||
if (runtime_options.upstream_node_id != UNKNOWN_NODE_ID)
|
||||
@@ -2784,12 +2787,6 @@ do_standby_follow(void)
|
||||
|
||||
PQfinish(local_conn);
|
||||
|
||||
if (runtime_options.dry_run == true)
|
||||
{
|
||||
log_info(_("prerequisites for executing STANDBY FOLLOW are met"));
|
||||
exit(SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we'll need a connection to the primary, if the upstream is not a primary.
|
||||
*/
|
||||
@@ -2802,12 +2799,30 @@ do_standby_follow(void)
|
||||
primary_conn = get_primary_connection_quiet(follow_target_conn,
|
||||
&primary_node_id,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
* If follow target is not primary and no other primary could be found,
|
||||
* abort because we won't be able to update the node record.
|
||||
*/
|
||||
if (PQstatus(primary_conn) != CONNECTION_OK)
|
||||
{
|
||||
log_error(_("unable to determine the cluster primary"));
|
||||
log_detail(_("an active primary node is required for \"repmgr standby follow\""));
|
||||
PQfinish(follow_target_conn);
|
||||
exit(ERR_FOLLOW_FAIL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
primary_conn = follow_target_conn;
|
||||
}
|
||||
|
||||
if (runtime_options.dry_run == true)
|
||||
{
|
||||
log_info(_("prerequisites for executing STANDBY FOLLOW are met"));
|
||||
exit(SUCCESS);
|
||||
}
|
||||
|
||||
initPQExpBuffer(&follow_output);
|
||||
|
||||
success = do_standby_follow_internal(
|
||||
@@ -2991,42 +3006,9 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialise connection parameters to write as `primary_conninfo` */
|
||||
initialize_conninfo_params(&recovery_conninfo, false);
|
||||
|
||||
/* We ignore any application_name set in the primary's conninfo */
|
||||
parse_conninfo_string(follow_target_node_record->conninfo, &recovery_conninfo, &errmsg, true);
|
||||
|
||||
{
|
||||
t_conninfo_param_list local_node_conninfo = T_CONNINFO_PARAM_LIST_INITIALIZER;
|
||||
bool parse_success;
|
||||
|
||||
initialize_conninfo_params(&local_node_conninfo, false);
|
||||
|
||||
parse_success = parse_conninfo_string(local_node_record.conninfo, &local_node_conninfo, &errmsg, false);
|
||||
|
||||
if (parse_success == false)
|
||||
{
|
||||
/*
|
||||
* this shouldn't happen, but if it does we'll plough on
|
||||
* regardless
|
||||
*/
|
||||
log_warning(_("unable to parse conninfo string \"%s\":\n %s"),
|
||||
local_node_record.conninfo, errmsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *application_name = param_get(&local_node_conninfo, "application_name");
|
||||
|
||||
if (application_name != NULL && strlen(application_name))
|
||||
param_set(&recovery_conninfo, "application_name", application_name);
|
||||
}
|
||||
|
||||
free_conninfo_params(&local_node_conninfo);
|
||||
|
||||
/*
|
||||
* store the original upstream node id so we can delete the
|
||||
* replication slot, if exists
|
||||
* Store the original upstream node id so we can delete the
|
||||
* replication slot, if it exists.
|
||||
*/
|
||||
if (local_node_record.upstream_node_id != UNKNOWN_NODE_ID)
|
||||
{
|
||||
@@ -3037,8 +3019,14 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n
|
||||
original_upstream_node_id = follow_target_node_record->node_id;
|
||||
}
|
||||
|
||||
|
||||
if (config_file_options.use_replication_slots && runtime_options.host_param_provided == false && original_upstream_node_id != UNKNOWN_NODE_ID)
|
||||
if (config_file_options.use_replication_slots && runtime_options.host_param_provided == false)
|
||||
{
|
||||
/*
|
||||
* Only attempt to delete the old replication slot if the old upstream
|
||||
* node is known and is different to the follow target node.
|
||||
*/
|
||||
if (original_upstream_node_id != UNKNOWN_NODE_ID
|
||||
&& original_upstream_node_id != follow_target_node_record->node_id)
|
||||
{
|
||||
remove_old_replication_slot = true;
|
||||
}
|
||||
@@ -3066,6 +3054,12 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialise connection parameters to write as "primary_conninfo" */
|
||||
initialize_conninfo_params(&recovery_conninfo, false);
|
||||
|
||||
/* We ignore any application_name set in the primary's conninfo */
|
||||
parse_conninfo_string(follow_target_node_record->conninfo, &recovery_conninfo, &errmsg, true);
|
||||
|
||||
/* Set the application name to this node's name */
|
||||
param_set(&recovery_conninfo, "application_name", config_file_options.node_name);
|
||||
|
||||
@@ -3187,8 +3181,6 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n
|
||||
* Note that if this function is called by do_standby_switchover(), the
|
||||
* "repmgr node rejoin" command executed on the demotion candidate may already
|
||||
* have removed the slot, so there may be nothing to do.
|
||||
*
|
||||
* XXX check if former upstream is current primary?
|
||||
*/
|
||||
|
||||
if (remove_old_replication_slot == true)
|
||||
@@ -4769,6 +4761,7 @@ check_source_server()
|
||||
t_node_info upstream_node_record = T_NODE_INFO_INITIALIZER;
|
||||
RecordStatus record_status = RECORD_NOT_FOUND;
|
||||
ExtensionStatus extension_status = REPMGR_UNKNOWN;
|
||||
t_extension_versions extversions = T_EXTENSION_VERSIONS_INITIALIZER;
|
||||
|
||||
/* Attempt to connect to the upstream server to verify its configuration */
|
||||
log_verbose(LOG_DEBUG, "check_source_server()");
|
||||
@@ -4832,7 +4825,7 @@ check_source_server()
|
||||
* to be used as a standalone clone tool)
|
||||
*/
|
||||
|
||||
extension_status = get_repmgr_extension_status(primary_conn, NULL);
|
||||
extension_status = get_repmgr_extension_status(primary_conn, &extversions);
|
||||
|
||||
if (extension_status != REPMGR_INSTALLED)
|
||||
{
|
||||
@@ -4847,20 +4840,25 @@ check_source_server()
|
||||
exit(ERR_DB_QUERY);
|
||||
}
|
||||
|
||||
/* schema doesn't exist */
|
||||
log_error(_("repmgr extension not found on source node"));
|
||||
|
||||
if (extension_status == REPMGR_AVAILABLE)
|
||||
{
|
||||
log_detail(_("repmgr extension is available but not installed in database \"%s\""),
|
||||
log_error(_("repmgr extension is available but not installed in database \"%s\""),
|
||||
param_get(&source_conninfo, "dbname"));
|
||||
log_hint(_("check that you are cloning from the database where \"repmgr\" is installed"));
|
||||
}
|
||||
else if (extension_status == REPMGR_UNAVAILABLE)
|
||||
{
|
||||
log_detail(_("repmgr extension is not available on the upstream node"));
|
||||
log_error(_("repmgr extension is not available on the upstream node"));
|
||||
}
|
||||
else if (extension_status == REPMGR_OLD_VERSION_INSTALLED)
|
||||
{
|
||||
log_error(_("an older version of the extension is installed on the upstream node"));
|
||||
log_detail(_("version %s is installed but newer version %s is available"),
|
||||
extversions.installed_version,
|
||||
extversions.default_version);
|
||||
log_hint(_("upgrade \"repmgr\" on the source node first"));
|
||||
}
|
||||
|
||||
log_hint(_("check that the upstream node is part of a repmgr cluster"));
|
||||
PQfinish(source_conn);
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
@@ -4885,6 +4883,13 @@ check_source_server()
|
||||
* later, as this is a precautionary check and we can retrieve the system
|
||||
* identifier with a normal connection.
|
||||
*/
|
||||
|
||||
if (runtime_options.dry_run == true)
|
||||
{
|
||||
log_info(_("\"repmgr\" extension is installed in database \"%s\""),
|
||||
param_get(&source_conninfo, "dbname"));
|
||||
}
|
||||
|
||||
if (get_recovery_type(source_conn) == RECTYPE_PRIMARY && PQserverVersion(source_conn) >= 90600)
|
||||
{
|
||||
uint64 source_system_identifier = system_identifier(source_conn);
|
||||
@@ -6942,11 +6947,11 @@ check_recovery_type(PGconn *conn)
|
||||
* Creates a recovery.conf file for a standby
|
||||
*
|
||||
* A database connection pointer is required for escaping primary_conninfo
|
||||
* parameters. When cloning from Barman and --no-upstream-connection ) this
|
||||
* might not be available.
|
||||
* parameters. When cloning from Barman and --no-upstream-connection supplied,
|
||||
* this might not be available.
|
||||
*/
|
||||
bool
|
||||
create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_conninfo, char *dest, bool as_file)
|
||||
static bool
|
||||
create_recovery_file(t_node_info *node_record, t_conninfo_param_list *primary_conninfo, char *dest, bool as_file)
|
||||
{
|
||||
PQExpBufferData recovery_file_buf;
|
||||
char recovery_file_path[MAXPGPATH] = "";
|
||||
@@ -6961,29 +6966,7 @@ create_recovery_file(t_node_info *node_record, t_conninfo_param_list *recovery_c
|
||||
"standby_mode = 'on'\n");
|
||||
|
||||
/* primary_conninfo = '...' */
|
||||
|
||||
/*
|
||||
* the user specified --upstream-conninfo string - copy that
|
||||
*/
|
||||
if (strlen(runtime_options.upstream_conninfo))
|
||||
{
|
||||
char *escaped = escape_recovery_conf_value(runtime_options.upstream_conninfo);
|
||||
|
||||
appendPQExpBuffer(&recovery_file_buf,
|
||||
"primary_conninfo = '%s'\n",
|
||||
escaped);
|
||||
|
||||
free(escaped);
|
||||
}
|
||||
|
||||
/*
|
||||
* otherwise use the conninfo inferred from the upstream connection and/or
|
||||
* node record
|
||||
*/
|
||||
else
|
||||
{
|
||||
write_primary_conninfo(&recovery_file_buf, recovery_conninfo);
|
||||
}
|
||||
write_primary_conninfo(&recovery_file_buf, primary_conninfo);
|
||||
|
||||
/* recovery_target_timeline = 'latest' */
|
||||
appendPQExpBufferStr(&recovery_file_buf,
|
||||
|
||||
@@ -1908,6 +1908,7 @@ check_cli_parameters(const int action)
|
||||
case NODE_SERVICE:
|
||||
case DAEMON_PAUSE:
|
||||
case DAEMON_UNPAUSE:
|
||||
case DAEMON_STATUS:
|
||||
case DAEMON_START:
|
||||
case DAEMON_STOP:
|
||||
break;
|
||||
@@ -2833,15 +2834,25 @@ create_repmgr_extension(PGconn *conn)
|
||||
int
|
||||
check_server_version(PGconn *conn, char *server_type, bool exit_on_error, char *server_version_string)
|
||||
{
|
||||
int conn_server_version_num = get_server_version(conn, server_version_string);
|
||||
char version_string[MAXVERSIONSTR] = "";
|
||||
int conn_server_version_num = get_server_version(conn, version_string);
|
||||
|
||||
/* Copy the version string, if the caller wants it */
|
||||
if (server_version_string != NULL)
|
||||
strncpy(server_version_string, version_string, MAXVERSIONSTR);
|
||||
|
||||
if (conn_server_version_num < MIN_SUPPORTED_VERSION_NUM)
|
||||
{
|
||||
if (conn_server_version_num > 0)
|
||||
{
|
||||
log_error(_("%s requires %s to be PostgreSQL %s or later"),
|
||||
progname(),
|
||||
server_type,
|
||||
MIN_SUPPORTED_VERSION);
|
||||
log_detail(_("%s server version is %s"),
|
||||
server_type,
|
||||
version_string);
|
||||
}
|
||||
|
||||
if (exit_on_error == true)
|
||||
{
|
||||
@@ -2852,6 +2863,38 @@ check_server_version(PGconn *conn, char *server_type, bool exit_on_error, char *
|
||||
return UNKNOWN_SERVER_VERSION_NUM;
|
||||
}
|
||||
|
||||
/*
|
||||
* If it's clear a particular repmgr feature branch won't be able to support
|
||||
* PostgreSQL from a particular PostgreSQL release onwards (e.g. 4.4 with PostgreSQL
|
||||
* 12 and later due to recovery.conf removal), set MAX_UNSUPPORTED_VERSION and
|
||||
* MAX_UNSUPPORTED_VERSION_NUM in "repmgr.h" to define the first PostgreSQL
|
||||
* version which can't be suppored.
|
||||
*/
|
||||
#ifdef MAX_UNSUPPORTED_VERSION_NUM
|
||||
if (conn_server_version_num >= MAX_UNSUPPORTED_VERSION_NUM)
|
||||
{
|
||||
if (conn_server_version_num > 0)
|
||||
{
|
||||
log_error(_("%s %s does not support PostgreSQL %s or later"),
|
||||
progname(),
|
||||
REPMGR_VERSION,
|
||||
MAX_UNSUPPORTED_VERSION);
|
||||
log_detail(_("%s server version is %s"),
|
||||
server_type,
|
||||
version_string);
|
||||
log_hint(_("For details of supported versions see: https://repmgr.org/docs/current/install-requirements.html#INSTALL-COMPATIBILITY-MATRIX"));
|
||||
}
|
||||
|
||||
if (exit_on_error == true)
|
||||
{
|
||||
PQfinish(conn);
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
return UNKNOWN_SERVER_VERSION_NUM;
|
||||
}
|
||||
#endif
|
||||
|
||||
return conn_server_version_num;
|
||||
}
|
||||
|
||||
@@ -3029,18 +3072,18 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
|
||||
|
||||
if (*config_file_options.rsync_options == '\0')
|
||||
{
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
"--archive --checksum --compress --progress --rsh=ssh");
|
||||
}
|
||||
else
|
||||
{
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
config_file_options.rsync_options);
|
||||
}
|
||||
|
||||
if (runtime_options.force)
|
||||
{
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
" --delete --checksum");
|
||||
}
|
||||
|
||||
@@ -3067,10 +3110,10 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
|
||||
if (is_directory)
|
||||
{
|
||||
/* Files which we don't want */
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
" --exclude=postmaster.pid --exclude=postmaster.opts --exclude=global/pg_control");
|
||||
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
" --exclude=recovery.conf --exclude=recovery.done");
|
||||
|
||||
if (server_version_num >= 90400)
|
||||
@@ -3079,7 +3122,7 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
|
||||
* Ideally we'd use PG_AUTOCONF_FILENAME from utils/guc.h, but
|
||||
* that has too many dependencies for a mere client program.
|
||||
*/
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
" --exclude=postgresql.auto.conf.tmp");
|
||||
}
|
||||
|
||||
@@ -3091,16 +3134,16 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
|
||||
|
||||
if (server_version_num >= 100000)
|
||||
{
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
" --exclude=pg_wal/*");
|
||||
}
|
||||
else
|
||||
{
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
" --exclude=pg_xlog/*");
|
||||
}
|
||||
|
||||
appendPQExpBuffer(&rsync_flags, "%s",
|
||||
appendPQExpBufferStr(&rsync_flags,
|
||||
" --exclude=pg_log/* --exclude=pg_stat_tmp/*");
|
||||
|
||||
maxlen_snprintf(script, "rsync %s %s:%s/* %s",
|
||||
|
||||
2
repmgr.c
2
repmgr.c
@@ -702,7 +702,7 @@ set_repmgrd_pid(PG_FUNCTION_ARGS)
|
||||
shared_state->repmgrd_pid = repmgrd_pid;
|
||||
memset(shared_state->repmgrd_pidfile, 0, MAXPGPATH);
|
||||
|
||||
if(repmgrd_pidfile != NULL)
|
||||
if (repmgrd_pidfile != NULL)
|
||||
{
|
||||
strncpy(shared_state->repmgrd_pidfile, repmgrd_pidfile, MAXPGPATH);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
|
||||
|
||||
# =============================================================================
|
||||
|
||||
# Optional configuration items
|
||||
# =============================================================================
|
||||
|
||||
@@ -68,16 +67,16 @@
|
||||
# Replication settings
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#replication_user='repmgr' # User to make replication connections with, if not set defaults
|
||||
# to the user defined in "conninfo".
|
||||
#replication_user='repmgr' # User to make replication connections with, if not set
|
||||
# defaults to the user defined in "conninfo".
|
||||
|
||||
#replication_type=physical # Must be one of 'physical' or 'bdr'.
|
||||
#replication_type=physical # Must be one of "physical" or "bdr".
|
||||
# NOTE: "bdr" can only be used with BDR 2.x
|
||||
|
||||
#location=default # arbitrary string defining the location of the node; this
|
||||
# is used during failover to check visibilty of the
|
||||
# current primary node. See the 'repmgrd' documentation
|
||||
# in README.md for further details.
|
||||
#location=default # An arbitrary string defining the location of the node; this
|
||||
# is used during failover to check visibility of the
|
||||
# current primary node. For further details see:
|
||||
# https://repmgr.org/docs/current/repmgrd-network-split.html
|
||||
|
||||
#use_replication_slots=no # whether to use physical replication slots
|
||||
# NOTE: when using replication slots,
|
||||
|
||||
34
repmgr.h
34
repmgr.h
@@ -21,6 +21,37 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef vsnprintf
|
||||
#undef vsnprintf
|
||||
#endif
|
||||
#ifdef snprintf
|
||||
#undef snprintf
|
||||
#endif
|
||||
#ifdef vsprintf
|
||||
#undef vsprintf
|
||||
#endif
|
||||
#ifdef sprintf
|
||||
#undef sprintf
|
||||
#endif
|
||||
#ifdef vfprintf
|
||||
#undef vfprintf
|
||||
#endif
|
||||
#ifdef fprintf
|
||||
#undef fprintf
|
||||
#endif
|
||||
#ifdef vprintf
|
||||
#undef vprintf
|
||||
#endif
|
||||
#ifdef printf
|
||||
#undef printf
|
||||
#endif
|
||||
#ifdef strerror
|
||||
#undef strerror
|
||||
#endif
|
||||
#ifdef strerror_r
|
||||
#undef strerror_r
|
||||
#endif
|
||||
|
||||
#ifndef _REPMGR_H_
|
||||
#define _REPMGR_H_
|
||||
|
||||
@@ -46,6 +77,9 @@
|
||||
#define MIN_SUPPORTED_VERSION "9.3"
|
||||
#define MIN_SUPPORTED_VERSION_NUM 90300
|
||||
|
||||
#define MAX_UNSUPPORTED_VERSION "12"
|
||||
#define MAX_UNSUPPORTED_VERSION_NUM 120000
|
||||
|
||||
#define REPLICATION_TYPE_PHYSICAL 1
|
||||
#define REPLICATION_TYPE_BDR 2
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#define REPMGR_VERSION_DATE ""
|
||||
#define REPMGR_VERSION "4.4dev"
|
||||
#define REPMGR_VERSION "4.4"
|
||||
#define REPMGR_VERSION_NUM 40400
|
||||
#define REPMGR_RELEASE_DATE "2019-06-27"
|
||||
|
||||
@@ -4909,7 +4909,8 @@ check_node_can_follow(PGconn *local_conn, XLogRecPtr local_xlogpos, PGconn *foll
|
||||
*/
|
||||
if (local_xlogpos > follow_target_history->end)
|
||||
{
|
||||
log_error(_("this node cannot attach to follow target node %i"),
|
||||
log_error(_("this node cannot attach to follow target node \"%s\" (ID: %i)"),
|
||||
follow_target_node_info->node_name,
|
||||
follow_target_node_info->node_id);
|
||||
can_follow = false;
|
||||
|
||||
@@ -4921,8 +4922,10 @@ check_node_can_follow(PGconn *local_conn, XLogRecPtr local_xlogpos, PGconn *foll
|
||||
|
||||
if (can_follow == true)
|
||||
{
|
||||
log_info(_("local node %i can attach to follow target node %i"),
|
||||
log_info(_("local node \"%s\" (ID: %i) can attach to follow target node \"%s\" (ID: %i)"),
|
||||
config_file_options.node_name,
|
||||
config_file_options.node_id,
|
||||
follow_target_node_info->node_name,
|
||||
follow_target_node_info->node_id);
|
||||
|
||||
log_detail(_("local node's recovery point: %X/%X; follow target node's fork point: %X/%X"),
|
||||
|
||||
Reference in New Issue
Block a user