pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 德哥 <digoal@126.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re:Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
Date: Wed, 25 Apr 2018 08:14:37 +0800 (CST)
Message-ID: <15238fbb.951.162fa26ed2b.Coremail.digoal@126.com> (raw)
In-Reply-To: <CAKFQuwY+N5tXnhtgWR5qmZwNDBuxSL=Sopb9+NH72KfPWDz1CQ@mail.gmail.com>
References: <152457298745.19804.5702434604866048036@wrigleys.postgresql.org>
	<20180424151658.3ysvvjwoj2w5acvk@alap3.anarazel.de>
	<CAKFQuwY+N5tXnhtgWR5qmZwNDBuxSL=Sopb9+NH72KfPWDz1CQ@mail.gmail.com>



but, there is no other session get any level lock with table a(creating index.). so if concurrenty create index with table a , at the end of the work, we can get a lock for table a and end the creating , like pg_repack?






在 2018-04-24 23:29:52,"David G. Johnston" <david.g.johnston@gmail.com> 写道:
 


On Tue, Apr 24, 2018 at 8:16 AM, Andres Freund <andres@anarazel.de> wrote:



On 2018-04-24 12:29:47 +0000, PG Bug reporting form wrote:

> table a's copy will block table b's CONCURRENTLY index creating.



Yes, concurrently waits for other sessions to complete. I don't see a

bug here?



To be more specific a create index can stop processing as soon as its done its own work because it prevented any concurrent transactions from operating at the same time.  With concurrently those other transactions can continue to work and thus the concurrent indexing performed by CREATE INDEX cannot know it is finished while other transactions hold write locks on the affected table/index.  Instead it waits "to finish" until those transactions finish.  The concurrent index creation has already started and is in progress - there just isn't any communication to the client as to progress.


David J.




view thread (6+ messages)  latest in thread

Message-ID: <15238fbb.951.162fa26ed2b.Coremail.digoal@126.com>
Permalink:  ../15238fbb.951.162fa26ed2b.Coremail.digoal@126.com/
Also on:    postgresql.org/message-id/15238fbb.951.162fa26ed2b.Coremail.digoal@126.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: digoal@126.com, david.g.johnston@gmail.com, andres@anarazel.de
  Subject: Re: BUG #15169: create index CONCURRENTLY conflict with other table's COPY
  In-Reply-To: <15238fbb.951.162fa26ed2b.Coremail.digoal@126.com>
  References: <152457298745.19804.5702434604866048036@wrigleys.postgresql.org> <20180424151658.3ysvvjwoj2w5acvk@alap3.anarazel.de> <CAKFQuwY+N5tXnhtgWR5qmZwNDBuxSL=Sopb9+NH72KfPWDz1CQ@mail.gmail.com> <15238fbb.951.162fa26ed2b.Coremail.digoal@126.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox