pgsql: Clear the local map when not used.

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Clear the local map when not used.
Date: 2019-03-01 02:12:32
Message-ID: E1gzXf6-0008RG-Ae@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clear the local map when not used.

After commit b0eaa4c51b, we use a local map of pages to find the required
space for small relations. We do clear this map when we have found a block
with enough free space, when we extend the relation, or on transaction
abort so that it can be used next time. However, we miss to clear it when
we didn't find any pages to try from the map which leads to an assertion
failure when we later tried to use it after relation extension.

In the passing, I have improved some comments in this area.

Reported-by: Tom Lane based on buildfarm results
Author: Amit Kapila
Reviewed-by: John Naylor
Tested-by: Kuntal Ghosh
Discussion: https://postgr.es/m/32368.1551114120@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c32e4c35026bd52aaf340bfe7594abc653e42f0

Modified Files
--------------
src/backend/access/heap/hio.c | 5 +----
src/backend/storage/freespace/freespace.c | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2019-03-01 02:19:46 Re: pgsql: Avoid creation of the free space map for small heap relations, t
Previous Message Michael Paquier 2019-03-01 00:16:44 pgsql: Make pg_partition_tree return no rows on unsupported and undefin