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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
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 19:05:05
Message-ID: 20200330190505.3ep6gbagdha24bjy@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

> But the fix is about expression about always true.
> But if this patch is correct, he fix one possible bug.
>
> The comment says:
> * Perform checking of FSM after releasing lock, the fsm is
> * approximate, after all.
>
> But this is not what the code does, apparently it checks before unlocking.

No, it doesn't. The freespace check isn't the PageIsNew(), it's the
GetRecordedFreeSpace() call. Which happens after unlocking.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2020-03-30 19:10:59 Re: tweaking perfect hash multipliers
Previous Message Robert Haas 2020-03-30 19:04:55 Re: backup manifests