Re: False "pg_serial": apparent wraparound” in logs - Mailing list pgsql-hackers

From Imseih (AWS), Sami
Subject Re: False "pg_serial": apparent wraparound” in logs
Date
Msg-id C3729C49-563F-42D8-84D5-78C0BA116052@amazon.com
Whole thread Raw
In response to Re: False "pg_serial": apparent wraparound” in logs  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: False "pg_serial": apparent wraparound” in logs
Re: False "pg_serial": apparent wraparound” in logs
Re: False "pg_serial": apparent wraparound” in logs
List 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

pgsql-hackers by date:

Previous
From: Gurjeet Singh
Date:
Subject: Re: [PoC/RFC] Multiple passwords, interval expirations
Next
From: "Imseih (AWS), Sami"
Date:
Subject: Re: False "pg_serial": apparent wraparound” in logs