Move isolationtester's is-blocked query into C code for speed.
Tom Lane <tgl@sss.pgh.pa.us>
Move isolationtester's is-blocked query into C code for speed. Commit 4deb41381 modified isolationtester's query to see whether a session is blocked to also check for waits occurring in GetSafeSnapshot. However, it did that in a way that enormously increased the query's runtime under CLOBBER_CACHE_ALWAYS, causing the buildfarm members that use that to run about four times slower than before, and in some cases fail entirely. To fix, push the entire logic into a dedicated backend function. This should actually reduce the CLOBBER_CACHE_ALWAYS runtime from what it was previously, though I've not checked that. In passing, expose a SQL function to check for safe-snapshot blockage, comparable to pg_blocking_pids. This is more or less free given the infrastructure built to solve the other problem, so we might as well. Thomas Munro Discussion: https://postgr.es/m/20170407165749.pstcakbc637opkax@alap3.anarazel.de
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +26 −1 |
| src/backend/storage/lmgr/predicate.c | modified | +50 −0 |
| src/backend/utils/adt/lockfuncs.c | modified | +119 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.h | modified | +5 −1 |
| src/include/storage/predicate_internals.h | modified | +2 −0 |
| src/test/isolation/.gitignore | modified | +1 −0 |
| src/test/isolation/isolationtester.c | modified | +2 −10 |
Documentation touched
Discussion
- recent deadlock regression test failures 26 messages · 2017-04-07 → 2017-04-11