Re: Multiple FPI_FOR_HINT for the same block during killing btree index items
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-04-09T18:05:33Z
Lists: 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
Commits
-
Avoid killing btree items that are already dead
- 4649eb91916b 9.6.19 landed
- 37b5c5fde46a 11.9 landed
- 242dfcbafac5 13.0 landed
- 1d84751c60bf 12.4 landed
- 0a319699d59c 9.5.23 landed
- 09f2752b0465 10.14 landed