Re: reindex concurrently and two toast indexes

2020-03-10 Thread Michael Paquier
On Tue, Mar 10, 2020 at 12:09:42PM +0900, Michael Paquier wrote: > On Mon, Mar 09, 2020 at 08:04:27AM +0100, Julien Rouhaud wrote: >> Agreed. > > Thanks for checking the patch. And applied as 61d7c7b. Regarding the isolation tests, let's brainstorm on what we can do, but I am afraid that it is

Re: reindex concurrently and two toast indexes

2020-03-09 Thread Michael Paquier
On Mon, Mar 09, 2020 at 08:04:27AM +0100, Julien Rouhaud wrote: > On Mon, Mar 09, 2020 at 02:52:31PM +0900, Michael Paquier wrote: >> For the index-level operation, issuing a WARNING is not consistent >> with the existing practice to use an ERROR, which is more adapted as >> the operation is done

Re: reindex concurrently and two toast indexes

2020-03-09 Thread Julien Rouhaud
On Mon, Mar 09, 2020 at 02:52:31PM +0900, Michael Paquier wrote: > On Fri, Mar 06, 2020 at 01:36:48PM +0100, Julien Rouhaud wrote: > > > > v4 attached, which doesn't prevent a REINDEX INDEX CONCURRENTLY on any > > invalid > > non-TOAST index anymore. > > Thanks. The position of the error check

Re: reindex concurrently and two toast indexes

2020-03-08 Thread Michael Paquier
On Fri, Mar 06, 2020 at 01:36:48PM +0100, Julien Rouhaud wrote: > Ah I see, thanks for the clarification. I guess there's room for improvement > in the comments about that, since the ERRCODE_FEATURE_NOT_SUPPORTED usage is > quite misleading there. > > v4 attached, which doesn't prevent a REINDEX

Re: reindex concurrently and two toast indexes

2020-03-06 Thread Julien Rouhaud
On Fri, Mar 06, 2020 at 10:38:44AM +0900, Michael Paquier wrote: > On Thu, Mar 05, 2020 at 05:57:07PM +0100, Julien Rouhaud wrote: > > I agree that the approach wasn't quite robust. I'll try to look at adding a > > new command for isolationtester, but that's probably not something we want > > to

Re: reindex concurrently and two toast indexes

2020-03-05 Thread Michael Paquier
On Thu, Mar 05, 2020 at 05:57:07PM +0100, Julien Rouhaud wrote: > I agree that the approach wasn't quite robust. I'll try to look at adding a > new command for isolationtester, but that's probably not something we want to > put in pg13? Yes, that's too late. > Note that while looking at it, I

Re: reindex concurrently and two toast indexes

2020-03-05 Thread Julien Rouhaud
On Thu, Mar 05, 2020 at 12:53:54PM +0900, Michael Paquier wrote: > On Wed, Mar 04, 2020 at 09:21:45AM +0100, Julien Rouhaud wrote: > > Thanks for the patch! I started to look at it during the weekend, but > > I got interrupted and unfortunately didn't had time to look at it > > since. > > No

Re: reindex concurrently and two toast indexes

2020-03-04 Thread Michael Paquier
On Wed, Mar 04, 2020 at 09:21:45AM +0100, Julien Rouhaud wrote: > Thanks for the patch! I started to look at it during the weekend, but > I got interrupted and unfortunately didn't had time to look at it > since. No problem, thanks for looking at it. I have looked at it again this morning, and

Re: reindex concurrently and two toast indexes

2020-03-04 Thread Julien Rouhaud
On Wed, Mar 4, 2020 at 6:15 AM Michael Paquier wrote: > > On Tue, Mar 03, 2020 at 06:25:51PM +0900, Michael Paquier wrote: > > Or actually, a more simple solution is to abuse of the two existing > > routines so as the dependency switch is done the other way around, > > from the new index to the

Re: reindex concurrently and two toast indexes

2020-03-03 Thread Michael Paquier
On Tue, Mar 03, 2020 at 06:25:51PM +0900, Michael Paquier wrote: > Or actually, a more simple solution is to abuse of the two existing > routines so as the dependency switch is done the other way around, > from the new index to the old one. That would visibly work because > there is no CCI

Re: reindex concurrently and two toast indexes

2020-03-03 Thread Michael Paquier
On Tue, Mar 03, 2020 at 05:06:42PM +0900, Michael Paquier wrote: > Attached is a draft patch to take care of that problem for HEAD. It > still needs a lot of polishing (variable names are not actually old > or new anymore, etc.) but that's enough to show the idea. If a version > reaches PG12, we

Re: reindex concurrently and two toast indexes

