From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Be smarter about age-counter overflow in formatting.c caches.
Date: Tue, 16 Oct 2018 18:57:23 +0000
Message-ID: <E1gCUWx-00036h-7Z@gemulon.postgresql.org> (raw)
Be smarter about age-counter overflow in formatting.c caches.
The previous code here simply threw away whatever it knew about cache
entry ages whenever a counter overflow occurred. Since the counter
is int width and will be bumped once per format function execution,
overflows are not really so rare as to not be worth thinking about.
Instead, let's deal with the situation by halving all the age values,
essentially rescaling the age metric. In that way, we retain a
pretty accurate (if not quite perfect) idea of which entries are oldest.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2c300c680767a45450bf7afa4075095f40502dc4
Modified Files
--------------
src/backend/utils/adt/formatting.c | 70 +++++++++++++++++++++-----------------
1 file changed, 38 insertions(+), 32 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Be smarter about age-counter overflow in formatting.c caches.
In-Reply-To: <E1gCUWx-00036h-7Z@gemulon.postgresql.org>
References: <E1gCUWx-00036h-7Z@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox