Re: [PATCH] remove condition always true(/src/backend/access/heap/vacuumlazy.c) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] remove condition always true(/src/backend/access/heap/vacuumlazy.c)
Date
Msg-id 20200330190505.3ep6gbagdha24bjy@alap3.anarazel.de
Whole thread Raw
In response to [PATCH] remove condition always true (/src/backend/access/heap/vacuumlazy.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: backup manifests
Next
From: John Naylor
Date:
Subject: Re: tweaking perfect hash multipliers