Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-22 Thread Craig Ringer
On 23 January 2017 at 12:34, Craig Ringer wrote: > On 20 January 2017 at 21:40, Alvaro Herrera wrote: > >> One option would be to add another limit Xid which advances before the >> truncation but which is not used for other decisions other than limiting >> what can users consult. > > This could b

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-22 Thread Craig Ringer
On 20 January 2017 at 21:40, Alvaro Herrera wrote: > One option would be to add another limit Xid which advances before the > truncation but which is not used for other decisions other than limiting > what can users consult. This could be useful for other things, but it's probably heavier than n

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-22 Thread Craig Ringer
On 20 January 2017 at 05:32, Peter Eisentraut wrote: > On 1/19/17 10:06 AM, Alvaro Herrera wrote: >>> Also, I wonder whether we should not in vacuum.c change the order of the >>> calls of SetTransactionIdLimit() and SetMultiXactIdLimit() as well, just >>> to keep everything consistent. >> >> I am

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-20 Thread Alvaro Herrera
Peter Eisentraut wrote: > On 1/19/17 10:06 AM, Alvaro Herrera wrote: > >> Also, I wonder whether we should not in vacuum.c change the order of the > >> calls of SetTransactionIdLimit() and SetMultiXactIdLimit() as well, just > >> to keep everything consistent. > > > > I am wary of doing that. The

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-19 Thread Peter Eisentraut
On 1/19/17 10:06 AM, Alvaro Herrera wrote: >> Also, I wonder whether we should not in vacuum.c change the order of the >> calls of SetTransactionIdLimit() and SetMultiXactIdLimit() as well, just >> to keep everything consistent. > > I am wary of doing that. The current coding is well battle-teste

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-19 Thread Alvaro Herrera
Peter Eisentraut wrote: > On 12/29/16 4:28 AM, Craig Ringer wrote: > > On 29 December 2016 at 16:51, Craig Ringer wrote: > >> On 28 December 2016 at 22:16, Petr Jelinek > >> wrote: > >> > >>> About the patch, it looks good to me for master with the minor exception > >>> that: > +

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-19 Thread Alvaro Herrera
Robert Haas wrote: > On Thu, Jan 19, 2017 at 10:06 AM, Alvaro Herrera > wrote: > > Peter Eisentraut wrote: > > > >> Also, I wonder whether we should not in vacuum.c change the order of the > >> calls of SetTransactionIdLimit() and SetMultiXactIdLimit() as well, just > >> to keep everything consist

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-19 Thread Robert Haas
On Thu, Jan 19, 2017 at 10:06 AM, Alvaro Herrera wrote: > Peter Eisentraut wrote: > >> Also, I wonder whether we should not in vacuum.c change the order of the >> calls of SetTransactionIdLimit() and SetMultiXactIdLimit() as well, just >> to keep everything consistent. > > I am wary of doing that.

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-19 Thread Alvaro Herrera
Peter Eisentraut wrote: > Also, I wonder whether we should not in vacuum.c change the order of the > calls of SetTransactionIdLimit() and SetMultiXactIdLimit() as well, just > to keep everything consistent. I am wary of doing that. The current coding is well battle-tested by now, but doing thing

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2017-01-12 Thread Peter Eisentraut
On 12/29/16 4:28 AM, Craig Ringer wrote: > On 29 December 2016 at 16:51, Craig Ringer wrote: >> On 28 December 2016 at 22:16, Petr Jelinek >> wrote: >> >>> About the patch, it looks good to me for master with the minor exception >>> that: + appendStringInfo(buf, "pageno %d, xid

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2016-12-29 Thread Craig Ringer
On 29 December 2016 at 16:51, Craig Ringer wrote: > On 28 December 2016 at 22:16, Petr Jelinek > wrote: > >> About the patch, it looks good to me for master with the minor exception >> that: >>> + appendStringInfo(buf, "pageno %d, xid %u", >>> + trunc.pageno, trun

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2016-12-29 Thread Craig Ringer
On 28 December 2016 at 22:16, Petr Jelinek wrote: > About the patch, it looks good to me for master with the minor exception > that: >> + appendStringInfo(buf, "pageno %d, xid %u", >> + trunc.pageno, trunc.oldestXid); > > This should probably say oldestXid instead

Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vs lookups

2016-12-28 Thread Petr Jelinek
On 28/12/16 15:01, Craig Ringer wrote: > Hi all > > There's a minor race between commit_ts SLRU truncation and concurrent > commit_ts lookups, where a lookup can check the lower valid bound xid > without knowing it's already been truncated away. This would result in > a SLRU lookup error. > > It'