pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedArchive clean up command in recovery.conf
3+ messages / 3 participants
[nested] [flat]
* Archive clean up command in recovery.conf
@ 2018-09-23 12:13 Prince Pathria <prince.pathria@goevive.com>
0 siblings, 2 replies; 3+ messages in thread
From: Prince Pathria @ 2018-09-23 12:13 UTC (permalink / raw)
To: pgsql-admin
Hi,
I have a doubt, assume that I have 3 psql10 nodes (n1, n2, n3) and n1 is
master ,n2+n3 are standbys. In n1 archive mode is on, and wal_logs are
going to volume which is shared with n2 and n3. If
archive_cleanup_command = 'pg_archivecleanup /path/to/nfs %r' is enabled
on both n2 and n3.
Can a situation might arise that a wal segment required by n2 is already
cleaned up by n3?
If yes, then how to mitigate it?
Thanks!
Prince Pathria Systems Architect Evive +91 9478670472 goevive.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Archive clean up command in recovery.conf
@ 2018-09-24 06:22 Laurenz Albe <laurenz.albe@cybertec.at>
parent: Prince Pathria <prince.pathria@goevive.com>
1 sibling, 0 replies; 3+ messages in thread
From: Laurenz Albe @ 2018-09-24 06:22 UTC (permalink / raw)
To: Prince Pathria <prince.pathria@goevive.com>; pgsql-admin
Prince Pathria wrote:
> I have a doubt, assume that I have 3 psql10 nodes (n1, n2, n3)
> and n1 is master ,n2+n3 are standbys. In n1 archive mode is on,
> and wal_logs are going to volume which is shared with n2 and n3.
> If archive_cleanup_command = 'pg_archivecleanup /path/to/nfs %r'
> is enabled on both n2 and n3.
>
> Can a situation might arise that a wal segment required by n2
> is already cleaned up by n3?
Yes, that pg_archivecleanup is a bad idea, because the faster
standby might remove files that the slower one still needs.
> If yes, then how to mitigate it?
Use streaming replication and replication slots.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Archive clean up command in recovery.conf
@ 2018-09-24 07:53 "CONVERS Yann - DREAL Auvergne-Rhône-Alpes/CIDDAE/SIG" <yann.convers@developpement-durable.gouv.fr>
parent: Prince Pathria <prince.pathria@goevive.com>
1 sibling, 0 replies; 3+ messages in thread
From: "CONVERS Yann - DREAL Auvergne-Rhône-Alpes/CIDDAE/SIG" @ 2018-09-24 07:53 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
check <b>notes</b> after <br>
<br>
archive cleanup command from
<a class="moz-txt-link-freetext" href="https://www.postgresql.org/docs/9.1/static/archive-recovery-settings.html">https://www.postgr...;
<br>
i think it's not for you because you have 3 serveurs and two
slaves.. check replication slot instead it's most efficient for your
usage.<br>
<br>
<dl>
<dt><tt class="VARNAME">archive_cleanup_command</tt> (<tt
class="TYPE">string</tt>)</dt>
<dd>
<p>This optional parameter specifies a shell command that will
be executed at every restartpoint. The purpose of <tt
class="VARNAME">archive_cleanup_command</tt> is to provide a
mechanism for cleaning up old archived WAL files that are no
longer needed by the standby server. Any <tt class="LITERAL">%r</tt>
is replaced by the name of the file containing the last valid
restart point. That is the earliest file that must be <span
class="emphasis EMPHASIS c2">kept</span> to allow a restore
to be restartable, and so all files earlier than <tt
class="LITERAL">%r</tt> may be safely removed. This
information can be used to truncate the archive to just the
minimum required to support restart from the current restore.
The <a
href="https://www.postgresql.org/docs/9.1/static/pgarchivecleanup.html">pg_archivecleanup</a;
module is often used in <tt class="VARNAME">archive_cleanup_command</tt>
for single-standby configurations, for example:</p>
<pre class="PROGRAMLISTING">archive_cleanup_command = 'pg_archivecleanup /mnt/server/archivedir %r'
</pre>
<p><b>Note however that if multiple standby servers are
restoring from the same archive directory, you will need to
ensure that you do not delete WAL files until they are no
longer needed by any of the servers. </b><b><tt
class="VARNAME">archive_cleanup_command</tt></b><b> would
typically be used in a warm-standby configuration (see </b><b><a
href="https://www.postgresql.org/docs/9.1/static/warm-standby.html">Section
25.2</a></b><b>). Write </b><b><tt class="LITERAL">%%</tt></b><b>
to embed an actual </b><b><tt class="LITERAL">%</tt></b><b>
character in the command.</b></p>
<p>If the command returns a non-zero exit status then a WARNING
log message will be written.</p>
</dd>
</dl>
<br>
<div class="moz-cite-prefix">Le 23/09/2018 à 14:13, "> Prince
Pathria (par Internet, dépôt
<a class="moz-txt-link-abbreviated" href="mailto:pgsql-admin-owner+m63745-89476@lists.postgresql.org">pgsql-admin-owner+m63745-89476@lists.postgresql.org</a>)" a écrit :<br>
</div>
<blockquote
cite="mid:CAON0Day9vqmy3HSqB2eskSN-uxUuQpW+eCvdH1rRt+YO=39sfg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have a doubt, assume that I have 3 psql10 nodes (n1,
n2, n3) and n1 is master ,n2+n3 are standbys. In n1 archive
mode is on, and wal_logs are going to volume which is shared
with n2 and n3. If archive_cleanup_command =
'pg_archivecleanup /path/to/nfs %r' is enabled on both n2
and n3.</div>
<div><br>
</div>
<div>Can a situation might arise that a wal segment required
by n2 is already cleaned up by n3?</div>
<div><br>
</div>
<div>If yes, then how to mitigate it?</div>
<div><br>
</div>
<div>Thanks!</div>
<div>
<div>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><font face="Arial" color="#888888"><span style="font-size:11.3333px;white-space:pre-wrap">
</span></font></div>
<div><font face="Arial" color="#888888"><span style="font-size:11.3333px;white-space:pre-wrap">Prince Pathria
Systems Architect
Evive
+91 9478670472
<a moz-do-not-send="true" href="http://goevive.com"; target="_blank">goevive.com</a></span></font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-09-24 07:53 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-23 12:13 Archive clean up command in recovery.conf Prince Pathria <prince.pathria@goevive.com>
2018-09-24 06:22 ` Laurenz Albe <laurenz.albe@cybertec.at>
2018-09-24 07:53 ` "CONVERS Yann - DREAL Auvergne-Rhône-Alpes/CIDDAE/SIG" <yann.convers@developpement-durable.gouv.fr>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox