Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb3f919d

Browse files
Add table relcache invalidation to index builds.
It's necessary to make sure that owning tables have a relcacheinvalidation prior to advancing the command counter to makenewly-entered catalog tuples for the index visible. inval.c must beable to maintain the consistency of the local caches in the event oftransaction abort. There is usually only a problem when CREATE INDEXtransactions abort, since there is a generic invalidation once we reachindex_update_stats().This bug is of long standing. Problems were made much more likely bythe addition of parallel CREATE INDEX (commit9da0cc3), but it isstrongly suspected that similar problems can be triggered withoutinvolving plan_create_index_workers(). (plan_create_index_workers()triggers a relcache build or rebuild, which previously only happened inrare edge cases.)Author: Peter GeogheganReported-By: Luca FerrariDiagnosed-By: Andres FreundReviewed-By: Andres FreundDiscussion:https://postgr.es/m/CAKoxK+5fVodiCtMsXKV_1YAKXbzwSfp7DgDqUmcUAzeAhf=HEQ@mail.gmail.comBackpatch: 9.3-
1 parentc1455de commitb3f919d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/backend/catalog/index.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,12 @@ index_create(Relation heapRelation,
978978
!concurrent&& !invalid,
979979
!concurrent);
980980

981+
/*
982+
* Register relcache invalidation on the indexes' heap relation, to
983+
* maintain consistency of its index list
984+
*/
985+
CacheInvalidateRelcache(heapRelation);
986+
981987
/* update pg_inherits, if needed */
982988
if (OidIsValid(parentIndexRelid))
983989
StoreSingleInheritance(indexRelationId,parentIndexRelid,1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp