On Fri, Feb 14, 2020 at 1:07 PM Andres Freund <and...@anarazel.de> wrote: > Yea, that seems possible. I'm not really sure it's needed however? As > long as you're not teaching the locking mechanism new tricks that > influence the wait graph, why would the deadlock detector care? That's > quite different from the group locking case, where you explicitly needed > to teach it something fairly fundamental.
Well, you have to teach it that locks of certain types conflict even if they are in the same group, and that bleeds over pretty quickly into the whole area of deadlock detection, because lock waits are the edges in the graph that the deadlock detector processes. > It might still be a good idea independently to add the rule & enforce > that acquire heavyweight locks while holding certain classes of locks is > not allowed. I think that's absolutely essential, if we're going to continue using the main lock manager for this. I remain somewhat unconvinced that doing so is the best way forward, but it is *a* way forward. > Right. For me that's *the* fundamental service that lock.c delivers. And > it's the fundamental bit this thread so far largely has been focusing > on. For me, the deadlock detection is the far more complicated and problematic bit. > Isn't that mostly true to varying degrees for the majority of lock types > in lock.c? Sure, perhaps historically that's a misuse of lock.c, but > it's been pretty ingrained by now. I just don't see where leaving out > any of these features is going to give us fundamental advantages > justifying a different locking infrastructure. I think the group locking + deadlock detection things are more fundamental than you might be crediting, but I agree that having parallel mechanisms has its own set of pitfalls. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company