mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 15:16:29 +00:00
repmgr: in Barman clone mode, don't try and create the data directory twice
In Barman mode the data directory is created early containing a temporary directory needed to hold temporary files while cloning from the Barman server. In other modes we might not know the data directory location until connecting to the source server, so its creation happens later. In Barman mode ensure that step is skipped.
This commit is contained in:
23
repmgr.c
23
repmgr.c
@@ -2901,18 +2901,23 @@ do_standby_clone(void)
|
||||
}
|
||||
|
||||
|
||||
/* Check the destination data directory can be used */
|
||||
|
||||
if (!create_pg_dir(local_data_directory, runtime_options.force))
|
||||
{
|
||||
log_err(_("unable to use directory %s ...\n"),
|
||||
local_data_directory);
|
||||
log_hint(_("use -F/--force option to force this directory to be overwritten\n"));
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
if (mode != barman)
|
||||
{
|
||||
|
||||
/*
|
||||
* Check the destination data directory can be used
|
||||
* (in Barman mode, this directory will already have been created)
|
||||
*/
|
||||
|
||||
if (!create_pg_dir(local_data_directory, runtime_options.force))
|
||||
{
|
||||
log_err(_("unable to use directory %s ...\n"),
|
||||
local_data_directory);
|
||||
log_hint(_("use -F/--force option to force this directory to be overwritten\n"));
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that tablespaces named in any `tablespace_mapping` configuration
|
||||
* file parameters exist.
|
||||
|
||||
Reference in New Issue
Block a user