Fix for segfault in logical replication on master

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Fix for segfault in logical replication on master
Дата
Msg-id 4C99A862-69C8-431F-960A-81B1151F1B89@enterprisedb.com
обсуждение исходный текст
Ответы RE: Fix for segfault in logical replication on master  ("osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>)
Список pgsql-hackers
Hi Amit,

In commit e7eea52b2d, you introduced a new function, RelationGetIdentityKeyBitmap(), which uses some odd logic for
determiningif a relation has a replica identity index.  That code segfaults under certain conditions.  A test case to
demonstratethat is attached.  Prior to patching the code, this new test gets stuck waiting for replication to finish,
whichnever happens.  You have to break out of the test and check tmp_check/log/021_no_replica_identity_publisher.log. 

I believe this bit of logic in src/backend/utils/cache/relcache.c:

      indexDesc = RelationIdGetRelation(relation->rd_replidindex);
      for (i = 0; i < indexDesc->rd_index->indnatts; i++)

is unsafe without further checks, also attached.

Would you mind taking a look?



—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




Вложения

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: Skip partition tuple routing with constant partition key
Следующее
От: Zhihong Yu
Дата:
Сообщение: Re: Skip partition tuple routing with constant partition key