pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
"ccold" left by reindex concurrently are droppable?
4+ messages / 4 participants
[nested] [flat]

Commits from this thread:
  2020-08-20 0784c33372 da9ec328dd 2a9f042c47  Revise REINDEX CONCURRENTLY recovery instructions
* "ccold" left by reindex concurrently are droppable?
@ 2020-08-19 21:13 Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-08-20 05:17 ` Re: "ccold" left by reindex concurrently are droppable? Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 4+ messages in thread

From: Alvaro Herrera @ 2020-08-19 21:13 UTC (permalink / raw)
  To: Pg Hackers <pgsql-hackers@lists.postgresql.org>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Michael Paquier <michael@paquier.xyz>

Hello

The REINDEX CONCURRENTLY documentation states that if a transient index
used lingers, the fix is to drop the invalid index and perform RC again;
and that this is to be done for "ccnew" indexes and also for "ccold"
indexes:

    The recommended recovery method in such cases is to drop the invalid index
    and try again to perform <command>REINDEX CONCURRENTLY</command>.  The
    concurrent index created during the processing has a name ending in the
    suffix <literal>ccnew</literal>, or <literal>ccold</literal> if it is an
    old index definition which we failed to drop. Invalid indexes can be
    dropped using <literal>DROP INDEX</literal>, including invalid toast
    indexes.

But this seems misleading to me.  It is correct advice for "ccnew"
indexes, of course.  But if the index is named "ccold", then the rebuild
of the index actually succeeded, so you can just drop the ccold index
and not rebuild anything.

In other words I propose to reword this paragraph as follows:

   If the transient index created during the concurrent operation is
   suffixed <literal>ccnew</literal>, the recommended recovery method
   is to drop the invalid index using <literal>DROP INDEX</literal>,
   and try to perform <command>REINDEX CONCURRENTLY</command> again. 
   If the transient index is instead suffixed <literal>ccold</literal>,
   it corresponds to the original index which we failed to drop;
   the recommended recovery method is to just drop said index, since the
   rebuild proper has been successful.

(The original talks about "the concurrent index", which seems somewhat
sloppy thinking.  I used the term "transient index" instead.)

-- 
Álvaro Herrera                            39°49'30"S 73°17'W





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: "ccold" left by reindex concurrently are droppable?
  2020-08-19 21:13 "ccold" left by reindex concurrently are droppable? Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2020-08-20 05:17 ` Michael Paquier <michael@paquier.xyz>
  2020-08-20 08:18   ` Re: "ccold" left by reindex concurrently are droppable? Julien Rouhaud <rjuju123@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Paquier @ 2020-08-20 05:17 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

On Wed, Aug 19, 2020 at 05:13:12PM -0400, Alvaro Herrera wrote:
> In other words I propose to reword this paragraph as follows:
> 
>    If the transient index created during the concurrent operation is
>    suffixed <literal>ccnew</literal>, the recommended recovery method
>    is to drop the invalid index using <literal>DROP INDEX</literal>,
>    and try to perform <command>REINDEX CONCURRENTLY</command> again. 
>    If the transient index is instead suffixed <literal>ccold</literal>,
>    it corresponds to the original index which we failed to drop;
>    the recommended recovery method is to just drop said index, since the
>    rebuild proper has been successful.

Yes, that's an improvement.  It would be better to backpatch that.  So
+1 from me.

> (The original talks about "the concurrent index", which seems somewhat
> sloppy thinking.  I used the term "transient index" instead.)

Using transient to refer to an index aimed at being ephemeral sounds
fine to me in this context.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: "ccold" left by reindex concurrently are droppable?
  2020-08-19 21:13 "ccold" left by reindex concurrently are droppable? Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-08-20 05:17 ` Re: "ccold" left by reindex concurrently are droppable? Michael Paquier <michael@paquier.xyz>
@ 2020-08-20 08:18   ` Julien Rouhaud <rjuju123@gmail.com>
  2020-08-20 17:54     ` Re: "ccold" left by reindex concurrently are droppable? Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Julien Rouhaud @ 2020-08-20 08:18 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; Pg Hackers <pgsql-hackers@lists.postgresql.org>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

On Thu, Aug 20, 2020 at 7:17 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Aug 19, 2020 at 05:13:12PM -0400, Alvaro Herrera wrote:
> > In other words I propose to reword this paragraph as follows:
> >
> >    If the transient index created during the concurrent operation is
> >    suffixed <literal>ccnew</literal>, the recommended recovery method
> >    is to drop the invalid index using <literal>DROP INDEX</literal>,
> >    and try to perform <command>REINDEX CONCURRENTLY</command> again.
> >    If the transient index is instead suffixed <literal>ccold</literal>,
> >    it corresponds to the original index which we failed to drop;
> >    the recommended recovery method is to just drop said index, since the
> >    rebuild proper has been successful.
>
> Yes, that's an improvement.  It would be better to backpatch that.  So
> +1 from me.

+1, that's an improvement and should be backpatched.

>
> > (The original talks about "the concurrent index", which seems somewhat
> > sloppy thinking.  I used the term "transient index" instead.)
>
> Using transient to refer to an index aimed at being ephemeral sounds
> fine to me in this context.

Agreed.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: "ccold" left by reindex concurrently are droppable?
  2020-08-19 21:13 "ccold" left by reindex concurrently are droppable? Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-08-20 05:17 ` Re: "ccold" left by reindex concurrently are droppable? Michael Paquier <michael@paquier.xyz>
  2020-08-20 08:18   ` Re: "ccold" left by reindex concurrently are droppable? Julien Rouhaud <rjuju123@gmail.com>
@ 2020-08-20 17:54     ` Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2020-08-20 17:54 UTC (permalink / raw)
  To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; Pg Hackers <pgsql-hackers@lists.postgresql.org>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

Thanks, Michael and Julien!  Pushed to 12-master, with a slight
rewording to use the passive voice, hopefully matching the surrounding
text.  I also changed "temporary" to "transient" in another line, for
consistency.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2020-08-20 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19 21:13 "ccold" left by reindex concurrently are droppable? Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-08-20 05:17 ` Michael Paquier <michael@paquier.xyz>
2020-08-20 08:18   ` Julien Rouhaud <rjuju123@gmail.com>
2020-08-20 17:54     ` Alvaro Herrera <alvherre@2ndquadrant.com>

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