Re: Reaping Temp tables to avoid XID wraparound

From: James Sewell <james(dot)sewell(at)jirotech(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reaping Temp tables to avoid XID wraparound
Date: 2019-02-18 23:52:54
Message-ID: CAANVwEvJUpqibNisD_3ebUapdG1AXp8cAkbECMM-8T3mDBjO+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 18 Feb 2019 at 12:31, Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Sun, Feb 17, 2019 at 05:47:09PM +0100, Magnus Hagander wrote:
> > We could I guess add a field specifically for temp_namespace_xid or such.
> > The question is if it's worth the overhead to do that.
>
> That would mean an extra 4 bytes in PGPROC, which is something we
> could live with, still the use-case looks rather narrow to me to
> justify that.
>

I agree the use case is narrow - but it's also pretty critical.

This is a very real way that transaction wraparound can be hit, with no
automated or manual way of solving it (apart from randomly terminating
backends (you have to search via user and hope there is only one, and that
it matches the temp table owner) or restarting Postgres).

I suppose an in-core way of disconnecting idle sessions after x time would
work too - but that seems like a sledgehammer approach.

--
James

--
The contents of this email are confidential and may be subject to legal or
professional privilege and copyright. No representation is made that this
email is free of viruses or other defects. If you have received this
communication in error, you may not copy or distribute any part of it or
otherwise disclose its contents to anyone. Please advise the sender of your
incorrect receipt of this correspondence.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-02-18 23:56:06 Re: Speed up transaction completion faster after many relations are accessed in a transaction
Previous Message David Rowley 2019-02-18 23:52:08 Re: Speed up transaction completion faster after many relations are accessed in a transaction