Re: Read-only access to temp tables for 2PC transactions

From: Andres Freund <andres(at)anarazel(dot)de>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Stas Kelvich <s(dot)kelvich(at)postgrespro(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Read-only access to temp tables for 2PC transactions
Date: 2019-05-24 17:09:21
Message-ID: 20190524170921.xzrofve2jh5zyfwx@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-05-24 19:37:15 +0300, Konstantin Knizhnik wrote:
> From my point of view releasing all temporary table locks after preparing of
> 2PC transaction is not technically possible:
> assume that this transaction has  updated some tuples of temporary table - them
> are not visible to other transactions until 2PC is committed,
> but since lock is removed, other transactions can update the same tuple.

I don't think tuple level actions are the problem? Those doesn't require
table level locks to be held.

Generally, I fail to see how locks themselves are the problem. The
problem are the catalog entries for the temp table, the relation forks,
and the fact that a session basically couldn't drop (and if created in
that transaction, use) etc the temp table after the PREPARE.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2019-05-24 17:12:13 Re: [HACKERS] proposal: schema variables
Previous Message Joe Conway 2019-05-24 16:54:46 Re: Excessive memory usage in multi-statement queries w/ partitioning