Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
56834fc7
Commit
56834fc7
authored
Jun 10, 2010
by
Itagaki Takahiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename restartpoint_command to archive_cleanup_command.
parent
0a7cb855
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
28 deletions
+28
-28
doc/src/sgml/high-availability.sgml
doc/src/sgml/high-availability.sgml
+3
-3
doc/src/sgml/recovery-config.sgml
doc/src/sgml/recovery-config.sgml
+6
-6
src/backend/access/transam/recovery.conf.sample
src/backend/access/transam/recovery.conf.sample
+2
-2
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+17
-17
No files found.
doc/src/sgml/high-availability.sgml
View file @
56834fc7
<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.7
1 2010/06/07 02:01:08
itagaki Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.7
2 2010/06/10 08:13:49
itagaki Exp $ -->
<chapter id="high-availability">
<title>High Availability, Load Balancing, and Replication</title>
...
...
@@ -681,7 +681,7 @@ protocol to make nodes agree on a serializable transactional order.
</para>
<para>
You can use <varname>
restartpoint
_command</> to prune the archive of
You can use <varname>
archive_cleanup
_command</> to prune the archive of
files no longer needed by the standby.
</para>
...
...
@@ -714,7 +714,7 @@ trigger_file = '/path/to/trigger_file'
<para>
If you're using a WAL archive, its size can be minimized using
the <varname>
restartpoint
_command</> option to remove files that are
the <varname>
archive_cleanup
_command</> option to remove files that are
no longer required by the standby server. Note however, that if you're
using the archive for backup purposes, you need to retain files needed
to recover from at least the latest base backup, even if they're no
...
...
doc/src/sgml/recovery-config.sgml
View file @
56834fc7
<!-- $PostgreSQL: pgsql/doc/src/sgml/recovery-config.sgml,v 2.
6 2010/04/28 07:34:11 heik
ki Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/recovery-config.sgml,v 2.
7 2010/06/10 08:13:49 itaga
ki Exp $ -->
<chapter Id="recovery-config">
<title>Recovery Configuration</title>
...
...
@@ -73,16 +73,16 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
</listitem>
</varlistentry>
<varlistentry id="
restartpoint-command" xreflabel="restartpoint
_command">
<term><varname>
restartpoint
_command</varname> (<type>string</type>)</term>
<varlistentry id="
archive-cleanup-command" xreflabel="archive_cleanup
_command">
<term><varname>
archive_cleanup
_command</varname> (<type>string</type>)</term>
<indexterm>
<primary><varname>
restartpoint
_command</> recovery parameter</primary>
<primary><varname>
archive_cleanup
_command</> recovery parameter</primary>
</indexterm>
<listitem>
<para>
This parameter specifies a shell command that will be executed at
every restartpoint. This parameter is optional. The purpose of the
<varname>
restartpoint
_command</> is to provide a mechanism for cleaning
<varname>
archive_cleanup
_command</> is to provide a mechanism for cleaning
up old archived WAL files that are no longer needed by the standby
server.
Any <literal>%r</> is replaced by the name of the file
...
...
@@ -114,7 +114,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
<varname>recovery_end_command</> is to provide a mechanism for cleanup
following replication or recovery.
Any <literal>%r</> is replaced by the name of the file containing the
last valid restart point, like in <xref linkend="
restartpoint
-command">.
last valid restart point, like in <xref linkend="
archive-cleanup
-command">.
</para>
<para>
If the command returns a non-zero exit status then a WARNING log
...
...
src/backend/access/transam/recovery.conf.sample
View file @
56834fc7
...
...
@@ -46,12 +46,12 @@
#restore_command = '' # e.g. 'cp /mnt/server/archivedir/%f %p'
#
#
#
restartpoint
_command
#
archive_cleanup
_command
#
# specifies an optional shell command to execute at every restartpoint.
# This can be useful for cleaning up the archive of a standby server.
#
#
restartpoint
_command = ''
#
archive_cleanup
_command = ''
#
# recovery_end_command
#
...
...
src/backend/access/transam/xlog.c
View file @
56834fc7
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.42
1 2010/06/10 07:49:23 heik
ki Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.42
2 2010/06/10 08:13:50 itaga
ki Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -180,7 +180,7 @@ static bool restoredFromArchive = false;
/* options taken from recovery.conf for archive recovery */
static
char
*
recoveryRestoreCommand
=
NULL
;
static
char
*
recoveryEndCommand
=
NULL
;
static
char
*
restartPoint
Command
=
NULL
;
static
char
*
archiveCleanup
Command
=
NULL
;
static
RecoveryTargetType
recoveryTarget
=
RECOVERY_TARGET_UNSET
;
static
bool
recoveryTargetInclusive
=
true
;
static
TransactionId
recoveryTargetXid
;
...
...
@@ -382,10 +382,10 @@ typedef struct XLogCtlData
TimeLineID
ThisTimeLineID
;
TimeLineID
RecoveryTargetTLI
;
/*
*
restartPoint
Command is read from recovery.conf but needs to be in
*
archiveCleanup
Command is read from recovery.conf but needs to be in
* shared memory so that the bgwriter process can access it.
*/
char
restartPoint
Command
[
MAXPGPATH
];
char
archiveCleanup
Command
[
MAXPGPATH
];
/*
* SharedRecoveryInProgress indicates if we're still in crash or archive
...
...
@@ -3063,7 +3063,7 @@ not_available:
* 'failonSignal' is true and the command is killed by a signal, a FATAL
* error is thrown. Otherwise a WARNING is emitted.
*
* This is currently used for restore_end_command and
restartpoint
_command.
* This is currently used for restore_end_command and
archive_cleanup
_command.
*/
static
void
ExecuteRecoveryCommand
(
char
*
command
,
char
*
commandName
,
bool
failOnSignal
)
...
...
@@ -5140,12 +5140,12 @@ readRecoveryCommandFile(void)
(
errmsg
(
"recovery_end_command = '%s'"
,
recoveryEndCommand
)));
}
else
if
(
strcmp
(
tok1
,
"
restartpoint
_command"
)
==
0
)
else
if
(
strcmp
(
tok1
,
"
archive_cleanup
_command"
)
==
0
)
{
restartPoint
Command
=
pstrdup
(
tok2
);
archiveCleanup
Command
=
pstrdup
(
tok2
);
ereport
(
DEBUG2
,
(
errmsg
(
"
restartpoint
_command = '%s'"
,
restartPoint
Command
)));
(
errmsg
(
"
archive_cleanup
_command = '%s'"
,
archiveCleanup
Command
)));
}
else
if
(
strcmp
(
tok1
,
"recovery_target_timeline"
)
==
0
)
{
...
...
@@ -5752,13 +5752,13 @@ StartupXLOG(void)
ControlFile
->
checkPointCopy
.
ThisTimeLineID
)));
/*
* Save the selected recovery target timeline ID and
restartpoint
_command
* Save the selected recovery target timeline ID and
archive_cleanup
_command
* in shared memory so that other processes can see them
*/
XLogCtl
->
RecoveryTargetTLI
=
recoveryTargetTLI
;
strncpy
(
XLogCtl
->
restartPoint
Command
,
restartPointCommand
?
restartPoint
Command
:
""
,
sizeof
(
XLogCtl
->
restartPoint
Command
));
strncpy
(
XLogCtl
->
archiveCleanup
Command
,
archiveCleanupCommand
?
archiveCleanup
Command
:
""
,
sizeof
(
XLogCtl
->
archiveCleanup
Command
));
if
(
InArchiveRecovery
)
{
...
...
@@ -7675,11 +7675,11 @@ CreateRestartPoint(int flags)
LWLockRelease
(
CheckpointLock
);
/*
* Finally, execute
restartpoint
_command, if any.
* Finally, execute
archive_cleanup
_command, if any.
*/
if
(
XLogCtl
->
restartPoint
Command
[
0
])
ExecuteRecoveryCommand
(
XLogCtl
->
restartPoint
Command
,
"
restartpoint
_command"
,
if
(
XLogCtl
->
archiveCleanup
Command
[
0
])
ExecuteRecoveryCommand
(
XLogCtl
->
archiveCleanup
Command
,
"
archive_cleanup
_command"
,
false
);
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment