Re: [PATCH v12] GSSAPI encryption support

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robbie Harwood <rharwood(at)redhat(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: [PATCH v12] GSSAPI encryption support
Date: 2016-04-05 18:43:46
Message-ID: 20160405184346.GA317471@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robbie Harwood wrote:
> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
>
> > On Tue, Apr 5, 2016 at 9:06 AM, Robbie Harwood <rharwood(at)redhat(dot)com> wrote:
> >> Here's v12, both here and on my github:
> >> https://github.com/frozencemetery/postgres/tree/feature/gssencrypt12

> > So you are saving everything in the top memory context. I am fine to
> > give the last word to a committer here but I would just go with
> > calloc/free to simplify those hunks.
>
> Yeah, it's definitely worth thinking/talking about; this came up in IRC
> discussion as well.
>
> If we go the memory context route, it has to be TopMemoryContext since
> nothing else lives long enough (i.e., entire connection).
[...]
> It turns out that's not actually required, but could easily be made
> explicit here. According to the README for the memory context system,
> pfree() and repalloc() do not require setting CurrentMemoryContext
> (since 7.1).

It seems to me that the right solution for this is to create a new
memory context which is a direct child of TopMemoryContext, so that
palloc can be used, and so that it can be reset separately, and that it
doesn't suffer from resets of other contexts. (I think Michael's point
is that if those chunks were it a context of their own, you wouldn't
need the pfrees but a MemCxtReset would be enough.)

> Side note: it's really irritating to work with having this file under
> version control because of how different it ends up being when I
> autoreconf (which I need to do because I'm changing the build system).
> (I'm also idly curious what system/autotools version is generating this
> file because it doesn't match any that I tried.)

We use stock autoconf from the GNU package and it definitely produces
matching output for me. Maybe your Linux distro includes a patched
version? I know Debian does, but I suppose you're using some Redhat
thing, so no idea.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-04-05 18:52:51 Re: Combining Aggregates
Previous Message Robert Haas 2016-04-05 18:37:25 Re: Move PinBuffer and UnpinBuffer to atomics