Assertion failure in pg_copy_logical_replication_slot()

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Assertion failure in pg_copy_logical_replication_slot()
Дата
Msg-id f91de4fb-a7ab-b90e-8132-74796e049d51@oss.nttdata.com
обсуждение исходный текст
Ответы Re: Assertion failure in pg_copy_logical_replication_slot()  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re: Assertion failure in pg_copy_logical_replication_slot()  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi,

If restart_lsn of logical replication slot gets behind more than
max_slot_wal_keep_size from the current LSN, the logical replication
slot would be invalidated and its restart_lsn is reset to an invalid LSN.
If this logical replication slot with an invalid restart_lsn is specified
as the source slot in pg_copy_logical_replication_slot(), the function
causes the following assertion failure.

     TRAP: FailedAssertion("!logical_slot", File: "slotfuncs.c", Line: 727)

This assertion failure is caused by

    /* Copying non-reserved slot doesn't make sense */
    if (XLogRecPtrIsInvalid(src_restart_lsn))
        ereport(ERROR,
                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                 errmsg("cannot copy a replication slot that doesn't reserve WAL")));

I *guess* this assertion check was added because restart_lsn should
not be invalid before. But in v13, it can be invalid thanks to max_slot_wal_keep_size.
I think that this assertion check seems useless and should be removed in v13.
Patch attached. Thought?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Default setting for enable_hashagg_disk
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: suggest to rename enable_incrementalsort