Re: [PATCH] xlogreader: do not read a file block twice

Artur Zakirov <a.zakirov@postgrespro.ru>

From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Michael Paquier <michael@paquier.xyz>, Grigory Smolkin <g.smolkin@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2019-02-12T08:44:14Z
Lists: pgsql-hackers
On 12.02.2019 07:23, Michael Paquier wrote:
>> On 02/11/2019 07:25 PM, Arthur Zakirov wrote:
>>> Grigory noticed that one of our utilities has very slow performance when
>>> xlogreader reads zlib archives. We found out that xlogreader sometimes
>>> reads a WAL file block twice.
>>>
>>> What do you think?
> 
> I think that such things, even if they look simple, need a careful
> lookup, and I have not looked at the proposal yet.  Could you add it
> to the next commit fest so as we don't lose track of it?
> https://commitfest.postgresql.org/22/

Of course. Agree, it may be a non trivial case. Added as a bug fix:
https://commitfest.postgresql.org/22/1994/

-- 
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company


Commits

  1. Avoid some unnecessary block reads in WAL reader

  2. Split out XLog reading as an independent facility

  3. Make standby server continuously retry restoring the next WAL segment with