2020-03-03 Thread Michael Paquier
On Thu, Feb 27, 2020 at 09:07:35AM +0100, Julien Rouhaud wrote: > While looking at it, I see that invalid indexes seem to leaked when the table > is dropped, with no way to get rid of them: > > Shouldn't DROP TABLE be fixed to also drop invalid indexes? Hmm. The problem here is that I think that

Re: reindex concurrently and two toast indexes

2020-02-27 Thread Julien Rouhaud
On Thu, Feb 27, 2020 at 04:32:11PM +0900, Michael Paquier wrote: > On Sat, Feb 22, 2020 at 04:06:57PM +0100, Julien Rouhaud wrote: > > Sorry, I just realized that I forgot to commit the last changes before > > sending > > the patch, so here's the correct v2. > > Thanks for the patch. > > > + if

Re: reindex concurrently and two toast indexes

2020-02-26 Thread Michael Paquier
On Sat, Feb 22, 2020 at 04:06:57PM +0100, Julien Rouhaud wrote: > Sorry, I just realized that I forgot to commit the last changes before sending > the patch, so here's the correct v2. Thanks for the patch. > + if (skipit) > + { > + ereport(NOTICE, > +

Re: reindex concurrently and two toast indexes

2020-02-22 Thread Julien Rouhaud
On Sat, Feb 22, 2020 at 08:09:24AM +0100, Julien Rouhaud wrote: > On Tue, Feb 18, 2020 at 07:39:49AM +0100, Julien Rouhaud wrote: > > On Tue, Feb 18, 2020 at 7:19 AM Michael Paquier wrote: > > > > > > On Tue, Feb 18, 2020 at 07:06:25AM +0100, Julien Rouhaud wrote: > > > > On Tue, Feb 18, 2020 at

Re: reindex concurrently and two toast indexes

2020-02-22 Thread Justin Pryzby
On Tue, Feb 18, 2020 at 02:29:33PM +0900, Michael Paquier wrote: > On Sun, Feb 16, 2020 at 01:08:35PM -0600, Justin Pryzby wrote: > > Forking old, long thread: > > https://www.postgresql.org/message-id/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net > > On Fri, Jan 04, 2019 at 03:18:06PM

Re: reindex concurrently and two toast indexes

2020-02-21 Thread Julien Rouhaud
On Tue, Feb 18, 2020 at 07:39:49AM +0100, Julien Rouhaud wrote: > On Tue, Feb 18, 2020 at 7:19 AM Michael Paquier wrote: > > > > On Tue, Feb 18, 2020 at 07:06:25AM +0100, Julien Rouhaud wrote: > > > On Tue, Feb 18, 2020 at 6:30 AM Michael Paquier > > > wrote: > > >> Hmm. There could be an

Re: reindex concurrently and two toast indexes

2020-02-17 Thread Julien Rouhaud
On Tue, Feb 18, 2020 at 7:19 AM Michael Paquier wrote: > > On Tue, Feb 18, 2020 at 07:06:25AM +0100, Julien Rouhaud wrote: > > On Tue, Feb 18, 2020 at 6:30 AM Michael Paquier wrote: > >> Hmm. There could be an argument here for skipping invalid toast > >> indexes within reindex_index(), because

Re: reindex concurrently and two toast indexes

2020-02-17 Thread Michael Paquier
On Tue, Feb 18, 2020 at 07:06:25AM +0100, Julien Rouhaud wrote: > On Tue, Feb 18, 2020 at 6:30 AM Michael Paquier wrote: >> Hmm. There could be an argument here for skipping invalid toast >> indexes within reindex_index(), because we are sure about having at >> least one valid toast index at

Re: reindex concurrently and two toast indexes

2020-02-17 Thread Julien Rouhaud
On Tue, Feb 18, 2020 at 6:30 AM Michael Paquier wrote: > > On Sun, Feb 16, 2020 at 01:08:35PM -0600, Justin Pryzby wrote: > > Forking old, long thread: > > https://www.postgresql.org/message-id/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net > > On Fri, Jan 04, 2019 at 03:18:06PM +0300,

Re: reindex concurrently and two toast indexes

2020-02-17 Thread Michael Paquier
On Sun, Feb 16, 2020 at 01:08:35PM -0600, Justin Pryzby wrote: > Forking old, long thread: > https://www.postgresql.org/message-id/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net > On Fri, Jan 04, 2019 at 03:18:06PM +0300, Sergei Kornilov wrote: >> About reindex invalid indexes - i found

reindex concurrently and two toast indexes

2020-02-16 Thread Justin Pryzby
Forking old, long thread: https://www.postgresql.org/message-id/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net On Fri, Jan 04, 2019 at 03:18:06PM +0300, Sergei Kornilov wrote: > About reindex invalid indexes - i found one good question in archives [1]: > how about toast indexes? > I