Skip to content

Commit 7d27493

Browse files
committed
Add indisreplident to fields refreshed by RelationReloadIndexInfo()
RelationReloadIndexInfo() is a fast-path used for index reloads in the relation cache, and it has always forgotten about updating indisreplident, which is something that would happen after an index is selected for a replica identity. This can lead to incorrect cache information provided when executing a command in a transaction context that updates indisreplident. None of the code paths currently on HEAD that need to check upon pg_index.indisreplident fetch its value from the relation cache, always relying on a fresh copy on the syscache. Unfortunately, this may not be the case of out-of-core code, that could see out-of-date value. Author: Shruthi Gowda Reviewed-by: Robert Haas, Dilip Kumar, Michael Paquier Discussion: https://postgr.es/m/CAASxf_PBcxax0wW-3gErUyftZ0XrCs3Lrpuhq4-Z3Fak1DoW7Q@mail.gmail.com Backpatch-through: 11
1 parent f1d6bcd commit 7d27493

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/utils/cache/relcache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,6 +2288,7 @@ RelationReloadIndexInfo(Relation relation)
22882288
relation->rd_index->indcheckxmin = index->indcheckxmin;
22892289
relation->rd_index->indisready = index->indisready;
22902290
relation->rd_index->indislive = index->indislive;
2291+
relation->rd_index->indisreplident = index->indisreplident;
22912292

22922293
/* Copy xmin too, as that is needed to make sense of indcheckxmin */
22932294
HeapTupleHeaderSetXmin(relation->rd_indextuple->t_data,

0 commit comments

Comments
 (0)