From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Be smarter about age-counter overflow in formatting.c caches. |
Date: | 2018-10-16 18:57:23 |
Message-ID: | E1gCUWx-00036h-7Z@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2018-10-16 19:10:00 | pgsql: Add macro to cast away const without allowing changes to underly |
Previous Message | Tom Lane | 2018-10-16 17:57:21 | pgsql: Avoid rare race condition in privileges.sql regression test. |