Re: pgsql: Avoid improbable PANIC during heap_update.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Jaime Casanova <jcasanov@systemguards.com.ec>,
pgsql-committers@lists.postgresql.org, Jeff Davis <pgsql@j-davis.com>
Date: 2022-10-01T04:38:00Z
Lists: pgsql-hackers
Peter Geoghegan <pg@bowt.ie> writes: > ... nothing stops heap_delete() from getting a pin > on a heap page that happens to have already been cleanup locked by > another session running VACUUM. The same session could then > (correctly) observe that the page does not have PD_ALL_VISIBLE set -- > not yet. VACUUM might then set PD_ALL_VISIBLE, without having to > acquire any kind of interlock that heap_delete() will reliably notice. I'm too tired to think this through completely clearly, but this sounds right, and what it seems to imply is that this race condition exists in all PG versions. Which would imply that we need to do the work to back-patch these three fixes into v11/v10. I would rather not do that, because then we'd have to also back-patch some other more-invasive changes, and the net risk of introducing new bugs seems uncomfortably high. (Especially for v10, where there will be no second chance after the November releases.) So what is bothering me about this line of thought is: how come there have not been reports of these failures in older branches? Is there some aspect we're not thinking about that masks the bug? regards, tom lane
Commits
-
Avoid improbable PANIC during heap_update, redux.
- 2dc2e4e31adb 16.0 landed
- e7bd2d671249 12.13 landed
- b93d7e6883d6 14.6 landed
- 92941f26435c 13.9 landed
- 2267085c1688 15.0 landed
-
Fix race condition where heap_delete() fails to pin VM page.
- 163b0993a162 16.0 cited
-
Avoid improbable PANIC during heap_update.
- 34f581c39e97 14.0 cited