Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4fd05bb

Browse files
committed
Fix deadlock in heap_compute_xid_horizon_for_tuples().
We can't call code that uses syscache while we hold buffer lockson a catalog relation. If passed such a relation, just fall backto the general effective_io_concurrency GUC rather than trying tolook up the containing tablespace's IO concurrency setting.We might find a better way to control prefetching in follow-upwork, but for now this is enough to avoid the deadlock introducedby commit558a916.Reviewed-by: Andres FreundDiagnosed-by: Peter GeogheganDiscussion:https://postgr.es/m/CA%2BhUKGLCwPF0S4Mk7S8qw%2BDK0Bq65LueN9rofAA3HHSYikW-Zw%40mail.gmail.comDiscussion:https://postgr.es/m/962831d8-c18d-180d-75fb-8b842e3a2742%40chrullrich.net
1 parent12d46ac commit4fd05bb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6976,8 +6976,15 @@ heap_compute_xid_horizon_for_tuples(Relation rel,
69766976
* more prefetching in this case, too. It may be that this formula is too
69776977
* simplistic, but at the moment there is no evidence of that or any idea
69786978
* about what would work better.
6979+
*
6980+
* Since the caller holds a buffer lock somewhere in rel, we'd better make
6981+
* sure that isn't a catalog relation before we call code that does
6982+
* syscache lookups, to avoid risk of deadlock.
69796983
*/
6980-
io_concurrency=get_tablespace_io_concurrency(rel->rd_rel->reltablespace);
6984+
if (IsCatalogRelation(rel))
6985+
io_concurrency=effective_io_concurrency;
6986+
else
6987+
io_concurrency=get_tablespace_io_concurrency(rel->rd_rel->reltablespace);
69816988
prefetch_distance=Min((io_concurrency)+10,MAX_IO_CONCURRENCY);
69826989

69836990
/* Start prefetching. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp