Hi, On 2020-02-12 11:53:49 -0500, Tom Lane wrote: > In general, if we think there are issues with LWLock, it seems to me > we'd be better off to try to fix them, not to invent a whole new > single-purpose lock manager that we'll have to debug and maintain.
My impression is that what's being discussed here is doing exactly that, except with s/lwlock/heavyweight locks/. We're basically replacing the lock.c lock mapping table with an ad-hoc implementation, and now we're also reinventing interruptability etc. I still find the performance arguments pretty ludicruous, to be honest - I think the numbers I posted about how much time we spend with the locks held, back that up. I have a bit more understanding for the parallel worker arguments, but only a bit: I think if we develop a custom solution for the extension lock, we're just going to end up having to develop another custom solution for a bunch of other types of locks. It seems quite likely that we'll end up also wanting TUPLE and also SPECULATIVE and PAGE type locks that we don't want to share between leader & workers. IMO the right thing here is to extend lock.c so we can better represent whether certain types of lockmethods (& levels ?) are [not] to be shared. Greetings, Andres Freund