pgsql: Add a few entries to the tail of time mapping, to see old values

From: Kevin Grittner <kgrittn(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add a few entries to the tail of time mapping, to see old values
Date: 2016-04-29 21:57:13
Message-ID: E1awGPR-000376-5G@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add a few entries to the tail of time mapping, to see old values.

Without a few entries beyond old_snapshot_threshold, the lookup
would often fail, resulting in the more aggressive pruning or
vacuum being skipped often enough to matter. This was very clearly
shown by a python test script posted by Ants Aasma, and was likely
a factor in an earlier but somewhat less clear-cut test case posted
by Jeff Janes.

This patch makes no change to the logic, per se -- it just makes
the array of mapping entries big enough to make lookup misses based
on timing much less likely. An occasional miss is still possible
if a thread stalls for more than 10 minutes, but that does not
create any problem with correctness of behavior. Besides, if
things are so busy that a thread is stalling for more than 10
minutes, it is probably OK to skip the more aggressive cleanup at
that particular point in time.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7c3e8039f450eb99b3a73272d0a1661195747d1b

Modified Files
--------------
src/backend/utils/time/snapmgr.c | 26 +++++++++++++-------------
src/include/utils/snapmgr.h | 13 +++++++++++++
2 files changed, 26 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Kevin Grittner 2016-04-29 22:08:49 Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Previous Message Alvaro Herrera 2016-04-29 21:23:40 Re: [COMMITTERS] pgsql: Support building with Visual Studio 2015