Re: Dubious server log messages after pg_upgrade

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Dubious server log messages after pg_upgrade
Date: 2025-03-15 20:15:26
Message-ID: 7q6xqgzcvirtbmbyqqbjvef3qpfswccthavjgld6ljlyhi7xdl@662yejysfiuq
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-03-15 16:14:10 -0400, Andres Freund wrote:
> On 2025-03-12 20:41:29 -0400, Tom Lane wrote:
> > I happened to notice these entries in a log file on a
> > buildfarm member [1]:
> >
> > 2025-03-12 15:39:53.265 UTC [7296] WARNING: found incorrect redo LSN 0/159FB60 (expected 0/40000028)
> > 2025-03-12 15:39:53.265 UTC [7296] LOG: corrupted statistics file "pg_stat/pgstat.stat"
> >
> > (this is near the end of the pg_upgrade_server.log log file).
> > I don't think these are related to that run's subsequent test failure,
> > which looks to be good old Windows randomness. I then looked into the
> > logs of a local BF instance that also runs xversion-upgrade tests, and
> > darned if I didn't find
> >
> > 2025-03-12 14:59:15.792 EDT [2216647] LOG: database system was shut down at 2025-03-12 14:59:13 EDT
> > 2025-03-12 14:59:15.794 EDT [2216647] WARNING: found incorrect redo LSN 0/46F73F18 (expected 0/47000028)
> > 2025-03-12 14:59:15.794 EDT [2216647] LOG: corrupted statistics file "pg_stat/pgstat.stat"
> > 2025-03-12 14:59:15.795 EDT [2216644] LOG: database system is ready to accept connections
> >
> > despite that run having completed with no report of trouble.
> > So this may have been going on for quite some time without our
> > noticing. The "corrupted statistics file" whine is most likely
> > caused by pg_upgrade copying the old system's pgstat.stat file
> > into the new installation --- is that a good idea? I have
> > no idea what's causing the redo LSN complaint, but it seems
> > like that might deserve closer investigation.
>
> I think the two issues are closely related - this is code that was introduced,
> in b860848232aa, as part of work to make pgstats somewhat crashsafe.

Ugh, sorry, that went out unintentionally.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lateef Sagar 2025-03-15 20:27:24 New subscriber - looking for an overview of the code
Previous Message Andres Freund 2025-03-15 20:14:10 Re: Dubious server log messages after pg_upgrade