Re: [COMMITTERS] pgsql: Prevent "snapshot too old" from trying to return pruned TOAST tu

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Prevent "snapshot too old" from trying to return pruned TOAST tu
Date: 2016-08-05 03:59:06
Message-ID: CA+TgmoanNM+XuW+qxxhgakm19hEGoTFU8cbfi626u8agQkp4ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Thu, Aug 4, 2016 at 10:58 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Aug 4, 2016 at 7:23 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Robert Haas <rhaas(at)postgresql(dot)org> writes:
>>> Prevent "snapshot too old" from trying to return pruned TOAST tuples.
>>
>> Looks like this patch broke the build on castoroides. Recommend
>> changing InitToastSnapshot into a macro. (There's a reason why
>> InitDirtySnapshot is a macro.)
>
> What is the reason? We refuse to separate frontend and backend
> headers in any sort of principled way?

That was poorly phrased. I'll try again: I can't see any reason for
using a macro here except that it allows frontend code to compile this
without breaking. But that doesn't seem like a very good way of
solving that problem. There's surely no way for a casual reader of
the code to realize that macros can be used here and inline functions
cannot, especially because this works apparently works fine on most
machines, including mine.

Here's a patch. Is this what you want?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
init-toast-snapshot-macro-v1.patch text/x-patch 1.3 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-08-05 15:05:31 Re: Re: [COMMITTERS] pgsql: Prevent "snapshot too old" from trying to return pruned TOAST tu
Previous Message Andres Freund 2016-08-05 03:10:35 pgsql: Fix hard to hit race condition in heapam's tuple locking code.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-08-05 04:12:41 Re: Detecting skipped data from logical slots (data silently skipped)
Previous Message Claudio Freire 2016-08-05 03:59:01 Re: Heap WARM Tuples - Design Draft