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

2019-05-26 Thread Simon Riggs
On Fri, 24 May 2019 at 18:09, Andres Freund wrote: > 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

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

2019-05-24 Thread Andres Freund
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

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

2019-05-24 Thread Konstantin Knizhnik
On 24.05.2019 11:52, Simon Riggs wrote: On Fri, 24 May 2019 at 01:39, Michael Paquier > wrote: On Thu, May 23, 2019 at 08:54:59AM -0700, Andres Freund wrote: > On 2019-05-23 12:36:09 +0100, Simon Riggs wrote: >> The ONLY case where this matters is if

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

2019-05-24 Thread Simon Riggs
On Fri, 24 May 2019 at 01:39, Michael Paquier wrote: > On Thu, May 23, 2019 at 08:54:59AM -0700, Andres Freund wrote: > > On 2019-05-23 12:36:09 +0100, Simon Riggs wrote: > >> The ONLY case where this matters is if someone does a PREPARE and then > >> starts doing other work on the session.

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

2019-05-24 Thread Simon Riggs
On Thu, 23 May 2019 at 16:55, Andres Freund wrote: > Hi, > > On 2019-05-23 12:36:09 +0100, Simon Riggs wrote: > > The ONLY case where this matters is if someone does a PREPARE and then > > starts doing other work on the session. Which makes no sense in the > normal > > workflow of a session. I'm

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

2019-05-23 Thread Michael Paquier
On Thu, May 23, 2019 at 08:54:59AM -0700, Andres Freund wrote: > On 2019-05-23 12:36:09 +0100, Simon Riggs wrote: >> The ONLY case where this matters is if someone does a PREPARE and then >> starts doing other work on the session. Which makes no sense in the normal >> workflow of a session. I'm

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

2019-05-23 Thread Andres Freund
Hi, On 2019-05-23 12:36:09 +0100, Simon Riggs wrote: > The ONLY case where this matters is if someone does a PREPARE and then > starts doing other work on the session. Which makes no sense in the normal > workflow of a session. I'm sure there are tests that do that, but those > tests are

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

2019-05-23 Thread Simon Riggs
On Tue, 14 May 2019 at 10:53, Stas Kelvich wrote: > One of the problems regarding the use of temporary tables in prepared > transactions > is that such transaction will hold locks for a temporary table after being > prepared. > That locks will prevent the backend from exiting since it will fail

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

2019-05-22 Thread Stas Kelvich
> On 14 May 2019, at 12:53, Stas Kelvich wrote: > > Hi, > > That is an attempt number N+1 to relax checks for a temporary table access > in a transaction that is going to be prepared. > Konstantin Knizhnik made off-list review of this patch and spotted few problems. * Incorrect reasoning

Read-only access to temp tables for 2PC transactions

2019-05-14 Thread Stas Kelvich
Hi, That is an attempt number N+1 to relax checks for a temporary table access in a transaction that is going to be prepared. One of the problems regarding the use of temporary tables in prepared transactions is that such transaction will hold locks for a temporary table after being prepared.