pgsql: Fix relpersistence setting in reindex_index - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: Fix relpersistence setting in reindex_index
Date
Msg-id E1XqNED-00047v-Uf@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix relpersistence setting in reindex_index

Buildfarm members with CLOBBER_CACHE_ALWAYS advised us that commit
85b506bbfc2937 was mistaken in setting the relpersistence value of the
index directly in the relcache entry, within reindex_index.  The reason
for the failure is that an invalidation message that comes after mucking
with the relcache entry directly, but before writing it to the catalogs,
would cause the entry to become rebuilt in place from catalogs with the
old contents, losing the update.

Fix by passing the correct persistence value to
RelationSetNewRelfilenode instead; this routine also writes the updated
tuple to pg_class, avoiding the problem.  Suggested by Tom Lane.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0f9692b40d1292f1b2640f026561908fd37b7407

Modified Files
--------------
src/backend/catalog/index.c        |    5 +----
src/backend/commands/sequence.c    |    4 ++--
src/backend/commands/tablecmds.c   |    6 ++++--
src/backend/utils/cache/relcache.c |   14 +++++++++-----
src/include/utils/relcache.h       |    2 +-
5 files changed, 17 insertions(+), 14 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Translation updates
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix WAL-logging of B-tree "unlink halfdead page" operation.