Fix race condition where heap_delete() fails to pin VM page.

Jeff Davis <jdavis@postgresql.org>

Commit: dd6070bc81733c3174f2e257d43908f98b0255fb
Author: Jeff Davis <jdavis@postgresql.org>
Date: 2022-09-22T18:04:36Z
Releases: 15.0
Fix race condition where heap_delete() fails to pin VM page.

Similar to 5f12bc94dc, the code must re-check PageIsAllVisible() after
buffer lock is re-acquired. Backpatching to the same version, 12.

Discussion: https://postgr.es/m/CAEP4nAw9jYQDKd_5Y+-s2E4YiUJq1vqiikFjYGpLShtp-K3gag@mail.gmail.com
Reported-by: Robins Tharakan
Reviewed-by: Robins Tharakan
Backpatch-through: 12

Files

PathChange+/−
src/backend/access/heap/heapam.c modified +19 −11

Discussion