You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-04 05:40:26 +02:00
Improve compatibility between different versions of binary and instance
This commit is contained in:
@ -571,7 +571,14 @@ readInstanceConfigFile(const char *instance_name)
|
|||||||
if (compress_alg)
|
if (compress_alg)
|
||||||
instance->compress_alg = parse_compress_alg(compress_alg);
|
instance->compress_alg = parse_compress_alg(compress_alg);
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= 110000
|
||||||
|
/* If for some reason xlog-seg-size is missing, then set it to 16MB */
|
||||||
|
if (!instance->xlog_seg_size)
|
||||||
|
instance->xlog_seg_size = DEFAULT_XLOG_SEG_SIZE;
|
||||||
|
#endif
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -564,10 +564,18 @@ main(int argc, char *argv[])
|
|||||||
#if PG_VERSION_NUM >= 110000
|
#if PG_VERSION_NUM >= 110000
|
||||||
/* Check xlog-seg-size option */
|
/* Check xlog-seg-size option */
|
||||||
if (instance_name &&
|
if (instance_name &&
|
||||||
backup_subcmd != INIT_CMD && backup_subcmd != SHOW_CMD &&
|
backup_subcmd != INIT_CMD &&
|
||||||
backup_subcmd != ADD_INSTANCE_CMD && backup_subcmd != SET_CONFIG_CMD &&
|
backup_subcmd != ADD_INSTANCE_CMD && backup_subcmd != SET_CONFIG_CMD &&
|
||||||
!IsValidWalSegSize(instance_config.xlog_seg_size))
|
!IsValidWalSegSize(instance_config.xlog_seg_size))
|
||||||
elog(ERROR, "Invalid WAL segment size %u", instance_config.xlog_seg_size);
|
{
|
||||||
|
/* If we are working with instance of PG<11 using PG11 binary,
|
||||||
|
* then xlog_seg_size is equal to zero. Manually set it to 16MB.
|
||||||
|
*/
|
||||||
|
if (instance_config.xlog_seg_size == 0)
|
||||||
|
instance_config.xlog_seg_size = DEFAULT_XLOG_SEG_SIZE;
|
||||||
|
else
|
||||||
|
elog(ERROR, "Invalid WAL segment size %u", instance_config.xlog_seg_size);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Sanity check of --backup-id option */
|
/* Sanity check of --backup-id option */
|
||||||
|
@ -78,7 +78,11 @@ do_show(const char *instance_name, time_t requested_backup_id, bool show_archive
|
|||||||
{
|
{
|
||||||
if (instance_name == NULL &&
|
if (instance_name == NULL &&
|
||||||
requested_backup_id != INVALID_BACKUP_ID)
|
requested_backup_id != INVALID_BACKUP_ID)
|
||||||
elog(ERROR, "You must specify --instance to use --backup_id option");
|
elog(ERROR, "You must specify --instance to use (-i, --backup-id) option");
|
||||||
|
|
||||||
|
if (show_archive &&
|
||||||
|
requested_backup_id != INVALID_BACKUP_ID)
|
||||||
|
elog(ERROR, "You cannot specify --archive and (-i, --backup-id) options together");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if instance_name is not specified,
|
* if instance_name is not specified,
|
||||||
@ -105,7 +109,7 @@ do_show(const char *instance_name, time_t requested_backup_id, bool show_archive
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* always use */
|
/* always use */
|
||||||
else if (show_format == SHOW_JSON ||
|
else if (show_format == SHOW_JSON ||
|
||||||
requested_backup_id == INVALID_BACKUP_ID)
|
requested_backup_id == INVALID_BACKUP_ID)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user