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 1uSlNb-00ClPm-H6 for pgsql-committers@arkaria.postgresql.org; Fri, 20 Jun 2025 23:42:43 +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 1uSlNZ-004v02-Fw for pgsql-committers@arkaria.postgresql.org; Fri, 20 Jun 2025 23:42:42 +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 1uSlNZ-004uzu-4k for pgsql-committers@lists.postgresql.org; Fri, 20 Jun 2025 23:42:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uSlNY-0038R5-0F for pgsql-committers@lists.postgresql.org; Fri, 20 Jun 2025 23:42:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 55KNgckC2594453; Fri, 20 Jun 2025 19:42:38 -0400 From: Tom Lane To: Alexander Korotkov cc: Melanie Plageman , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Improve runtime and output of tests for replication slots checkp In-reply-to: References: <2542023.1750456985@sss.pgh.pa.us> <2585993.1750458298@sss.pgh.pa.us> Comments: In-reply-to Alexander Korotkov message dated "Sat, 21 Jun 2025 02:28:32 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2594451.1750462958.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 20 Jun 2025 19:42:38 -0400 Message-ID: <2594452.1750462958@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Korotkov writes: > And I see the following variable values. > (lldb) p/x targetPagePtr > (XLogRecPtr) 0x0000000029004000 > (lldb) p/x RecPtr > (XLogRecPtr) 0x0000000029002138 > I hardly understand how is this possible given it was compiled with "-O0= ". > I'm planning to continue investigating this tomorrow. Yeah, I see (lldb) p/x targetPagePtr (XLogRecPtr) 0x0000000029004000 (lldb) p/x RecPtr (XLogRecPtr) 0x0000000029002138 (lldb) p/x RecPtr - (RecPtr % 8192) (XLogRecPtr) 0x0000000029002000 We're here: /* Calculate pointer to beginning of next page */ targetPagePtr +=3D XLOG_BLCKSZ; /* Wait for the next page to become available */ readOff =3D ReadPageInternal(state, targetPagePtr, Min(total_len - gotlen + SizeOfXLog= ShortPHD, XLOG_BLCKSZ)); so that's where the increment of targetPagePtr came from. But "Wait for the next page to become available" seems awfully trusting that there will be another page. Should this be using the no-wait code path? regards, tom lane