Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2020-01-27 Thread Ashwin Agrawal
On Mon, Jan 27, 2020 at 4:47 PM Thomas Munro wrote: > OK, I kept only the small comment change from that little fixup patch, > and pushed this. > > > I had proposed as alternative way in initial email and also later, > > didn't receive comment on that, so re-posting. > > > typedef bool

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2020-01-27 Thread Thomas Munro
On Wed, Nov 13, 2019 at 7:27 PM Ashwin Agrawal wrote: > On Sun, Nov 10, 2019 at 8:21 PM Thomas Munro wrote: >> but on another read-through of the main patch >> I didn't like the comments for CheckForSerializableConflictOut() or >> the fact that it checks SerializationNeededForRead() again, after

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-11-12 Thread Ashwin Agrawal
On Sun, Nov 10, 2019 at 8:21 PM Thomas Munro wrote: > I pushed the first two, Thank You! but on another read-through of the main patch > I didn't like the comments for CheckForSerializableConflictOut() or > the fact that it checks SerializationNeededForRead() again, after I > thought a bit

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-11-10 Thread Thomas Munro
On Sat, Nov 9, 2019 at 8:41 AM Ashwin Agrawal wrote: > On Thu, Nov 7, 2019 at 8:44 PM Thomas Munro wrote: >> I'm planning to commit these three patches on Monday. I've attached >> versions with whitespace-only changes from pgindent, and commit >> messages lightly massaged and updated to point

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-11-08 Thread Ashwin Agrawal
On Thu, Nov 7, 2019 at 8:44 PM Thomas Munro wrote: > On Thu, Aug 8, 2019 at 6:53 AM Ashwin Agrawal wrote: > >>> - I wonder if CheckForSerializableConflictOutNeeded() shouldn't have a > >>> portion of it's code as a static inline. In particular, it's a shame > >>> that we currently perform

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-11-07 Thread Thomas Munro
On Thu, Aug 8, 2019 at 6:53 AM Ashwin Agrawal wrote: >>> - I wonder if CheckForSerializableConflictOutNeeded() shouldn't have a >>> portion of it's code as a static inline. In particular, it's a shame >>> that we currently perform external function calls at quite the >>> frequency when

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-07 Thread Ashwin Agrawal
On Fri, Aug 2, 2019 at 4:56 PM Ashwin Agrawal wrote: > > On Wed, Jul 31, 2019 at 2:06 PM Andres Freund wrote: > >> Looking at the code as of master, we currently have: >> > > Super awesome feedback and insights, thank you! > > - PredicateLockTuple() calls SubTransGetTopmostTransaction() to

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-07 Thread Heikki Linnakangas
On 06/08/2019 13:35, Thomas Munro wrote: On Tue, Aug 6, 2019 at 9:26 PM Heikki Linnakangas wrote: Attached is a patch that contains your fix.txt with the changes for clarity mentioned above, and an isolationtester test case. LGTM. Pushed, thanks! - Heikki

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-06 Thread Thomas Munro
On Tue, Aug 6, 2019 at 9:26 PM Heikki Linnakangas wrote: > I had some steam, and wrote a spec that reproduces this bug. It wasn't > actually that hard to reproduce, fortunately. Or unfortunately; people > might well be hitting it in production. I used the "freezetest.spec" > from the 2013 thread

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-06 Thread Heikki Linnakangas
On 06/08/2019 07:20, Thomas Munro wrote: On Tue, Aug 6, 2019 at 4:35 AM Andres Freund wrote: On 2019-08-05 20:58:05 +1200, Thomas Munro wrote: 1. Commit dafaa3efb75 "Implement genuine serializable isolation level." (2011) locked the root tuple, because it set t_self to *tid. Possibly due to

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-06 Thread Kuntal Ghosh
Hello Thomas, On Tue, Aug 6, 2019 at 9:50 AM Thomas Munro wrote: > > On Tue, Aug 6, 2019 at 4:35 AM Andres Freund wrote: > > On 2019-08-05 20:58:05 +1200, Thomas Munro wrote: > > > 1. Commit dafaa3efb75 "Implement genuine serializable isolation > > > level." (2011) locked the root tuple,

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-05 Thread Thomas Munro
On Tue, Aug 6, 2019 at 4:35 AM Andres Freund wrote: > On 2019-08-05 20:58:05 +1200, Thomas Munro wrote: > > 1. Commit dafaa3efb75 "Implement genuine serializable isolation > > level." (2011) locked the root tuple, because it set t_self to *tid. > > Possibly due to confusion about the effect of

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-05 Thread Andres Freund
Hi, On 2019-08-05 20:58:05 +1200, Thomas Munro wrote: > On Sat, Aug 3, 2019 at 11:56 AM Ashwin Agrawal wrote: > > On Wed, Jul 31, 2019 at 2:06 PM Andres Freund wrote: > >> I'm also a bit confused why we don't need to pass in the offset of the > >> current tuple, rather than the HOT root

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-05 Thread Thomas Munro
On Sat, Aug 3, 2019 at 11:56 AM Ashwin Agrawal wrote: > On Wed, Jul 31, 2019 at 2:06 PM Andres Freund wrote: >> I'm also a bit confused why we don't need to pass in the offset of the >> current tuple, rather than the HOT root tuple here. That's not related >> to this patch. But aren't we

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-02 Thread Ashwin Agrawal
On Wed, Jul 31, 2019 at 2:06 PM Andres Freund wrote: > Looking at the code as of master, we currently have: > Super awesome feedback and insights, thank you! - PredicateLockTuple() calls SubTransGetTopmostTransaction() to figure > out a whether the tuple has been locked by the current >

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-08-01 Thread Kuntal Ghosh
On Thu, Aug 1, 2019 at 2:36 AM Andres Freund wrote: > > > > > > > > I think the only part its doing for sub-transaction is > > > > SubTransGetTopmostTransaction(xid). If xid passed to this function is > > > > already top most transaction which is case for zheap and zedstore, then > > > > there is

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-07-31 Thread Andres Freund
Hi, On 2019-07-31 12:37:58 -0700, Ashwin Agrawal wrote: > On Wed, Jul 31, 2019 at 10:55 AM Andres Freund wrote: > > > Hi, > > > > On 2019-07-31 10:42:50 -0700, Ashwin Agrawal wrote: > > > On Tue, Jul 30, 2019 at 2:58 PM Thomas Munro > > wrote: > > > > > > > On Tue, Jun 25, 2019 at 6:02 AM

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-07-31 Thread Ashwin Agrawal
On Wed, Jul 31, 2019 at 12:37 PM Ashwin Agrawal wrote: > > On Wed, Jul 31, 2019 at 10:55 AM Andres Freund wrote: > >> Hi, >> >> On 2019-07-31 10:42:50 -0700, Ashwin Agrawal wrote: >> > On Tue, Jul 30, 2019 at 2:58 PM Thomas Munro >> wrote: >> > >> > > On Tue, Jun 25, 2019 at 6:02 AM Andres

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-07-31 Thread Ashwin Agrawal
On Wed, Jul 31, 2019 at 10:55 AM Andres Freund wrote: > Hi, > > On 2019-07-31 10:42:50 -0700, Ashwin Agrawal wrote: > > On Tue, Jul 30, 2019 at 2:58 PM Thomas Munro > wrote: > > > > > On Tue, Jun 25, 2019 at 6:02 AM Andres Freund > wrote: > > > > > - CheckForSerializableConflictOut() no more

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-07-31 Thread Andres Freund
Hi, On 2019-07-31 10:42:50 -0700, Ashwin Agrawal wrote: > On Tue, Jul 30, 2019 at 2:58 PM Thomas Munro wrote: > > > On Tue, Jun 25, 2019 at 6:02 AM Andres Freund wrote: > > > > - CheckForSerializableConflictOut() no more takes HeapTuple nor > > > > buffer, instead just takes xid. Push heap

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-07-31 Thread Andres Freund
Hi, On 2019-07-31 09:57:58 +1200, Thomas Munro wrote: > On Tue, Jun 25, 2019 at 6:02 AM Andres Freund wrote: > > Hm. I wonder if we somehow ought to generalize the granularity scheme > > for predicate locks to not be tuple/page/relation. But even if, that's > > probably a separate patch. > >

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-07-31 Thread Ashwin Agrawal
On Tue, Jul 30, 2019 at 2:58 PM Thomas Munro wrote: > On Tue, Jun 25, 2019 at 6:02 AM Andres Freund wrote: > > > - CheckForSerializableConflictOut() no more takes HeapTuple nor > > > buffer, instead just takes xid. Push heap specific parts from > > > CheckForSerializableConflictOut() into

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-07-30 Thread Thomas Munro
On Tue, Jun 25, 2019 at 6:02 AM Andres Freund wrote: > On 2019-06-24 10:41:06 -0700, Ashwin Agrawal wrote: > > Proposing following changes to make predicate locking and checking > > functions generic and remove dependency on HeapTuple and Heap AM. We > > made these changes to help with Zedstore.

Re: Remove HeapTuple and Buffer dependency for predicate locking functions

2019-06-24 Thread Andres Freund
Hi, On 2019-06-24 10:41:06 -0700, Ashwin Agrawal wrote: > Proposing following changes to make predicate locking and checking > functions generic and remove dependency on HeapTuple and Heap AM. We > made these changes to help with Zedstore. I think the changes should > help Zheap and other AMs in