Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Avoid call MaintainOldSnapshotTimeMapping, if old_snapshot_threshold is disabled.
Date: 2021-06-18 00:27:15
Message-ID: CAEudQAr9PuiReWPxzTZ=kCzvOx2AmV7kS+Cs1CKvx+RB99Vj6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
avoid_call_if_old_snapshot_threshold_is_disabled.patch application/octet-stream 770 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-06-18 00:30:49 Re: pgbench logging broken by time logic changes
Previous Message Jeff Davis 2021-06-17 23:37:51 Re: Replication protocol doc fix