Skip to content

Commit e980ec7

Browse files
committed
Mark FastPathStrongRelationLocks volatile.
Otherwise, the compiler might decide to move modifications to data within this structure outside the enclosing SpinLockAcquire / SpinLockRelease pair, leading to shared memory corruption. This may or may not explain a recent lmgr-related buildfarm failure on prairiedog, but it needs to be fixed either way.
1 parent 6a63dda commit e980ec7

File tree

1 file changed

+1
-1
lines changed
  • src/backend/storage/lmgr

1 file changed

+1
-1
lines changed

src/backend/storage/lmgr/lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ typedef struct
237237
uint32 count[FAST_PATH_STRONG_LOCK_HASH_PARTITIONS];
238238
} FastPathStrongRelationLockData;
239239

240-
FastPathStrongRelationLockData *FastPathStrongRelationLocks;
240+
volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks;
241241

242242

243243
/*

0 commit comments

Comments
 (0)