1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-02-03 14:01:57 +02:00

PGPRO-584: Save and load unit name for replica-timeout

This commit is contained in:
Arthur Zakirov 2017-11-22 19:21:30 +03:00
parent 78b510e82a
commit d9a2038575
2 changed files with 10 additions and 7 deletions

View File

@ -135,8 +135,13 @@ writeBackupCatalogConfig(FILE *out, pgBackupConfig *config)
fprintf(out, "master-db = %s\n", config->master_db);
if (config->master_user)
fprintf(out, "master-user = %s\n", config->master_user);
if (config->replica_timeout != INT_MIN)
fprintf(out, "replica_timeout = %d\n", config->replica_timeout);
{
convert_from_base_unit_u(config->replica_timeout, OPTION_UNIT_S,
&res, &unit);
fprintf(out, "replica-timeout = " UINT64_FORMAT "%s\n", res, unit);
}
fprintf(out, "#Logging parameters:\n");
if (config->log_level_console != INT_MIN)
@ -157,15 +162,13 @@ writeBackupCatalogConfig(FILE *out, pgBackupConfig *config)
{
convert_from_base_unit_u(config->log_rotation_size, OPTION_UNIT_KB,
&res, &unit);
fprintf(out, "log-rotation-size = " UINT64_FORMAT "%s\n",
res, unit);
fprintf(out, "log-rotation-size = " UINT64_FORMAT "%s\n", res, unit);
}
if (config->log_rotation_age)
{
convert_from_base_unit_u(config->log_rotation_age, OPTION_UNIT_S,
&res, &unit);
fprintf(out, "log-rotation-age = " UINT64_FORMAT "%s\n",
res, unit);
fprintf(out, "log-rotation-age = " UINT64_FORMAT "%s\n", res, unit);
}
fprintf(out, "#Retention parameters:\n");
@ -234,7 +237,7 @@ readBackupCatalogConfigFile(void)
{ 's', 0, "master-port", &(config->master_port), SOURCE_FILE_STRICT },
{ 's', 0, "master-db", &(config->master_db), SOURCE_FILE_STRICT },
{ 's', 0, "master-user", &(config->master_user), SOURCE_FILE_STRICT },
{ 'u', 0, "replica-timeout", &(config->replica_timeout), SOURCE_CMDLINE },
{ 'u', 0, "replica-timeout", &(config->replica_timeout), SOURCE_CMDLINE, SOURCE_DEFAULT, OPTION_UNIT_S },
/* other options */
{ 'U', 0, "system-identifier", &(config->system_identifier), SOURCE_FILE_STRICT },
{0}

View File

@ -119,7 +119,7 @@ static pgut_option options[] =
{ 's', 14, "master-host", &master_host, SOURCE_CMDLINE, },
{ 's', 15, "master-port", &master_port, SOURCE_CMDLINE, },
{ 's', 16, "master-user", &master_user, SOURCE_CMDLINE, },
{ 'u', 17, "replica-timeout", &replica_timeout, SOURCE_CMDLINE, },
{ 'u', 17, "replica-timeout", &replica_timeout, SOURCE_CMDLINE, SOURCE_DEFAULT, OPTION_UNIT_S },
/* TODO not completed feature. Make it unavailiable from user level
{ 'b', 18, "remote", &is_remote_backup, SOURCE_CMDLINE, }, */
/* restore options */