1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Allow delta option to be specified in the pgBackRest configuration file.

This option was previously allowed on the command-line only for no particular reason that we could determine.

Being able to specify it in the config file seems like a good idea and won't change current usage.

Contributed by Cynthia Shang.
This commit is contained in:
Cynthia Shang 2018-09-18 13:29:05 -04:00 committed by David Steele
parent b6b2c915b2
commit bf0691576a
5 changed files with 47 additions and 29 deletions

View File

@ -695,18 +695,6 @@ my %hConfigDefine =
&CFGDEF_NEGATE => false,
},
&CFGOPT_DELTA =>
{
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
&CFGDEF_COMMAND =>
{
&CFGCMD_RESTORE =>
{
&CFGDEF_DEFAULT => false,
}
}
},
&CFGOPT_FORCE =>
{
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
@ -1116,6 +1104,19 @@ my %hConfigDefine =
}
},
&CFGOPT_DELTA =>
{
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
&CFGDEF_COMMAND =>
{
&CFGCMD_RESTORE =>
{
&CFGDEF_DEFAULT => false,
}
}
},
&CFGOPT_COMPRESS =>
{
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,

View File

@ -677,6 +677,15 @@
<example>db_main</example>
</config-key>
<!-- CONFIG - RESTORE SECTION - DELTA OPTION -->
<config-key id="delta" name="Delta">
<summary>Restore using delta.</summary>
<text>By default the <postgres/> data and tablespace directories are expected to be present but empty. This option performs a delta restore using checksums.</text>
<example>y</example>
</config-key>
<!-- CONFIG - RESTORE SECTION - LINK-ALL KEY -->
<config-key id="link-all" name="Link All">
<summary>Restore all symlinks.</summary>
@ -1030,15 +1039,6 @@
<example>20150131-153358F_20150131-153401I</example>
</option>
<!-- OPERATION - RESTORE COMMAND - DELTA OPTION -->
<option id="delta" name="Delta">
<summary>Restore using delta.</summary>
<text>By default the <postgres/> data and tablespace directories are expected to be present but empty. This option performs a delta restore using checksums.</text>
<example>y</example>
</option>
<!-- OPERATION - RESTORE COMMAND - FORCE OPTION -->
<option id="force" name="Force">
<summary>Force a restore.</summary>

View File

@ -45,6 +45,14 @@
<release-item>
<p>Improve support for special characters in filenames.</p>
</release-item>
<release-item>
<release-item-contributor-list>
<release-item-contributor id="cynthia.shang"/>
</release-item-contributor-list>
<p>Allow <br-option>delta</br-option> option to be specified in the <backrest/> configuration file.</p>
</release-item>
</release-improvement-list>
<release-development-list>

View File

@ -974,13 +974,21 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
(
CFGDEFDATA_OPTION_NAME("delta")
CFGDEFDATA_OPTION_REQUIRED(true)
CFGDEFDATA_OPTION_SECTION(cfgDefSectionCommandLine)
CFGDEFDATA_OPTION_SECTION(cfgDefSectionGlobal)
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeBoolean)
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("restore")
CFGDEFDATA_OPTION_HELP_SUMMARY("Restore using delta.")
CFGDEFDATA_OPTION_HELP_DESCRIPTION
(
"By default the PostgreSQL data and tablespace directories are expected to be present but empty. This option performs "
"a delta restore using checksums."
)
CFGDEFDATA_OPTION_COMMAND_LIST
(
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdRestore)
@ -993,13 +1001,6 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_OPTIONAL_COMMAND(cfgDefCmdRestore)
CFGDEFDATA_OPTION_OPTIONAL_DEFAULT("0")
CFGDEFDATA_OPTION_OPTIONAL_HELP_SUMMARY("Restore using delta.")
CFGDEFDATA_OPTION_OPTIONAL_HELP_DESCRIPTION
(
"By default the PostgreSQL data and tablespace directories are expected to be present but empty. This option "
"performs a delta restore using checksums."
)
)
)
)

View File

@ -258,6 +258,14 @@ static const struct option optionList[] =
.name = "delta",
.val = PARSE_OPTION_FLAG | cfgOptDelta,
},
{
.name = "no-delta",
.val = PARSE_OPTION_FLAG | PARSE_NEGATE_FLAG | cfgOptDelta,
},
{
.name = "reset-delta",
.val = PARSE_OPTION_FLAG | PARSE_RESET_FLAG | cfgOptDelta,
},
// exclude option
// -----------------------------------------------------------------------------------------------------------------------------