pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Yushi Ogiwara <btogiwarayuushi@oss.nttdata.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Fix for consume_xids advancing XIDs incorrectly
Date: Wed, 30 Oct 2024 03:09:12 +0900
Message-ID: <da321d89-bc8b-4e6a-8ea6-248cf5ed4a50@oss.nttdata.com> (raw)
In-Reply-To: <710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com>
References: <2a62f138c9dcb6fcf5889b076d123aa2@oss.nttdata.com>
	<CAD21AoATuDuqSr=V3vCSbHbOg6g9zKL61EEbe4ZPG3xOUa0Pcw@mail.gmail.com>
	<50ee82a96ac0935de88f9a5ef021f04d@oss.nttdata.com>
	<CAD21AoAr92L0Yd-vF908He4B94F0W6Y1XC2ZUpm3WWoCLvONBw@mail.gmail.com>
	<57b588db6017ba20e67980fefa388b86@oss.nttdata.com>
	<a7667256-b98d-49a1-95a0-cca594151d07@oss.nttdata.com>
	<CAD21AoD8wJ0OiQbq=pc-TUCkEm1ohu6Et8G-Ntc8TFmPk3TuTA@mail.gmail.com>
	<88bed945-d8e3-4a28-ba9d-9eb3edde2d17@oss.nttdata.com>
	<CAD21AoB0uW34gHg23CoS=sQjgf29Fnj_7hF=VaCfcqexeBemMg@mail.gmail.com>
	<710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com>



On 2024/10/29 18:00, Yushi Ogiwara wrote:
>>>
>>>
>>>         consumed = XidSkip(nextXid);
>>>         if (consumed > 0)
>>>                 TransamVariables->nextXid.value += (uint64) consumed;
>>>
>>> BTW, the code snippet above in consume_xids_shortcut() could potentially set
>>> the next XID to a value below FirstNormalTransactionId? If yes, we should account for
>>> FirstNormalFullTransactionId when increasing the next XID, similar to
>>> how FullTransactionIdAdvance() handles it.
>>
>> Good catch. I agree with you. We need to do something similar to what
>> FullTransactionIdAdvance() does so that it does not appear as a
>> special 32-bit XID.
>>
>> Regards,
> 
> I think this is not the case since XidSkip returns min(UINT32_MAX - 5 - low, *), which prevents the wrap-around of nextXid.

Yes, you're right. Thanks for the correction!

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION






view thread (19+ messages)  latest in thread

Message-ID: <da321d89-bc8b-4e6a-8ea6-248cf5ed4a50@oss.nttdata.com>
Permalink:  ../da321d89-bc8b-4e6a-8ea6-248cf5ed4a50@oss.nttdata.com/
Also on:    postgresql.org/message-id/da321d89-bc8b-4e6a-8ea6-248cf5ed4a50@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, btogiwarayuushi@oss.nttdata.com, sawada.mshk@gmail.com
  Subject: Re: Fix for consume_xids advancing XIDs incorrectly
  In-Reply-To: <da321d89-bc8b-4e6a-8ea6-248cf5ed4a50@oss.nttdata.com>
  References: <2a62f138c9dcb6fcf5889b076d123aa2@oss.nttdata.com> <CAD21AoATuDuqSr=V3vCSbHbOg6g9zKL61EEbe4ZPG3xOUa0Pcw@mail.gmail.com> <50ee82a96ac0935de88f9a5ef021f04d@oss.nttdata.com> <CAD21AoAr92L0Yd-vF908He4B94F0W6Y1XC2ZUpm3WWoCLvONBw@mail.gmail.com> <57b588db6017ba20e67980fefa388b86@oss.nttdata.com> <a7667256-b98d-49a1-95a0-cca594151d07@oss.nttdata.com> <CAD21AoD8wJ0OiQbq=pc-TUCkEm1ohu6Et8G-Ntc8TFmPk3TuTA@mail.gmail.com> <88bed945-d8e3-4a28-ba9d-9eb3edde2d17@oss.nttdata.com> <CAD21AoB0uW34gHg23CoS=sQjgf29Fnj_7hF=VaCfcqexeBemMg@mail.gmail.com> <710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com> <da321d89-bc8b-4e6a-8ea6-248cf5ed4a50@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox