exit with status 2 if manual work is needed during standby_clone

This commit is contained in:
Charles Duffy
2011-02-06 15:05:34 -06:00
committed by Greg Smith
parent a02cd43115
commit 7e7c45c61d
2 changed files with 18 additions and 14 deletions

View File

@@ -970,30 +970,33 @@ stop_backup:
/* If the rsync failed then exit */
if (r != 0)
exit(ERR_BAD_CONFIG);
exit(ERR_BAD_RSYNC);
if (runtime_options.verbose)
printf(_("%s requires primary to keep WAL files %s until at least %s\n"),
progname, first_wal_segment, last_wal_segment);
/* we need to create the pg_xlog sub directory too, i'm reusing a variable here */
snprintf(local_control_file, MAXFILENAME, "%s/pg_xlog", runtime_options.dest_dir);
if (!create_directory(local_control_file))
{
log_err(_("%s: couldn't create directory %s, you will need to do it manually...\n"),
progname, runtime_options.dest_dir);
}
/* Finally, write the recovery.conf file */
create_recovery_file(runtime_options.dest_dir);
/* we need to create the pg_xlog sub directory too, i'm reusing a variable here */
snprintf(local_control_file, MAXFILENAME, "%s/pg_xlog", runtime_options.dest_dir);
if (!create_directory(local_control_file))
{
log_err(_("%s: couldn't create directory %s, you will need to do it manually...\n"),
progname, runtime_options.dest_dir);
r = ERR_NEEDS_XLOG; /* continue, but eventually exit returning error */
}
/* Finally, write the recovery.conf file */
create_recovery_file(runtime_options.dest_dir);
PQclear(res);
PQfinish(conn);
/* We don't start the service because we still may want to move the directory */
return;
/*
* We don't start the service yet because we still may want to
* move the directory
*/
exit(r);
}

View File

@@ -51,6 +51,7 @@
#define ERR_BAD_RSYNC 2
#define ERR_STOP_BACKUP 3
#define ERR_NO_RESTART 4
#define ERR_NEEDS_XLOG 5
/* Run time options type */
typedef struct {