From: anderson <anderson2013@qq.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: [BUG] pg9.4.10 Logical decoding did not get the correct oldtuplelen
Date: Wed, 28 Dec 2016 19:24:37 +0800
Message-ID: <tencent_1A1874C7764607C864FBC7A9@qq.com> (raw)
In-Reply-To: <CAB7nPqR5+3gLAedjfDVUQPGz-SBwtOwNn6QMPkecVud7pg=NgQ@mail.gmail.com>
References: <tencent_5B4204547B0BB8C05F9B1D99@qq.com>
<CAB7nPqR5+3gLAedjfDVUQPGz-SBwtOwNn6QMPkecVud7pg=NgQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
yes i can.
reproduce the step:
1. create table testcase(a int,b int,c text,d text);
2. ALTER TABLE ONLY testcase REPLICA IDENTITY FULL;
3. /u01/pgsql/bin/psql -d postgres -p5559 -c "copy testcase from ‘/tmp/testcase.csv' DELIMITER E'\t' csv QUOTE '''' ";
4. select pg_create_logical_replication_slot('logical_slot','test_decoding');
--update one row
5. update testcase set b = 1;
6. select count(*) from pg_logical_slot_peek_binary_changes('logical_slot',NULL,NULL);
7. postgres=# select count(*) from pg_logical_slot_peek_binary_changes('logical_slot',NULL,NULL);
ERROR: compressed data is corrupt
------------------ 原始邮件 ------------------
发件人: "Michael Paquier";<michael.paquier@gmail.com>;
发送时间: 2016年12月27日(星期二) 中午1:29
收件人: "anderson"<anderson2013@qq.com>;
抄送: "pgsql-bugs"<pgsql-bugs@postgresql.org>;
主题: Re: [BUGS] [BUG] pg9.4.10 Logical decoding did not get the correct oldtuplelen
On Tue, Dec 27, 2016 at 12:30 PM, anderson <anderson2013@qq.com> wrote:
> I found a postgresql 9.4.10 Logical decoding problem
> heapam.c:6976 xlog store incorrect oldtuplen when tuplelen is greater than
> the value field of uint16.
>
> a uint32 variable is assigned to uint16
>
> The structure that holds the oldkey length is:
> typedef struct xl_heap_header_len
> {
> uint16 t_len;
> xl_heap_header header;
> } xl_heap_header_len;
>
> The problem will lead to logic decoding failure when oldtuplene > 65535 and
> relreplident = FULL.
> The table that triggers the problem is usually relreplident = FULL.
Do you have a test case able to reproduce the problem?
--
Michael
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: anderson2013@qq.com, michael.paquier@gmail.com
Subject: Re: [BUG] pg9.4.10 Logical decoding did not get the correct oldtuplelen
In-Reply-To: <tencent_1A1874C7764607C864FBC7A9@qq.com>
References: <tencent_5B4204547B0BB8C05F9B1D99@qq.com> <CAB7nPqR5+3gLAedjfDVUQPGz-SBwtOwNn6QMPkecVud7pg=NgQ@mail.gmail.com> <tencent_1A1874C7764607C864FBC7A9@qq.com>
* 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