Re: Safely calling index_getprocinfo() while holding an nbtreeexclusive buffer lock - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Safely calling index_getprocinfo() while holding an nbtreeexclusive buffer lock
Date
Msg-id CAH2-WznJX63sOWRZsjWM0O2cVErPPv+shLSvmO0sw8CrLLe7qQ@mail.gmail.com
Whole thread Raw
In response to Re: Safely calling index_getprocinfo() while holding an nbtree exclusive buffer lock  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Jan 14, 2019 at 7:12 PM Tom Lane <tgl@sss.pgh.pa.us> 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 it to avoid accessing the
metapage. I now think that it would be perfectly acceptable to just
pass down the insertion scan key for the tuple that caused the split,
instead of that build bool, and handle both deadlock issues
(index_getprocinfo() hazard and metapage hazard) that way instead.
Heikki expressed some concerns about the way the patch accesses the
metapage already.

I jumped the gun with this catalog index business. Clearly I'd be much
better off avoiding *all* new buffer lock protocol stuff by getting
both pieces of information up-front -- for some reason I thought that
that would be harder than it now appears.

Thanks
--
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Tid scan improvements
Next
From: Haribabu Kommi
Date:
Subject: current_logfiles not following group access and instead followslog_file_mode permissions