Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled. - Mailing list pgsql-hackers

From Ranier Vilela
Subject Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.
Date
Msg-id CAEudQAr9PuiReWPxzTZ=kCzvOx2AmV7kS+Cs1CKvx+RB99Vj6Q@mail.gmail.com
Whole thread Raw
Responses Re: Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

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.

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

regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Replication protocol doc fix
Next
From: Michael Paquier
Date:
Subject: Re: pgbench logging broken by time logic changes