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

2019-01-14 Thread Peter Geoghegan
On Mon, Jan 14, 2019 at 7:12 PM Tom Lane wrote: > I think you should stop right there and ask why. Surely that info > can be obtained before starting the operation? *Thinks some more* Uh, I'm already telling the same _bt_truncate() code path that it is being called from a CREATE INDEX, allowing

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

2019-01-14 Thread Tom Lane
Peter Geoghegan 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

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

2019-01-14 Thread Peter Geoghegan
My nbtree patch [1] needs to call index_getprocinfo() with an exclusive buffer lock held during a leaf page split. This has an undetectable self-deadlock (LWLock self-deadlock) risk: a syscache lookup against pg_proc might have a catcache miss, ending with an index scan that needs to access the ver