Re: Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.
Дата
Msg-id 20210618010827.y7prpg6hncibxtxk@alap3.anarazel.de
обсуждение исходный текст
Ответ на Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
Hi,

On 2021-06-17 21:27:15 -0300, Ranier Vilela wrote:
> While another long thread discusses the situation of old_snapshot_threshold,
> I believe we can improve procarray.c by avoiding calling
> MaintainOldSnapshotTimeMapping (src/backend/utils/time/snapmgr.c).
> 
> There's a very explicit comment there, which says (line 1866):
> "Never call this function when old snapshot checking is disabled."
> 
> Well, assert should never be used to validate a condition that certainly
> occurs at runtime.

I don't see how it can happen at runtime currently?

> Since old_snapshot_threshold is -1, it is disabled, so
> MaintainOldSnapshotTimeMapping doesn't need to be run, right?

It *isn't* run, the caller checks OldSnapshotThresholdActive() first.

Greetings,

Andres Freund



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Centralizing protective copying of utility statements
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Outdated replication protocol error?