Re: Multiple FPI_FOR_HINT for the same block during killing btreeindex items - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Multiple FPI_FOR_HINT for the same block during killing btreeindex items
Date
Msg-id 20200409180533.GA16651@alvherre.pgsql
Whole thread Raw
In response to Multiple FPI_FOR_HINT for the same block during killing btree index items  (Masahiko Sawada <masahiko.sawada@2ndquadrant.com>)
List pgsql-hackers
On 2020-Apr-09, Masahiko Sawada wrote:

> The inner test in the comment "found the item" never tests the item
> for being dead. So maybe we can add !ItemIdIsDead(iid) to that
> condition. But there still is a race condition of recording multiple
> FPIs can happen. Maybe a better solution is to change the lock to
> exclusive, at least when wal_log_hints = on, so that only one process
> can run this code -- the reduction in concurrency might be won back by
> the fact that we don't wal-log the page multiple times.

I agree.

It seems worth pointing out that when this code was written, these hint
bit changes were not logged, so this consideration did not apply then.
But we added data checksums and wal_log_hints, which changed the
equation.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tim Bishop
Date:
Subject: Re: debian bugrept involving fast default crash in pg11.7
Next
From: Alexey Kondratov
Date:
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed