Re: Cluster::restart dumping logs when stop fails

2024-04-07 Thread Daniel Gustafsson
> On 7 Apr 2024, at 18:51, Daniel Gustafsson wrote: >> On 7 Apr 2024, at 18:28, Andres Freund wrote: >> I'm ok with printing path + some content or just the path. > > I think printing the last 512 bytes or so would be a good approach, I'll take > care of it later tonight. That would be a backpa

Re: Cluster::restart dumping logs when stop fails

2024-04-07 Thread Andres Freund
On 2024-04-07 18:51:40 +0200, Daniel Gustafsson wrote: > > On 7 Apr 2024, at 18:28, Andres Freund wrote: > > > > On 2024-04-07 16:52:05 +0200, Daniel Gustafsson wrote: > >>> On 7 Apr 2024, at 14:51, Andrew Dunstan wrote: > >>> On 2024-04-06 Sa 20:49, Andres Freund wrote: > >> > That's prob

Re: Cluster::restart dumping logs when stop fails

2024-04-07 Thread Daniel Gustafsson
> On 7 Apr 2024, at 18:28, Andres Freund wrote: > > On 2024-04-07 16:52:05 +0200, Daniel Gustafsson wrote: >>> On 7 Apr 2024, at 14:51, Andrew Dunstan wrote: >>> On 2024-04-06 Sa 20:49, Andres Freund wrote: >> That's probably unnecessary optimization, but it seems a tad silly to read

Re: Cluster::restart dumping logs when stop fails

2024-04-07 Thread Andres Freund
On 2024-04-07 16:52:05 +0200, Daniel Gustafsson wrote: > > On 7 Apr 2024, at 14:51, Andrew Dunstan wrote: > > On 2024-04-06 Sa 20:49, Andres Freund wrote: > > >> That's probably unnecessary optimization, but it seems a tad silly to read > >> an > >> entire, potentially sizable, file to just use

Re: Cluster::restart dumping logs when stop fails

2024-04-07 Thread Daniel Gustafsson
> On 7 Apr 2024, at 14:51, Andrew Dunstan wrote: > On 2024-04-06 Sa 20:49, Andres Freund wrote: >> That's probably unnecessary optimization, but it seems a tad silly to read an >> entire, potentially sizable, file to just use the last 1k. Not sure if the >> way >> slurp_file() uses seek supports

Re: Cluster::restart dumping logs when stop fails

2024-04-07 Thread Andrew Dunstan
On 2024-04-06 Sa 20:49, Andres Freund wrote: That's probably unnecessary optimization, but it seems a tad silly to read an entire, potentially sizable, file to just use the last 1k. Not sure if the way slurp_file() uses seek supports negative ofsets, the docs read to me like that may only be su

Re: Cluster::restart dumping logs when stop fails

2024-04-07 Thread Daniel Gustafsson
> On 7 Apr 2024, at 02:49, Andres Freund wrote: > On 2024-04-07 00:19:35 +0200, Daniel Gustafsson wrote: >>> On 6 Apr 2024, at 23:44, Andres Freund 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 m

Re: Cluster::restart dumping logs when stop fails

2024-04-06 Thread Andres Freund
Hi, On 2024-04-07 00:19:35 +0200, Daniel Gustafsson wrote: > > On 6 Apr 2024, at 23:44, Andres Freund wrote: > > > It might be useful to print a few lines, but the whole log files can be > > several megabytes worth of output. > > The non-context aware fix would be to just print the last 1024 (o

Re: Cluster::restart dumping logs when stop fails

2024-04-06 Thread Daniel Gustafsson
> On 6 Apr 2024, at 23:44, Andres Freund wrote: > It might be useful to print a few lines, but the whole log files can be > several megabytes worth of output. The non-context aware fix would be to just print the last 1024 (or something) bytes from the logfile: diff --git a/src/test/perl/Postgre