]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix cache look-up failures while applying changes in logical replication.
authorAmit Kapila <akapila@postgresql.org>
Wed, 15 Jun 2022 04:22:12 +0000 (09:52 +0530)
committerAmit Kapila <akapila@postgresql.org>
Wed, 15 Jun 2022 04:22:12 +0000 (09:52 +0530)
commit5a97b1325453d641a795710a92b233c665b662b1
tree3e614dbd5cffbc1812e3125d8659d4e01e961450
parenta3ff08e0b08dbfeb777ccfa8f13ebaa95d064c04
Fix cache look-up failures while applying changes in logical replication.

While building a new attrmap which maps partition attribute numbers to
remoterel's, we incorrectly update the map for dropped column attributes.
Later, it caused cache look-up failure when we tried to use the map to
fetch the information about attributes.

This also fixes the partition map cache invalidation which was using the
wrong type cast to fetch the entry. We were using stale partition map
entry after invalidation which leads to the assertion or cache look-up
failure.

Reported-by: Shi Yu
Author: Hou Zhijie, Shi Yu
Reviewed-by: Amit Langote, Amit Kapila
Backpatch-through: 13, where it was introduced
Discussion: https://postgr.es/m/OSZPR01MB6310F46CD425A967E4AEF736FDA49@OSZPR01MB6310.jpnprd01.prod.outlook.com
src/backend/replication/logical/relation.c
src/test/subscription/t/013_partition.pl