Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t5i5a-007rj5-2H for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Oct 2024 09:00:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t5i5X-00EC80-LO for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Oct 2024 09:00:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t5i5X-00EC7q-BY for pgsql-hackers@lists.postgresql.org; Tue, 29 Oct 2024 09:00:31 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t5i5U-003Q6b-LZ for pgsql-hackers@postgresql.org; Tue, 29 Oct 2024 09:00:30 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 6374361413; Tue, 29 Oct 2024 18:00:24 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 29 Oct 2024 18:00:24 +0900 From: Yushi Ogiwara To: Masahiko Sawada Cc: Fujii Masao , Pgsql Hackers Subject: Re: Fix for consume_xids advancing XIDs incorrectly In-Reply-To: References: <2a62f138c9dcb6fcf5889b076d123aa2@oss.nttdata.com> <50ee82a96ac0935de88f9a5ef021f04d@oss.nttdata.com> <57b588db6017ba20e67980fefa388b86@oss.nttdata.com> <88bed945-d8e3-4a28-ba9d-9eb3edde2d17@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com> X-Sender: btogiwarayuushi@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >> >> >> 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