Skip to content

Commit 441ef5e

Browse files
committed
Fix relcache invalidation when relfilelocator is updated
In commit af0e7de, 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
1 parent 90fe7b7 commit 441ef5e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/utils/cache/relcache.c

+3
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,10 @@ RelationCacheInvalidate(bool debug_discard)
30603060
* map doesn't involve any access to relcache entries.
30613061
*/
30623062
if (RelationIsMapped(relation))
3063+
{
3064+
RelationCloseSmgr(relation);
30633065
RelationInitPhysicalAddr(relation);
3066+
}
30643067

30653068
/*
30663069
* Add this entry to list of stuff to rebuild in second pass.

0 commit comments

Comments
 (0)