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

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: False "pg_serial": apparent wraparound” in logs
Дата
Msg-id ba09455c-a8ad-1eca-c0cf-cc96fc4aa387@iki.fi
обсуждение исходный текст
Ответ на Re: False "pg_serial": apparent wraparound” in logs  ("Imseih (AWS), Sami" <simseih@amazon.com>)
Ответы Re: False "pg_serial": apparent wraparound” in logs  ("Imseih (AWS), Sami" <simseih@amazon.com>)
Список 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 по дате отправления:

Предыдущее
От: Benoit Lobréau
Дата:
Сообщение: Re: Questions about the new subscription parameter: password_required
Следующее
От: Matthias van de Meent
Дата:
Сообщение: Re: Index AmInsert Parameter Confused?