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 1t5qeg-008yUm-27 for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Oct 2024 18:09:22 +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 1t5qed-001WxW-Rz for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Oct 2024 18:09:20 +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 1t5qed-001WxN-I0 for pgsql-hackers@lists.postgresql.org; Tue, 29 Oct 2024 18:09:19 +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 1t5qea-003UZM-Gm for pgsql-hackers@postgresql.org; Tue, 29 Oct 2024 18:09:18 +0000 Received: from [192.168.11.2] (p3644124-ipxg13201funabasi.chiba.ocn.ne.jp [114.145.201.124]) by oss.nttdata.com (Postfix) with ESMTPSA id 9CBE260796; Wed, 30 Oct 2024 03:09:12 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Wed, 30 Oct 2024 03:09:12 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Fix for consume_xids advancing XIDs incorrectly To: Yushi Ogiwara , Masahiko Sawada Cc: Pgsql Hackers References: <2a62f138c9dcb6fcf5889b076d123aa2@oss.nttdata.com> <50ee82a96ac0935de88f9a5ef021f04d@oss.nttdata.com> <57b588db6017ba20e67980fefa388b86@oss.nttdata.com> <88bed945-d8e3-4a28-ba9d-9eb3edde2d17@oss.nttdata.com> <710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com> Content-Language: en-US From: Fujii Masao In-Reply-To: <710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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