Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-11-09 Thread Tom Lane
Robert Haas writes: > No, that's not right. Now that you mention it, I realize that tuple > locks can definitely cause deadlocks. Example: Yeah. Foreign-key-related tuple locks are another rich source of examples. > ... So I don't > think we can remove speculative

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-11-09 Thread Robert Haas
On Wed, Nov 8, 2017 at 9:40 AM, Masahiko Sawada wrote: > Speaking of the acquiring these four lock types and heavy weight lock, > there obviously is a call path to acquire any of four lock types while > holding a heavy weight lock. In reverse, there also is a call path >

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-11-08 Thread Masahiko Sawada
On Wed, Nov 8, 2017 at 5:41 AM, Robert Haas wrote: > On Mon, Nov 6, 2017 at 4:42 AM, Masahiko Sawada wrote: I suggest that a good thing to do more or less immediately, regardless of when this patch ends up being ready, would be to insert an

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-11-07 Thread Robert Haas
On Mon, Nov 6, 2017 at 4:42 AM, Masahiko Sawada wrote: >>> I suggest that a good thing to do more or less immediately, regardless >>> of when this patch ends up being ready, would be to insert an >>> insertion that LockAcquire() is never called while holding a lock of >>>

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-11-06 Thread Masahiko Sawada
On Mon, Oct 30, 2017 at 3:17 PM, Masahiko Sawada wrote: > On Fri, Oct 27, 2017 at 12:03 AM, Robert Haas wrote: >> On Thu, Oct 26, 2017 at 12:36 PM, Masahiko Sawada >> wrote: >>> Since the previous patch conflicts with current

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-10-30 Thread Masahiko Sawada
On Fri, Oct 27, 2017 at 12:03 AM, Robert Haas wrote: > On Thu, Oct 26, 2017 at 12:36 PM, Masahiko Sawada > wrote: >> Since the previous patch conflicts with current HEAD, I attached the >> updated patch for next CF. > > I think we should back up

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-10-26 Thread Robert Haas
On Thu, Oct 26, 2017 at 12:36 PM, Masahiko Sawada wrote: > Since the previous patch conflicts with current HEAD, I attached the > updated patch for next CF. I think we should back up here and ask ourselves a couple of questions: 1. What are we trying to accomplish here?

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-10-26 Thread Masahiko Sawada
On Fri, Sep 8, 2017 at 4:32 AM, Masahiko Sawada wrote: > On Fri, Sep 8, 2017 at 7:24 AM, Thomas Munro > wrote: >> On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada >> wrote: >>> The previous patch conflicts with

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Masahiko Sawada
On Fri, Sep 8, 2017 at 7:24 AM, Thomas Munro wrote: > On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada > wrote: >> The previous patch conflicts with current HEAD, I rebased the patch to >> current HEAD. > > Hi Masahiko-san, > > FYI this

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Masahiko Sawada
On Fri, Sep 8, 2017 at 8:25 AM, Thomas Munro wrote: > On Fri, Sep 8, 2017 at 10:24 AM, Thomas Munro > wrote: >> On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada >> wrote: >>> The previous patch conflicts with

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Thomas Munro
On Fri, Sep 8, 2017 at 10:24 AM, Thomas Munro wrote: > On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada > wrote: >> The previous patch conflicts with current HEAD, I rebased the patch to >> current HEAD. > > Hi Masahiko-san, Hi Sawada-san,

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-09-07 Thread Thomas Munro
On Wed, Aug 16, 2017 at 2:13 PM, Masahiko Sawada wrote: > The previous patch conflicts with current HEAD, I rebased the patch to > current HEAD. Hi Masahiko-san, FYI this doesn't build anymore. I think it's just because the wait event enumerators were re-alphabetised in

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-08-15 Thread Masahiko Sawada
On Thu, Jun 22, 2017 at 12:03 AM, Masahiko Sawada wrote: > On Fri, May 19, 2017 at 11:12 AM, Masahiko Sawada > wrote: >> On Wed, May 17, 2017 at 1:30 AM, Robert Haas wrote: >>> On Sat, May 13, 2017 at 7:27 AM, Amit Kapila

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-06-21 Thread Masahiko Sawada
On Fri, May 19, 2017 at 11:12 AM, Masahiko Sawada wrote: > On Wed, May 17, 2017 at 1:30 AM, Robert Haas wrote: >> On Sat, May 13, 2017 at 7:27 AM, Amit Kapila wrote: >>> On Fri, May 12, 2017 at 9:14 AM, Tom Lane

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-18 Thread Masahiko Sawada
On Wed, May 17, 2017 at 1:30 AM, Robert Haas wrote: > On Sat, May 13, 2017 at 7:27 AM, Amit Kapila wrote: >> On Fri, May 12, 2017 at 9:14 AM, Tom Lane wrote: >>> Robert Haas writes: On Wed, May 10,

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-16 Thread Robert Haas
On Sat, May 13, 2017 at 7:27 AM, Amit Kapila wrote: > On Fri, May 12, 2017 at 9:14 AM, Tom Lane wrote: >> Robert Haas writes: >>> On Wed, May 10, 2017 at 8:39 PM, Masahiko Sawada >>> wrote: ... I'd

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-16 Thread Masahiko Sawada
On Sat, May 13, 2017 at 8:19 PM, Amit Kapila wrote: > On Thu, May 11, 2017 at 6:09 AM, Masahiko Sawada > wrote: >> This work would be helpful not only for existing workload but also >> future works like some parallel utility commands, which is

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-13 Thread Amit Kapila
On Fri, May 12, 2017 at 9:14 AM, Tom Lane wrote: > Robert Haas writes: >> On Wed, May 10, 2017 at 8:39 PM, Masahiko Sawada >> wrote: >>> ... I'd like to propose to change relation >>> extension lock management so that it works

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-13 Thread Amit Kapila
On Thu, May 11, 2017 at 6:09 AM, Masahiko Sawada wrote: > This work would be helpful not only for existing workload but also > future works like some parallel utility commands, which is discussed > on other threads[1]. At least for parallel vacuum, this feature helps > to

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-11 Thread Tom Lane
Robert Haas writes: > On Wed, May 10, 2017 at 8:39 PM, Masahiko Sawada > wrote: >> ... I'd like to propose to change relation >> extension lock management so that it works using LWLock instead. > That's not a good idea because it'll make the code

Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-11 Thread Robert Haas
On Wed, May 10, 2017 at 8:39 PM, Masahiko Sawada wrote: > Currently, the relation extension lock is implemented using > heavyweight lock manager and almost functions (except for > brin_page_cleanup) using LockRelationForExntesion use it with > ExclusiveLock mode. But

[HACKERS] Moving relation extension locks out of heavyweight lock manager

2017-05-10 Thread Masahiko Sawada
Hi all, Currently, the relation extension lock is implemented using heavyweight lock manager and almost functions (except for brin_page_cleanup) using LockRelationForExntesion use it with ExclusiveLock mode. But actually it doesn't need multiple lock modes or deadlock detection or any of the