Re: pgsql: Add support for multivariate MCV lists

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Add support for multivariate MCV lists
Date: 2019-03-28 19:37:11
Message-ID: 20190328193711.GC16397@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, Mar 28, 2019 at 07:33:36PM +0100, Tomas Vondra wrote:
>On Thu, Mar 28, 2019 at 11:29:12AM -0700, Peter Geoghegan wrote:
>>On Wed, Mar 27, 2019 at 6:27 PM Tomas Vondra
>><tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
>>>It's a bit too late for pushing emergency fixes over here, so I'll do
>>>more testing tomorrow and then push.
>>
>>The buildfarm is still almost all-red now. Can you estimate how long
>>it will take to push a fix?
>>
>
>Half an hour, at most. I have a fix and I'm running tests on it to make
>sure it does break something else.
>

OK, I've pushed the fix. As explained in the commit message, the
deserialization was borked in two ways. Firstly, it was vulnerable to
use-after-free. Secondly, the serialization/deserialization of data for
by-value types did not work for bigendian systems.

I believe this should fix prion (which was tripping on the first issue,
due to using -DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE) and at
least some of the bigendian boxes (I've tested it on s390x).

I do think there's one remaining issue - the deserialized value is
allocated as a single chunk, and is then "sliced" into smaller buffers.
But the code ignores alignment, which I think may trigger SIGBUS on some
platforms - for example grison, skate or gull fail like this, and those
are ARMv7 and sparc machines.

I do have a fix for that too, but I decided not to push it yet before
testing it a bit more.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2019-03-28 20:42:59 pgsql: Fix a few comment copy & pastos.
Previous Message Tomas Vondra 2019-03-28 19:22:43 pgsql: Fix deserialization of pg_mcv_list values