pgbackrest.git / summary / log / commit / refs
commit 9bf7dbf6a2684c529da501eb95a1426ebb5d64ca
Author: David Steele <david@pgmasters.net>
Date: Wed Dec 30 21:03:49 2020 +0000
Do not pass pg-local/repo-local to a remote process.
This was a hack to prevent the remote from loading host settings, which is now handled by option validity for command roles.
These options are still useful so don't remove them, but do leave them internal for now.
build/lib/pgBackRestBuild/Config/Data.pm | 12 ++++++++++++
src/config/parse.auto.c | 31 -------------------------------
src/protocol/helper.c | 7 -------
test/src/module/protocol/protocolTest.c | 14 +++++++-------
4 files changed, 19 insertions(+), 45 deletions(-)
diff --git a/build/lib/pgBackRestBuild/Config/Data.pm b/build/lib/pgBackRestBuild/Config/Data.pm
index 2641ba454..953b11d05 100644
--- a/build/lib/pgBackRestBuild/Config/Data.pm
+++ b/build/lib/pgBackRestBuild/Config/Data.pm
@@ -1809,6 +1809,12 @@ my %hConfigDefine =
&CFGCMD_STOP => {},
&CFGCMD_VERIFY => {},
},
+ &CFGDEF_COMMAND_ROLE =>
+ {
+ &CFGCMD_ROLE_DEFAULT => {},
+ &CFGCMD_ROLE_ASYNC => {},
+ &CFGCMD_ROLE_LOCAL => {},
+ },
},
&CFGOPT_REPO_HOST =>
@@ -2987,6 +2993,12 @@ my %hConfigDefine =
&CFGCMD_START => {},
&CFGCMD_STOP => {},
},
+ &CFGDEF_COMMAND_ROLE =>
+ {
+ &CFGCMD_ROLE_DEFAULT => {},
+ &CFGCMD_ROLE_ASYNC => {},
+ &CFGCMD_ROLE_LOCAL => {},
+ },
},
&CFGOPT_PG_HOST =>
diff --git a/src/config/parse.auto.c b/src/config/parse.auto.c
index 04e69d5b8..acdb35e78 100644
--- a/src/config/parse.auto.c
+++ b/src/config/parse.auto.c
@@ -2448,18 +2448,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
PARSE_RULE_OPTION_COMMAND(cfgCmdRestore)
),
- PARSE_RULE_OPTION_COMMAND_ROLE_REMOTE_VALID_LIST
- (
- PARSE_RULE_OPTION_COMMAND(cfgCmdArchiveGet)
- PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush)
- PARSE_RULE_OPTION_COMMAND(cfgCmdBackup)
- PARSE_RULE_OPTION_COMMAND(cfgCmdCheck)
- PARSE_RULE_OPTION_COMMAND(cfgCmdRestore)
- PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate)
- PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete)
- PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade)
- ),
-
PARSE_RULE_OPTION_OPTIONAL_LIST
(
PARSE_RULE_OPTION_OPTIONAL_DEFAULT("0"),
@@ -4314,25 +4302,6 @@ static const ParseRuleOption parseRuleOption[CFG_OPTION_TOTAL] =
PARSE_RULE_OPTION_COMMAND(cfgCmdVerify)
),
- PARSE_RULE_OPTION_COMMAND_ROLE_REMOTE_VALID_LIST
- (
- PARSE_RULE_OPTION_COMMAND(cfgCmdArchiveGet)
- PARSE_RULE_OPTION_COMMAND(cfgCmdArchivePush)
- PARSE_RULE_OPTION_COMMAND(cfgCmdBackup)
- PARSE_RULE_OPTION_COMMAND(cfgCmdCheck)
- PARSE_RULE_OPTION_COMMAND(cfgCmdInfo)
- PARSE_RULE_OPTION_COMMAND(cfgCmdRepoCreate)
- PARSE_RULE_OPTION_COMMAND(cfgCmdRepoGet)
- PARSE_RULE_OPTION_COMMAND(cfgCmdRepoLs)
- PARSE_RULE_OPTION_COMMAND(cfgCmdRepoPut)
- PARSE_RULE_OPTION_COMMAND(cfgCmdRepoRm)
- PARSE_RULE_OPTION_COMMAND(cfgCmdRestore)
- PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaCreate)
- PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaDelete)
- PARSE_RULE_OPTION_COMMAND(cfgCmdStanzaUpgrade)
- PARSE_RULE_OPTION_COMMAND(cfgCmdVerify)
- ),
-
PARSE_RULE_OPTION_OPTIONAL_LIST
(
PARSE_RULE_OPTION_OPTIONAL_DEFAULT("0"),
diff --git a/src/protocol/helper.c b/src/protocol/helper.c
index 27b8bba93..c3ad2efd6 100644
--- a/src/protocol/helper.c
+++ b/src/protocol/helper.c
@@ -393,13 +393,6 @@ protocolRemoteParam(ProtocolStorageType protocolStorageType, unsigned int hostId
}
}
- // Set local so host settings configured on the remote will not accidentally be picked up
- kvPut(
- optionReplace,
- protocolStorageType == protocolStorageTypeRepo ?
- VARSTRZ(cfgOptionIdxName(cfgOptRepoLocal, hostIdx)) : VARSTRZ(cfgParseOptionKeyIdxName(cfgOptPgLocal, 0)),
- BOOL_TRUE_VAR);
-
// Set default to make it explicit which host will be used on the remote
kvPut(
optionReplace,
diff --git a/test/src/module/protocol/protocolTest.c b/test/src/module/protocol/protocolTest.c
index e88d1e2cb..c5df4bc8c 100644
--- a/test/src/module/protocol/protocolTest.c
+++ b/test/src/module/protocol/protocolTest.c
@@ -270,7 +270,7 @@ testRun(void)
strLstJoin(protocolRemoteParam(protocolStorageTypeRepo, 0), "|"),
"-o|LogLevel=error|-o|Compression=no|-o|PasswordAuthentication=no|repo-host-user@repo-host"
"|pgbackrest --exec-id=1-test --log-level-console=off --log-level-file=off --log-level-stderr=error"
- " --pg1-path=/path/to/pg --process=0 --remote-type=repo --repo=1 --repo1-local --stanza=test1 archive-get:remote",
+ " --pg1-path=/path/to/pg --process=0 --remote-type=repo --repo=1 --stanza=test1 archive-get:remote",
"remote protocol params");
// -------------------------------------------------------------------------------------------------------------------------
@@ -294,7 +294,7 @@ testRun(void)
"-o|LogLevel=error|-o|Compression=no|-o|PasswordAuthentication=no|-p|444|repo-host-user@repo-host"
"|pgbackrest --config=/path/pgbackrest.conf --config-include-path=/path/include --config-path=/path/config"
" --exec-id=1-test --log-level-console=off --log-level-file=info --log-level-stderr=error --log-subprocess"
- " --pg1-path=/unused --process=0 --remote-type=repo --repo=1 --repo1-local --stanza=test1 check:remote",
+ " --pg1-path=/unused --process=0 --remote-type=repo --repo=1 --stanza=test1 check:remote",
"remote protocol params with replacements");
// -------------------------------------------------------------------------------------------------------------------------
@@ -313,7 +313,7 @@ testRun(void)
strLstJoin(protocolRemoteParam(protocolStorageTypeRepo, 0), "|"),
"-o|LogLevel=error|-o|Compression=no|-o|PasswordAuthentication=no|pgbackrest@repo-host"
"|pgbackrest --exec-id=1-test --log-level-console=off --log-level-file=off --log-level-stderr=error"
- " --pg1-path=/path/to/pg --process=3 --remote-type=repo --repo=1 --repo1-local --stanza=test1 archive-get:remote",
+ " --pg1-path=/path/to/pg --process=3 --remote-type=repo --repo=1 --stanza=test1 archive-get:remote",
"remote protocol params for backup local");
// -------------------------------------------------------------------------------------------------------------------------
@@ -330,7 +330,7 @@ testRun(void)
strLstJoin(protocolRemoteParam(protocolStorageTypePg, 0), "|"),
"-o|LogLevel=error|-o|Compression=no|-o|PasswordAuthentication=no|postgres@pg1-host"
"|pgbackrest --exec-id=1-test --log-level-console=off --log-level-file=off --log-level-stderr=error --pg=1"
- " --pg1-local --pg1-path=/path/to/1 --process=0 --remote-type=pg --stanza=test1 backup:remote",
+ " --pg1-path=/path/to/1 --process=0 --remote-type=pg --stanza=test1 backup:remote",
"remote protocol params for db backup");
// -------------------------------------------------------------------------------------------------------------------------
@@ -352,7 +352,7 @@ testRun(void)
strLstJoin(protocolRemoteParam(protocolStorageTypePg, 1), "|"),
"-o|LogLevel=error|-o|Compression=no|-o|PasswordAuthentication=no|postgres@pg2-host"
"|pgbackrest --exec-id=1-test --log-level-console=off --log-level-file=off --log-level-stderr=error --pg=1"
- " --pg1-local --pg1-path=/path/to/2 --process=4 --remote-type=pg --stanza=test1 backup:remote",
+ " --pg1-path=/path/to/2 --process=4 --remote-type=pg --stanza=test1 backup:remote",
"remote protocol params for db local");
// -------------------------------------------------------------------------------------------------------------------------
@@ -374,8 +374,8 @@ testRun(void)
strLstJoin(protocolRemoteParam(protocolStorageTypePg, 1), "|"),
"-o|LogLevel=error|-o|Compression=no|-o|PasswordAuthentication=no|postgres@pg3-host"
"|pgbackrest --exec-id=1-test --log-level-console=off --log-level-file=off --log-level-stderr=error --pg=1"
- " --pg1-local --pg1-path=/path/to/3 --pg1-port=3333 --pg1-socket-path=/socket3 --process=4 --remote-type=pg"
- " --stanza=test1 backup:remote",
+ " --pg1-path=/path/to/3 --pg1-port=3333 --pg1-socket-path=/socket3 --process=4 --remote-type=pg --stanza=test1"
+ " backup:remote",
"remote protocol params for db local");
}
[parent: 141466875f42]