Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOuz9-0001r5-Qd for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Nov 2018 01:37:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gOuz8-0001nX-2X for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Nov 2018 01:37:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOuz7-0001nF-KG for pgsql-hackers@lists.postgresql.org; Tue, 20 Nov 2018 01:37:49 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gOuyz-0004Lb-Im for pgsql-hackers@postgresql.org; Tue, 20 Nov 2018 01:37:48 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id A76B321C738C; Tue, 20 Nov 2018 04:37:38 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.0.103] (unknown [5.79.143.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 48ABE21C72AE; Tue, 20 Nov 2018 04:37:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1542677858; bh=LbjLmPxlgUF9q3UTl67PSNUxDDLmdKUmr6XvnY/lpYg=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=ldOxEV6ftsQhslJ8l3yrfHnnSD/6lcFwJPTCijL6AOla8EnLtkDptKCsEBOa0FfRi maAJXfl8HyZeJhvIVRds2WCY4oQBDOuDCHZp55zffaKLvOTB0Np8yEqC8/m6TY1R8s y9/NjAJBUdyPnDqB1o1wP/857lMBlkcpjBx76dTs= Subject: Re: [PATCH] XLogReadRecord returns pointer to currently read page To: Michael Paquier Cc: Kyotaro HORIGUCHI , hlinnaka@iki.fi, pgsql-hackers@postgresql.org References: <2553f2b0-0e39-eb0e-d382-6c0ed08ca8ae@postgrespro.ru> <20181026.143300.212568635.horiguchi.kyotaro@lab.ntt.co.jp> <20181115.181238.258013477.horiguchi.kyotaro@lab.ntt.co.jp> <20181116062355.GE6613@paquier.xyz> <49518b48-2036-5e43-1818-0f594e375e76@postgrespro.ru> <20181120013056.GH4400@paquier.xyz> From: Andrey Lepikhov Organization: Postgres Professional Message-ID: <5423cf66-cd12-96d0-abf0-1776d466bfaa@postgrespro.ru> Date: Tue, 20 Nov 2018 06:37:36 +0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181120013056.GH4400@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 20.11.2018 6:30, Michael Paquier wrote: > On Mon, Nov 19, 2018 at 10:48:06AM +0500, Andrey Lepikhov wrote: >> According to my experience, I clarify some comments to avoid this mistakes >> in the future (see attachment). > > No objections from here. > >> - * The returned pointer (or *errormsg) points to an internal buffer that's >> - * valid until the next call to XLogReadRecord. >> + * The returned pointer (or *errormsg) points to an internal read-only buffer >> + * that's valid until the next call to XLogReadRecord. > > Not sure that this bit adds much. Ok > >> - /* Buffer for current ReadRecord result (expandable) */ >> + /* >> + * Buffer for current ReadRecord result (expandable). >> + * Used in the case, than current ReadRecord result don't fit on the >> + * currently read WAL page. >> + */ > > Yeah, this one is not entirely true now. What about the following > instead: > - /* Buffer for current ReadRecord result (expandable) */ > + /* > + * Buffer for current ReadRecord result (expandable), used when a record > + * crosses a page boundary. > + */ I agree -- Andrey Lepikhov Postgres Professional https://postgrespro.com The Russian Postgres Company