From 75a47b6a0dc4a235307e1acd1a6b3845cb881e55 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Mon, 8 Apr 2024 00:24:20 +0200 Subject: [PATCH] Change debug printing to log filename When restarting the cluster fails the code introduced in 33774978c78 printed the full log contents to aid debugging. For cases when the logfile is large this adds unnecessary overhead. Reduce to printing the logfile path instead. Reported-by: Andres Freund Discussion: https://postgr.es/m/20240406214439.2n4zf2w7ukhf7dsy@awork3.anarazel.de --- src/test/perl/PostgreSQL/Test/Cluster.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index 54e1008ae5..9b2879c145 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -951,8 +951,8 @@ sub start if ($ret != 0) { - print "# pg_ctl start failed; logfile:\n"; - print PostgreSQL::Test::Utils::slurp_file($self->logfile); + print "# pg_ctl start failed; see logfile for details: " + . $self->logfile . "\n"; # pg_ctl could have timed out, so check to see if there's a pid file; # otherwise our END block will fail to shut down the new postmaster. @@ -1090,8 +1090,8 @@ sub restart if ($ret != 0) { - print "# pg_ctl restart failed; logfile:\n"; - print PostgreSQL::Test::Utils::slurp_file($self->logfile); + print "# pg_ctl restart failed; see logfile for details: " + . $self->logfile . "\n"; # pg_ctl could have timed out, so check to see if there's a pid file; # otherwise our END block will fail to shut down the new postmaster.