aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-06-21 17:13:10 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-06-21 17:13:10 +0300
commit441ef5e1badcc3695de4a865cffb30f0e5057893 (patch)
treea61a051c9862426ab69f3dc18043fa9dc95125ed /src/backend/utils/cache/relcache.c
parent90fe7b74df976324d7c0b3d203b25b7333447ca3 (diff)
downloadpostgresql-441ef5e1badcc3695de4a865cffb30f0e5057893.tar.gz
postgresql-441ef5e1badcc3695de4a865cffb30f0e5057893.zip
Fix relcache invalidation when relfilelocator is updated
In commit af0e7deb4a, I removed a call to RelationCloseSmgr(), because the dangling SMgrRelation was no longer an issue. However, we still need the call when the relation's relfilelocator changes, so that the new relfilelocator takes effect immediately. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: https://www.postgresql.org/message-id/987b1c8c-8c91-4847-ca0e-879f421680ff%40gmail.com
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 35dbb87ae3d..930cc03ee20 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -3060,7 +3060,10 @@ RelationCacheInvalidate(bool debug_discard)
* map doesn't involve any access to relcache entries.
*/
if (RelationIsMapped(relation))
+ {
+ RelationCloseSmgr(relation);
RelationInitPhysicalAddr(relation);
+ }
/*
* Add this entry to list of stuff to rebuild in second pass.