Re: [PATCH] remove condition always true (/src/backend/access/heap/vacuumlazy.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] remove condition always true (/src/backend/access/heap/vacuumlazy.c)
Date: 2020-03-30 22:07:30
Message-ID: CAEudQAp-276PzV_cLjfLhWWoe_JrXCvtYm_0CdetntQ97WS7sA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em seg., 30 de mar. de 2020 às 18:14, Andres Freund <andres(at)anarazel(dot)de>
escreveu:

> Hi,
>
> On 2020-03-30 14:10:29 -0700, Andres Freund wrote:
> > On 2020-03-30 17:08:01 -0300, Ranier Vilela wrote:
> > > Em seg., 30 de mar. de 2020 às 16:05, Andres Freund <
> andres(at)anarazel(dot)de>
> > > escreveu:
> > >
> > > > Hi,
> > > >
> > > > On 2020-03-30 15:07:40 -0300, Ranier Vilela wrote:
> > > > > I'm not sure that the patch is 100% correct.
> > > >
> > > > This is *NOT* correct.
> > > >
> > > Anyway, the original source, still wrong.
> > > What is the use of testing PageIsNew (page) twice in a row, if nothing
> has
> > > changed.
> >
> > Yea, that can be reduced. It's pretty harmless though.
> >
> > We used to require a cleanup lock (which requires dropping the lock,
> > acquiring a cleanup lock - which allows for others to make the page be
> > not empty) before acting on the empty page in vacuum. That's why
> > PageIsNew() had to be checked again.

Well, this is what the patch does, promove reduced and continue to check
PageIsNew after unlock.

regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-03-30 22:12:42 Re: fix for BUG #3720: wrong results at using ltree
Previous Message Tom Lane 2020-03-30 21:59:26 Re: fix for BUG #3720: wrong results at using ltree