Add indisreplident to fields refreshed by RelationReloadIndexInfo()
authorMichael Paquier <michael@paquier.xyz>
Fri, 14 Jul 2023 02:16:13 +0000 (11:16 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 14 Jul 2023 02:16:13 +0000 (11:16 +0900)
commitdb9813819fe80c7ba670c03025428e85fe85c70f
tree6f143f8a06d231ac68175d9098d208d4c0b4ab68
parented2b58c153bc39160c2cb707c5b27894fa1831b9
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: http://postgr.es/m/CAASxf_PBcxax0wW-3gErUyftZ0XrCs3Lrpuhq4-Z3Fak1DoW7Q@mail.gmail.com
Backpatch-through: 11
src/backend/utils/cache/relcache.c