Re: Safely calling index_getprocinfo() while holding an nbtree exclusive buffer lock

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Safely calling index_getprocinfo() while holding an nbtree exclusive buffer lock
Date: 2019-01-15 03:12:39
Message-ID: 31431.1547521959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Geoghegan <pg(at)bowt(dot)ie> writes:
> My nbtree patch [1] needs to call index_getprocinfo() with an
> exclusive buffer lock held during a leaf page split.

I think you should stop right there and ask why. Surely that info
can be obtained before starting the operation? Quite aside from the
deadlock hazard, I do not think holding an exclusive buffer lock
for long enough to go consult a system catalog will be acceptable
from a performance/concurrency standpoint.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-01-15 03:42:10 Re: could recovery_target_timeline=latest be the default in standby mode?
Previous Message Peter Geoghegan 2019-01-15 02:59:05 Safely calling index_getprocinfo() while holding an nbtree exclusive buffer lock