Re: [PATCH] XLogReadRecord returns pointer to currently read page

From: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL-Dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] XLogReadRecord returns pointer to currently read page
Date: 2018-08-17 04:25:57
Message-ID: 0884f09b-4fe4-bd62-e624-741815e4bf15@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

17.08.2018 08:55, Michael Paquier пишет:
> On Fri, Aug 17, 2018 at 08:47:15AM +0500, Andrey Lepikhov wrote:
>> Previously, in all cases of using WAL this was not a problem. However if you
>> plan to perform some decoding operations before returning the WAL record to
>> the caller (this is my case), this can lead to bugs that are difficult to
>> catch.
>
> What kind of cases with logical decoding are you referring to? If
> any of them can be reproduced with upstream, could you send a
> reproducer, or a way to see it?
> --
> Michael
>

I'm working on the problem of a WAL-record size reducing. One of the
PostgreSQL experimental extensions uses a 64-bit xid, and the XLogRecord
size is increased to 32 bytes.
Representing a 64-bit xid in WAL Segment as a pair (16-bit base, 8-bit
offset) reduces the size of the WAL record header and its body.
So, I encode a WAL-record in XLogInsertRecord() (decreasing the size)
just before writing to a shared memory pages and performs the decoding
just before processing DecodeXLogRecord() operation.
It looks like a layer in the xlog subsystem for additional WAL
compression. However, this is a long story ...

--
Andrey Lepikhov
Postgres Professional
https://postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-08-17 04:39:11 Re: Allow COPY's 'text' format to output a header
Previous Message Michael Paquier 2018-08-17 03:55:21 Re: [PATCH] XLogReadRecord returns pointer to currently read page