Skip site navigation (1) Skip section navigation (2)

Re: Bug in autovacuum.c?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in autovacuum.c?
Date: 2011-04-01 23:04:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Robert Haas wrote:
> On Fri, Apr 1, 2011 at 5:48 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > Alvaro Herrera wrote:
> >> Excerpts from Bruce Momjian's message of vie abr 01 16:50:29 -0300 2011:
> >>
> >> > To do the right thing every computation that passes over the xid
> >> > wraparound bounary should subtract FirstNormalTransactionId, not just
> >> > those that fall in the boundry. ?That would prevent the value from going
> >> > backward and still allow the mapping you liked; ?it isn't worth it, but
> >> > that is the right answer.
> >>
> >> This code is only concerned calculating an immediate the wrap horizon
> >> for the autovacuuming run that's about to take place. ?If it's wrong in
> >> one or three counts doesn't mean much. ?Consider what would happen if
> >> load was high and it would have taken 100 extra milliseconds to get to
> >> that bit: ReadNewTransactionId would have returned a value 3
> >> transactions later. ?Furthermore, before this value is even used at all
> >> for vacuuming, there has to be a whole lot of inter-process signalling,
> >> a fork, and a new backend startup.
> >>
> >> I think this should be left alone. ?As you said, it isn't worth it.
> >
> > Agreed it is not worth it but I think we should at least C comment
> > something. ? I think at a minimum we should set it to
> > FirstNormalTransactionId.
> I think you should leave it well enough alone.

OK, but we still need a C comment, which I suggested as:

  This causes the freeze horizon to move backward slighly, but that is OK.

> > I am not so concerned about this case but about other cases where we are
> > computing xid distances across the invalid range.
> Such as?

Not sure.  I have not had time to research this, but there might be
cases where this backward movement matters --- remember our XIDs are
valid only within about a 2 billion range, and we do less/greater
comparisons in that range (using a macro).  That macro is not going to
cover over backward xid movement.

  Bruce Momjian  <bruce(at)momjian(dot)us>

  + It's impossible for everything to be true. +

In response to


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2011-04-01 23:11:23
Subject: Re: Bug in autovacuum.c?
Previous:From: Bruce MomjianDate: 2011-04-01 22:48:06
Subject: Re: Bug in autovacuum.c?

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group