pgsql: Get rid of SET LOGGED indexes persistence kludge

Started by Alvaro Herreraover 11 years ago3 messagescomitters
Jump to latest
#1Alvaro Herrera
alvherre@2ndquadrant.com

Get rid of SET LOGGED indexes persistence kludge

This removes ATChangeIndexesPersistence() introduced by f41872d0c1239d36
which was too ugly to live for long. Instead, the correct persistence
marking is passed all the way down to reindex_index, so that the
transient relation built to contain the index relfilenode can
get marked correctly right from the start.

Author: Fabrízio de Royes Mello
Review and editorialization by Michael Paquier
and Álvaro Herrera

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/85b506bbfc2937c9abdfcce4e01a8feca8e64ee8

Modified Files
--------------
src/backend/catalog/index.c | 28 ++++++++++++++++--
src/backend/commands/cluster.c | 16 +++++++++--
src/backend/commands/indexcmds.c | 2 +-
src/backend/commands/matview.c | 8 +++---
src/backend/commands/tablecmds.c | 56 ++----------------------------------
src/backend/utils/cache/relcache.c | 1 +
src/include/catalog/index.h | 11 ++++---
src/include/commands/cluster.h | 3 +-
8 files changed, 56 insertions(+), 69 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: pgsql: Get rid of SET LOGGED indexes persistence kludge

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Get rid of SET LOGGED indexes persistence kludge

The buildfarm suggests that this patch fails under CLOBBER_CACHE_ALWAYS.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: pgsql: Get rid of SET LOGGED indexes persistence kludge

Tom Lane <tgl@sss.pgh.pa.us> writes:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Get rid of SET LOGGED indexes persistence kludge

The buildfarm suggests that this patch fails under CLOBBER_CACHE_ALWAYS.

After a bit of study, the explanation is almost certainly that you can't
just do this in reindex_index:

+       /* Set the relpersistence of the new index */
+       iRel->rd_rel->relpersistence = persistence;

Probably the right fix is to add a persistence parameter to
RelationSetNewRelfilenode. The existing patch seems pretty
klugy without that anyway.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers