Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2a9f042

Browse files
committed
Revise REINDEX CONCURRENTLY recovery instructions
When the leftover invalid index is "ccold", there's no need to re-run the command. Reword the instructions to make that explicit. Backpatch to 12, where REINDEX CONCURRENTLY appeared. Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Discussion: https://postgr.es/m/20200819211312.GA15497@alvherre.pgsql
1 parent 69ffc2f commit 2a9f042

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

doc/src/sgml/ref/reindex.sgml

+10-8
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
307307
<orderedlist>
308308
<listitem>
309309
<para>
310-
A new temporary index definition is added to the catalog
310+
A new transient index definition is added to the catalog
311311
<literal>pg_index</literal>. This definition will be used to replace
312312
the old index. A <literal>SHARE UPDATE EXCLUSIVE</literal> lock at
313313
session level is taken on the indexes being reindexed as well as their
@@ -383,13 +383,15 @@ Indexes:
383383
"idx_ccnew" btree (col) INVALID
384384
</programlisting>
385385

386-
The recommended recovery method in such cases is to drop the invalid index
387-
and try again to perform <command>REINDEX CONCURRENTLY</command>. The
388-
concurrent index created during the processing has a name ending in the
389-
suffix <literal>ccnew</literal>, or <literal>ccold</literal> if it is an
390-
old index definition which we failed to drop. Invalid indexes can be
391-
dropped using <literal>DROP INDEX</literal>, including invalid toast
392-
indexes.
386+
If the index marked <literal>INVALID</literal> is suffixed
387+
<literal>ccnew</literal>, then it corresponds to the transient
388+
index created during the concurrent operation, and the recommended
389+
recovery method is to drop it using <literal>DROP INDEX</literal>,
390+
then attempt <command>REINDEX CONCURRENTLY</command> again.
391+
If the invalid index is instead suffixed <literal>ccold</literal>,
392+
it corresponds to the original index which could not be dropped;
393+
the recommended recovery method is to just drop said index, since the
394+
rebuild proper has been successful.
393395
</para>
394396

395397
<para>

0 commit comments

Comments
 (0)