From b8244960b903654bbf64a1e50e1553a6ef37cb23 Mon Sep 17 00:00:00 2001 From: Jehan-Guillaume de Rorthais Date: Tue, 31 Dec 2019 15:36:53 +0100 Subject: [PATCH] Fix application_name's check 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. --- script/pgsqlms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/pgsqlms b/script/pgsqlms index 63feb4e..2480fc3 100755 --- a/script/pgsqlms +++ b/script/pgsqlms @@ -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 );