Re: [GENERAL] huge RAM use in multi-command ALTER of table heirarchy

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] huge RAM use in multi-command ALTER of table heirarchy
Date: 2017-07-21 14:39:42
Message-ID: CAM-w4HML0Vd1Us845UK4K38F_sncDbMk_Jpk4-k1nwtmM59zqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 20 July 2017 at 14:19, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Greg Stark <stark(at)mit(dot)edu> writes:
>
>> Would it be useful to keep in one of the memory checking assertion builds?
>
> Why? Code that expects to continue accessing a relcache entry's tupdesc
> after closing the relcache entry is broken, independently of whether it's
> in a debug build or not.

Mea Culpa. I hadn't actually read the code and assumed it would be
sensible to change from something that freed these tupdescs into
something that raised an assertion if they were still unfreed at end
of transaction.

Reading the code I see that it's only there to *avoid* freeing the
tupledesc just in case there's something still using it. If we just
free it then the normal memory checking builds would catch cases where
they're used after being freed.

But what I still don't understand is whether the fact that it still
passes the regression tests means anything. Unless there happened to
be a sinval message at the wrong time the regression tests wouldn't
uncover any problem cases. If it passed the tests on a
CLOBBER_CACHE_ALWAYS build then perhaps that would prove it's safe? Or
perhaps if the columns haven't actually been altered it would still
fail to fail?

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2017-07-21 15:49:01 Re: Backward compatibility
Previous Message Jordan Gigov 2017-07-21 14:25:00 Re: pg_restore misuse or bug?

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-07-21 15:10:52 Re: [PATCH] A hook for session start
Previous Message Marina Polyakova 2017-07-21 14:39:00 Re: WIP Patch: Precalculate stable functions, infrastructure v1