diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 5e52fd9d0..221ad0e7a 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -45,6 +45,14 @@

Fixed an issue with invalid backup groups being set correctly on restore. If the backup cannot map a group to a name it stores the group in the manifest as false then uses either the owner of $PGDATA to set the group during restore or failing that the group of the current user. This logic was not working correctly because the selected group was overwriting the user on restore leaving the group undefined and the user incorrectly set to the group.

+ + + + + + +

Fixed an issue passing parameters to remotes. When more than one db was specified the path, port, and socket path would for db1 were passed no matter which db was actually being addressed.

+
diff --git a/lib/pgBackRest/Protocol/Helper.pm b/lib/pgBackRest/Protocol/Helper.pm index fff878c85..885ef6296 100644 --- a/lib/pgBackRest/Protocol/Helper.pm +++ b/lib/pgBackRest/Protocol/Helper.pm @@ -223,9 +223,9 @@ sub protocolParam # option will be set to 'protocol' which is not a valid value from the command line. &CFGOPT_LOG_LEVEL_STDERR => {}, - &CFGOPT_DB_PATH => {value => $strOptionDbPath}, - &CFGOPT_DB_PORT => {value => $strOptionDbPort}, - &CFGOPT_DB_SOCKET_PATH => {value => $strOptionDbSocketPath}, + cfgOptionIdFromIndex(CFGOPT_DB_PATH, 1) => {value => $strOptionDbPath}, + cfgOptionIdFromIndex(CFGOPT_DB_PORT, 1) => {value => $strOptionDbPort}, + cfgOptionIdFromIndex(CFGOPT_DB_SOCKET_PATH, 1) => {value => $strOptionDbSocketPath}, # Set protocol options explicitly so values are not picked up from remote config files &CFGOPT_BUFFER_SIZE => {value => cfgOption(CFGOPT_BUFFER_SIZE)}, diff --git a/test/lib/pgBackRestTest/Module/Protocol/ProtocolHelperTest.pm b/test/lib/pgBackRestTest/Module/Protocol/ProtocolHelperTest.pm index 3a85b4d55..0e96573f6 100644 --- a/test/lib/pgBackRestTest/Module/Protocol/ProtocolHelperTest.pm +++ b/test/lib/pgBackRestTest/Module/Protocol/ProtocolHelperTest.pm @@ -88,13 +88,16 @@ sub run $self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PATH, 1), '/db1'); $self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PORT, 1), '1111'); $self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_CMD, 1), 'pgbackrest1'); + $self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_HOST, 2), 'db-host-2'); + $self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PATH, 2), '/db2'); + $self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PORT, 2), '2222'); + $self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_CMD, 2), 'pgbackrest2'); $self->configTestLoad(CFGCMD_BACKUP); $self->testResult( - sub {pgBackRest::Protocol::Helper::protocolParam( - cfgCommandName(CFGCMD_BACKUP), CFGOPTVAL_REMOTE_TYPE_DB, 1)}, - '(db-host-1, postgres, [undef], pgbackrest1 --buffer-size=4194304 --command=backup --compress-level=6' . - ' --compress-level-network=3 --db1-path=/db1 --db1-port=1111 --protocol-timeout=1830 --stanza=db --type=db remote)', + sub {pgBackRest::Protocol::Helper::protocolParam(cfgCommandName(CFGCMD_BACKUP), CFGOPTVAL_REMOTE_TYPE_DB, 2)}, + '(db-host-2, postgres, [undef], pgbackrest2 --buffer-size=4194304 --command=backup --compress-level=6' . + ' --compress-level-network=3 --db1-path=/db2 --db1-port=2222 --protocol-timeout=1830 --stanza=db --type=db remote)', 'more than one backup db host'); }