We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c78bb32 commit eb3bd24Copy full SHA for eb3bd24
src/backend/utils/cache/relmapper.c
@@ -949,12 +949,13 @@ relmap_redo(XLogReaderState *record)
949
* preserve files, either.
950
*
951
* There shouldn't be anyone else updating relmaps during WAL replay,
952
- * so we don't bother to take the RelationMappingLock. We would need
953
- * to do so if load_relmap_file needed to interlock against writers.
+ * but grab the lock to interlock against load_relmap_file().
954
*/
+ LWLockAcquire(RelationMappingLock, LW_EXCLUSIVE);
955
write_relmap_file((xlrec->dbid == InvalidOid), &newmap,
956
false, true, false,
957
xlrec->dbid, xlrec->tsid, dbpath);
958
+ LWLockRelease(RelationMappingLock);
959
960
pfree(dbpath);
961
}
0 commit comments