pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yushi Ogiwara <btogiwarayuushi@oss.nttdata.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Fix for consume_xids advancing XIDs incorrectly
Date: Tue, 29 Oct 2024 18:00:24 +0900
Message-ID: <710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com> (raw)
In-Reply-To: <CAD21AoB0uW34gHg23CoS=sQjgf29Fnj_7hF=VaCfcqexeBemMg@mail.gmail.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>

>> 
>> 
>>         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.

Regards,
Yushi Ogiwara





view thread (19+ messages)  latest in thread

Message-ID: <710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com>
Permalink:  ../710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com/
Also on:    postgresql.org/message-id/710b46d68d053eac91c9c8ec9feea09d@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: btogiwarayuushi@oss.nttdata.com, sawada.mshk@gmail.com, masao.fujii@oss.nttdata.com
  Subject: Re: Fix for consume_xids advancing XIDs incorrectly
  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>

* 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