pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Fujii Masao <masao.fujii@gmail.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-committers <pgsql-committers@postgresql.org>
Subject: Re: pgsql: Generic Messages for Logical Decoding
Date: Wed, 06 Apr 2016 17:06:25 +0200
Message-ID: <F6638F7F-4DBD-4776-917E-8B27939174ED@anarazel.de> (raw)
In-Reply-To: <CAHGQGwF3X1v5u8x+Nz_U5Ae_HJDpjGZVa9PXBw7LXQq7pwdeMA@mail.gmail.com>
References: <E1anjRj-0000Nn-S3@gemulon.postgresql.org>
	<CAHGQGwF3X1v5u8x+Nz_U5Ae_HJDpjGZVa9PXBw7LXQq7pwdeMA@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>



On April 6, 2016 5:00:54 PM GMT+02:00, Fujii Masao <masao.fujii@gmail.com> wrote:
>On Wed, Apr 6, 2016 at 6:08 PM, Simon Riggs <simon@2ndquadrant.com>
>wrote:
>> Generic Messages for Logical Decoding
>>
>> API and mechanism to allow generic messages to be inserted into WAL
>that are
>> intended to be read by logical decoding plugins. This commit adds an
>optional
>> new callback to the logical decoding API.
>
>When I specify very long text message, pg_xlogdump failed to dump
>correctly the WAL file which should contain that inserted text message.
>Isn't this a bug?
>
>You can reproduce the problem by the following steps.
>
>=# SELECT pg_xlogfile_name(pg_switch_xlog());
>     pg_xlogfile_name
>--------------------------
> 000000010000000000000003
>(1 row)
>
>=# SELECT pg_xlogfile_name(pg_current_xlog_location());
>     pg_xlogfile_name
>--------------------------
> 000000010000000000000003
>(1 row)
>
>=# SELECT pg_logical_emit_message(true, 'test',
>repeat('0123456789ABCDEFG', 1024*1024));
> pg_logical_emit_message
>-------------------------
> 0/510CD40
>(1 row)
>
>=# SELECT pg_xlogfile_name(pg_current_xlog_location());
>     pg_xlogfile_name
>--------------------------
> 000000010000000000000005
>(1 row)
>
>=# insert into t values(0,0);
>INSERT 0 1
>postgres=# SELECT pg_xlogfile_name(pg_current_xlog_location());
>     pg_xlogfile_name
>--------------------------
> 000000010000000000000005
>(1 row)
>
>The WAL record of pg_logical_emit_message() should be stored in
>000000010000000000000004 and 000000010000000000000005.
>The WAL record of last insertion should be stored in
>000000010000000000000005.
>But the results of pg_xlogdump were wrong as follows.
>
>$ pg_xlogdump data/pg_xlog/000000010000000000000004
>rmgr: Standby     len (rec/tot):     24/    50, tx:          0, lsn:
>0/04000028, prev 0/030146F8, desc: RUNNING_XACTS nextXid 863
>latestCompletedXid 862 oldestRunningXid 863
>
>$ pg_xlogdump data/pg_xlog/000000010000000000000005
>pg_xlogdump: FATAL:  could not find a valid record after 0/5000000

If you specify a file it only looks at records in that file. Try with -s.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (9+ messages)  latest in thread

Message-ID: <F6638F7F-4DBD-4776-917E-8B27939174ED@anarazel.de>
Permalink:  ../F6638F7F-4DBD-4776-917E-8B27939174ED@anarazel.de/
Also on:    postgresql.org/message-id/F6638F7F-4DBD-4776-917E-8B27939174ED@anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, masao.fujii@gmail.com, simon@2ndquadrant.com
  Subject: Re: pgsql: Generic Messages for Logical Decoding
  In-Reply-To: <F6638F7F-4DBD-4776-917E-8B27939174ED@anarazel.de>
  References: <E1anjRj-0000Nn-S3@gemulon.postgresql.org> <CAHGQGwF3X1v5u8x+Nz_U5Ae_HJDpjGZVa9PXBw7LXQq7pwdeMA@mail.gmail.com> <F6638F7F-4DBD-4776-917E-8B27939174ED@anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox