Re: False "pg_serial": apparent wraparound” in logs

From: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Michael Paquier <michael(at)paquier(dot)xyz>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: False "pg_serial": apparent wraparound” in logs
Date: 2023-10-05 23:28:02
Message-ID: C3729C49-563F-42D8-84D5-78C0BA116052@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I think the smallest fix here would be to change CheckPointPredicate()
> so that if tailPage > headPage, pass headPage to SimpleLruTruncate()
> instead of tailPage. Or perhaps it should go into the "The SLRU is no
> longer needed" codepath in that case. If tailPage > headPage, the SLRU
> isn't needed at the moment.

I spent sometime studying this and it appears to be a good approach.

Passing the cutoff page as headPage (SLRU not needed code path ) instead of the tailPage to
SimpleLruTruncate is already being done when the tailXid is not a valid XID.
I added an additional condition to make sure that the tailPage proceeds the headPage
as well.

Attached is v2 of the patch.

> In addition to that, we could change SerialAdd() to not zero out the
> pages between old headXid and tailXid unnecessarily, but that's more of
> an optimization than bug fix.

Yes, I did notice that in my debugging, but will not address this in the current patch.

Regards,

Sami

Attachment Content-Type Size
0001-v2-Fix-false-apparent-wraparound-detected-in-pg_serial.patch application/octet-stream 2.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Imseih (AWS), Sami 2023-10-05 23:50:01 Re: False "pg_serial": apparent wraparound” in logs
Previous Message Gurjeet Singh 2023-10-05 21:28:17 Re: [PoC/RFC] Multiple passwords, interval expirations