Re: vacuum vs heap_update_tuple() and multixactids

2017-12-21 Thread Amit Kapila
On Wed, Dec 20, 2017 at 12:12 AM, Andres Freund wrote: > On 2017-12-19 15:35:12 -0300, Alvaro Herrera wrote: >> Andres Freund wrote: >> >> > I think the bugfix is going to have to essentially be something similar >> > to FreezeMultiXactId(). I.e. when reusing an old tuple's xmax for a new >> > tup

Re: vacuum vs heap_update_tuple() and multixactids

2017-12-20 Thread Robert Haas
On Wed, Dec 20, 2017 at 9:05 AM, Andres Freund wrote: > Indeed. I kinda wonder whether we hackishly solve this by simply > returning true fore all pids if it's waiting for a cleanup lock. That's > not actually that far from the truth... The big problem with that I see > is very short waits that re

Re: vacuum vs heap_update_tuple() and multixactids

2017-12-20 Thread Andres Freund
Hi, On 2017-12-19 15:01:03 -0500, Robert Haas wrote: > On Tue, Dec 19, 2017 at 1:31 PM, Andres Freund wrote: > > Could I perhaps convince somebody to add that as a feature to > > isolationtester? I'm willing to work on a bugfix for the bug itself, but > > I've already spent tremendous amounts of

Re: vacuum vs heap_update_tuple() and multixactids

2017-12-19 Thread Robert Haas
On Tue, Dec 19, 2017 at 1:31 PM, Andres Freund wrote: > Could I perhaps convince somebody to add that as a feature to > isolationtester? I'm willing to work on a bugfix for the bug itself, but > I've already spent tremendous amounts of time, energy and pain on > multixact bugs, and I'm at the mome

Re: vacuum vs heap_update_tuple() and multixactids

2017-12-19 Thread Andres Freund
On 2017-12-19 15:35:12 -0300, Alvaro Herrera wrote: > Andres Freund wrote: > > > I think the bugfix is going to have to essentially be something similar > > to FreezeMultiXactId(). I.e. when reusing an old tuple's xmax for a new > > tuple version, we need to prune dead multixact members. I think w

Re: vacuum vs heap_update_tuple() and multixactids

2017-12-19 Thread Alvaro Herrera
Andres Freund wrote: > I think the bugfix is going to have to essentially be something similar > to FreezeMultiXactId(). I.e. when reusing an old tuple's xmax for a new > tuple version, we need to prune dead multixact members. I think we can > do so unconditionally and rely on multixact id caching

vacuum vs heap_update_tuple() and multixactids

2017-12-19 Thread Andres Freund
Hi, In [1] I'd discovered a only mildly related bug while reading code to make sure my fix [2] et al was correct. Quoting a couple messages by myself: > Staring at the vacuumlazy hunk I think I might have found a related bug: > heap_update_tuple() just copies the old xmax to the new tuple's xmax