Ignore heap rewrites for materialized views in logical replication

Поиск
Список
Период
Сортировка
От Euler Taveira
Тема Ignore heap rewrites for materialized views in logical replication
Дата
Msg-id bc557ebe-92dc-4afa-b6bb-285a9eeaa614@www.fastmail.com
обсуждение исходный текст
Ответы Re: Ignore heap rewrites for materialized views in logical replication  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
Hi,

While investigating an internal report, I concluded that it is a bug. The
reproducible test case is simple (check 0002) and it consists of a FOR ALL
TABLES publication and a non-empty materialized view on publisher. After the
setup, if you refresh the MV, you got the following message on the subscriber:

ERROR:  logical replication target relation "public.pg_temp_NNNNN" does not exist

That's because the commit 1a499c2520 (that fixes the heap rewrite for tables)
forgot to consider that materialized views can also create transient heaps and
they should also be skipped. The affected version is only 10 because 11
contains a different solution (commit 325f2ec555) that provides a proper fix
for the heap rewrite handling in logical decoding.

0001 is a patch to skip MV too. I attached 0002 to demonstrate the issue but it
doesn't seem appropriate to be included. The test was written to detect the
error and bail out. After this fix, it takes a considerable amount of time to
finish the test because it waits for a message that never arrives. Since nobody
reports this bug in 5 years and considering that version 10 will be EOL in 6
months, I don't think an additional test is crucial here.


--
Euler Taveira

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Improving connection scalability (src/backend/storage/ipc/procarray.c)