Skip to content

Commit

Permalink
Fix application_name's check
Browse files Browse the repository at this point in the history
The old regex from the recovery.conf era (pre-v12 versions) has been kept
while the output format we parse is slightly different in v12. Since, v12, we
parse the output of "postgres -C primary_conninfo" were there is no quotes
around the whole value. Because of this, the check was reporting a wrong error
if application_name was the very first parameter appearing in primary_conninfo.

Thanks to @zeroone on github for testing and reporting this bug with details in
issue #156.
  • Loading branch information
ioguix committed Dec 31, 2019
1 parent a66fc6d commit b824496
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script/pgsqlms
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ sub pgsql_validate_all {
}

$guc = qx{ $POSTGRES -C primary_conninfo -D "$pgdata" $start_opts};
unless ($guc =~ /['\s]application_name=$nodename['\s]/) {
unless ($guc =~ /\bapplication_name=$nodename\b/) {
ocf_exit_reason(
q{Parameter "primary_conninfo" MUST contain 'application_name=%s'. }.
q{It is currently set to '%s'}, $nodename, $guc );
Expand Down

0 comments on commit b824496

Please sign in to comment.