pgsql: Fix deadlock in heap_compute_xid_horizon_for_tuples().

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix deadlock in heap_compute_xid_horizon_for_tuples().
Date: 2019-04-01 20:31:53
Message-ID: E1hB3az-0007aE-6O@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix deadlock in heap_compute_xid_horizon_for_tuples().

We can't call code that uses syscache while we hold buffer locks
on a catalog relation. If passed such a relation, just fall back
to the general effective_io_concurrency GUC rather than trying to
look up the containing tablespace's IO concurrency setting.

We might find a better way to control prefetching in follow-up
work, but for now this is enough to avoid the deadlock introduced
by commit 558a9165e0.

Reviewed-by: Andres Freund
Diagnosed-by: Peter Geoghegan
Discussion: https://postgr.es/m/CA%2BhUKGLCwPF0S4Mk7S8qw%2BDK0Bq65LueN9rofAA3HHSYikW-Zw%40mail.gmail.com
Discussion: https://postgr.es/m/962831d8-c18d-180d-75fb-8b842e3a2742%40chrullrich.net

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4fd05bb55b40a3c9dde2b19942f275fc31b5225a

Modified Files
--------------
src/backend/access/heap/heapam.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2019-04-01 20:37:06 Re: pgsql: Compute XID horizon for page level index vacuum on primary.
Previous Message Tom Lane 2019-04-01 20:20:27 pgsql: Improve documentation about our XML functionality.