Re: dsa_allocate() faliure

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jakub Glapa <jakub(dot)glapa(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Fabio Isabettini <fisabettini(at)voipfuture(dot)com>, Arne Roland <A(dot)Roland(at)index(dot)de>, Sand Stone <sand(dot)m(dot)stone(at)gmail(dot)com>, Rick Otten <rottenwindfish(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: dsa_allocate() faliure
Date: 2019-02-09 20:24:53
Message-ID: CAEepm=0m9PMTe3_+evvgOQPPxP1=hYNNoSdbE1o2FnqCqrFBwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On Sat, Feb 9, 2019 at 9:21 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Feb 8, 2019 at 8:00 AM Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> > Sometimes FreeManagerPutInternal() returns a
> > number-of-contiguous-pages-created-by-this-insertion that is too large
> > by one. [...]
>
> I spent a long time thinking about this and starting at code this
> afternoon, but I didn't really come up with much of anything useful.
> It seems like a strange failure mode, because
> FreePageManagerPutInternal() normally just returns its third argument
> unmodified. [...]

Bleugh. Yeah. What I said before wasn't quite right. The value
returned by FreePageManagerPutInternal() is actually correct at the
moment it is returned, but it ceases to be correct immediately
afterwards if the following call to FreePageBtreeCleanup() happens to
reduce the size of that particular span. The problem is that we
clobber fpm->contiguous_pages with the earlier (and by now incorrect)
value that we were holding in a local variable.

--
Thomas Munro
http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-02-09 20:26:55 Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages)
Previous Message Alvaro Herrera 2019-02-09 18:56:46 Re: Fixing findDependentObjects()'s dependency on scan order (regressions in DROP diagnostic messages)

Browse pgsql-performance by date

  From Date Subject
Next Message Thomas Munro 2019-02-09 21:06:30 Re: dsa_allocate() faliure
Previous Message Andres Freund 2019-02-09 20:23:14 Re: slow to run query 5000 times