Re: [HACKERS] logical decoding of two-phase transactions

Поиск
Список
Период
Сортировка
От Ajin Cherian
Тема Re: [HACKERS] logical decoding of two-phase transactions
Дата
Msg-id CAFPTHDZyffPtB4McWf8VU2of2C3qEKwJdzkKCm54=cUu_ZWZuw@mail.gmail.com
обсуждение исходный текст
Ответ на RE: [HACKERS] logical decoding of two-phase transactions  ("tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>)
Ответы RE: [HACKERS] logical decoding of two-phase transactions  ("tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>)
Список pgsql-hackers
On Fri, Jul 2, 2021 at 8:18 PM tanghy.fnst@fujitsu.com
<tanghy.fnst@fujitsu.com> wrote:
>
> Thanks for your patch. I met an issue while using it. When a transaction contains TRUNCATE, the subscriber reported
anerror: " ERROR:  no data left in message" and the data couldn't be replicated. 
>
> Steps to reproduce the issue:
>
> (set logical_decoding_work_mem to 64kB at publisher so that streaming could work. )
>
> ------publisher------
> create table test (a int primary key, b varchar);
> create publication pub for table test;
>
> ------subscriber------
> create table test (a int primary key, b varchar);
> create subscription sub connection 'dbname=postgres' publication pub with(two_phase=on, streaming=on);
>
> ------publisher------
> BEGIN;
> TRUNCATE test;
> INSERT INTO test SELECT i, md5(i::text) FROM generate_series(1001, 6000) s(i);
> UPDATE test SET b = md5(b) WHERE mod(a,2) = 0;
> DELETE FROM test WHERE mod(a,3) = 0;
> COMMIT;
>
> The above case worked ok when remove 0004 patch, so I think it’s a problem of 0004 patch. Please have a look.

thanks for the test!
I hadn't updated the case where sending schema across was the first
change of the transaction as part of the decoding of the
truncate command. In this test case, the schema was sent across
without the stream start, hence the error on the apply worker.
I have updated with a fix. Please do a test and confirm.

regards,
Ajin Cherian
Fujitsu Australia

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: ECPG doesn't compile CREATE AS EXECUTE properly.
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: [PATCH] Use optimized single-datum tuplesort in ExecSort