summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorHeikki Linnakangas2012-11-19 08:02:25 +0000
committerHeikki Linnakangas2012-11-19 08:14:20 +0000
commit644a0a6379afc00803dd89ffe8416514f5dfc217 (patch)
treeda387d3319795781f31d8448d2d101cead2e3151 /src/include
parentb6e3798f3aa2747db145f25e03a8d34f2e5ec8c8 (diff)
Fix archive_cleanup_command.
When I moved ExecuteRecoveryCommand() from xlog.c to xlogarchive.c, I didn't realize that it's called from the checkpoint process, not the startup process. I tried to use InRedo variable to decide whether or not to attempt cleaning up the archive (must not do so before we have read the initial checkpoint record), but that variable is only valid within the startup process. Instead, let ExecuteRecoveryCommand() always clean up the archive, and add an explicit argument to RestoreArchivedFile() to say whether that's allowed or not. The caller knows better. Reported by Erik Rijkers, diagnosis by Fujii Masao. Only 9.3devel is affected.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/xlog_internal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index 2c66b2feb8a..b70a62052c4 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -243,7 +243,8 @@ extern char *recoveryRestoreCommand;
* Prototypes for functions in xlogarchive.c
*/
extern bool RestoreArchivedFile(char *path, const char *xlogfname,
- const char *recovername, off_t expectedSize);
+ const char *recovername, off_t expectedSize,
+ bool cleanupEnabled);
extern void ExecuteRecoveryCommand(char *command, char *commandName,
bool failOnerror);
extern void XLogArchiveNotify(const char *xlog);