Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)
Дата
Msg-id CAEudQAovXyN4FwiYyKBE=pT3tu6s2Jva-Mh6pE26Xy_oXF3ycQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)  (Zhihong Yu <zyu@yugabyte.com>)
Список pgsql-hackers

Em sáb., 13 de fev. de 2021 às 01:07, Zhihong Yu <zyu@yugabyte.com> escreveu:
Hi,
How about the following patch ?

ReorderBufferSetBaseSnapshot() can return a bool to indicate whether the base snapshot is set up.

For the call by SnapBuildCommitTxn(), it seems xid is top transaction. So the return value doesn't need to be checked.
IMO anything else is better than PANIC.
Anyway, if all fails, reporting an error can contribute to checking where.

Attached a patch suggestion v2.
1. SnapBuildProcessChange returns a result of ReorderBufferSetBaseSnapshot, so the caller can act accordingly.
2. SnapBuildCommitTxn can't ignore a result from ReorderBufferSetBaseSnapshot, even if it never fails. 

regards,
Ranier Vilela
Вложения

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

Предыдущее
От: Patrick Handja
Дата:
Сообщение: How to get Relation tuples in C function
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)