Re: Cluster::restart dumping logs when stop fails

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: Cluster::restart dumping logs when stop fails
Дата
Msg-id 0AFC73FA-AFAE-4F21-A3CC-7FA9277E7D02@yesql.se
обсуждение исходный текст
Ответ на Re: Cluster::restart dumping logs when stop fails  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
> On 7 Apr 2024, at 02:49, Andres Freund <andres@anarazel.de> wrote:
> On 2024-04-07 00:19:35 +0200, Daniel Gustafsson wrote:
>>> On 6 Apr 2024, at 23:44, Andres Freund <andres@anarazel.de> wrote:

>> The non-context aware fix would be to just print the last 1024 (or something)
>> bytes from the logfile:
>
> That'd be better, yes. I'd mainly log the path to the logfile though, that's
> probably at least as helpful for actually investigating the issue?

IIRC this was modelled around how it used to be earlier, in v14 in the
pre-refactored version we print the full logfile.

How about doing the below backpatched down to 15?

diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 54e1008ae5..a2f9409842 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -951,8 +951,7 @@ 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 +1089,7 @@ 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.

--
Daniel Gustafsson




В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Flushing large data immediately in pqcomm
Следующее
От: John Naylor
Дата:
Сообщение: Re: [PoC] Improve dead tuple storage for lazy vacuum