We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6d8d20 commit 9b8ed0fCopy full SHA for 9b8ed0f
src/backend/utils/cache/relmapper.c
@@ -1030,12 +1030,13 @@ relmap_redo(XLogReaderState *record)
1030
* preserve files, either.
1031
*
1032
* There shouldn't be anyone else updating relmaps during WAL replay,
1033
- * so we don't bother to take the RelationMappingLock. We would need
1034
- * to do so if load_relmap_file needed to interlock against writers.
+ * but grab the lock to interlock against load_relmap_file().
1035
*/
+ LWLockAcquire(RelationMappingLock, LW_EXCLUSIVE);
1036
write_relmap_file((xlrec->dbid == InvalidOid), &newmap,
1037
false, true, false,
1038
xlrec->dbid, xlrec->tsid, dbpath);
1039
+ LWLockRelease(RelationMappingLock);
1040
1041
pfree(dbpath);
1042
}
0 commit comments