Re: hash_xlog_split_allocate_page: failed to acquire cleanup lock
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>,
Mark Dilger <mark.dilger@enterprisedb.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>,
Amit Kapila <amit.kapila16@gmail.com>,
Thomas Munro <thomas.munro@gmail.com>
Date: 2022-08-16T23:55:18Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > What sort of random things would someone do with pageinspect functions > that would hold buffer pins on one buffer while locking another one? > The functions in hashfuncs.c don't even seem like they would access > multiple buffers in total, let alone at overlapping times. And I don't > think that a query pageinspect could realistically be suspended while > holding a buffer pin either. If you wrapped it in a cursor it'd be > suspended before or after accessing any given buffer, not right in the > middle of that operation. pin != access. Unless things have changed really drastically since I last looked, a seqscan will sit on a buffer pin throughout the series of fetches from a single page. Admittedly, that's about *heap* page pins while indexscans have different rules. But I recall that btrees at least use persistent pins as well. It may be that there is indeed no way to make this happen with available SQL tools. But I wouldn't put a lot of money on that, and even less that it'll stay true in the future. Having said that, you're right that this is qualitatively different from the other bug, in that this is a deadlock not apparent data corruption. However, IIUC it's an LWLock deadlock, which we don't handle all that nicely. regards, tom lane
Commits
-
Fix cleanup lock acquisition in SPLIT_ALLOCATE_PAGE replay.
- e848be60b5cf 16.0 landed
- e49e191815b6 15.2 landed
- 9693f190076e 14.7 landed
- 20c223336301 13.10 landed
- 4dccccb37e0b 12.14 landed
- 1703033f896a 11.19 landed