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

From Heikki Linnakangas
Subject Re: False "pg_serial": apparent wraparound” in logs
Date
Msg-id ba09455c-a8ad-1eca-c0cf-cc96fc4aa387@iki.fi
Whole thread Raw
In response to Re: False "pg_serial": apparent wraparound” in logs  ("Imseih (AWS), Sami" <simseih@amazon.com>)
Responses Re: False "pg_serial": apparent wraparound” in logs
List pgsql-hackers
On 25/08/2023 07:29, Imseih (AWS), Sami wrote:
> diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
> index 1af41213b4..7e7be3b885 100644
> --- a/src/backend/storage/lmgr/predicate.c
> +++ b/src/backend/storage/lmgr/predicate.c
> @@ -992,6 +992,13 @@ SerialSetActiveSerXmin(TransactionId xid)
>  
>      serialControl->tailXid = xid;
>  
> +    /*
> +     * If the SLRU is being used, set the latest page number to
> +     * the current tail xid.
> +     */
> +    if (serialControl->headPage > 0)
> +        SerialSlruCtl->shared->latest_page_number = SerialPage(serialControl->tailXid);
> +
>      LWLockRelease(SerialSLRULock);
>  }

I don't really understand what exactly the problem is, or how this fixes 
it. But this doesn't feel right:

Firstly, isn't headPage == 0 also a valid value? We initialize headPage 
to -1 when it's not in use.

Secondly, shouldn't we set it to the page corresponding to headXid 
rather than tailXid.

Thirdly, I don't think this code should have any business setting 
latest_page_number directly. latest_page_number is set in 
SimpleLruZeroPage(). Are we missing a call to SimpleLruZeroPage() somewhere?

-- 
Heikki Linnakangas
Neon (https://neon.tech)




pgsql-hackers by date:

Previous
From: Benoit Lobréau
Date:
Subject: Re: Questions about the new subscription parameter: password_required
Next
From: Matthias van de Meent
Date:
Subject: Re: Index AmInsert Parameter Confused?