Skip to content

Commit 4bc15a8

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 0f95b72 commit 4bc15a8

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
@@ -238,7 +238,7 @@ typedef struct
238238
uint32 count[FAST_PATH_STRONG_LOCK_HASH_PARTITIONS];
239239
} FastPathStrongRelationLockData;
240240

241-
static FastPathStrongRelationLockData *FastPathStrongRelationLocks;
241+
static volatile FastPathStrongRelationLockData *FastPathStrongRelationLocks;
242242

243243

244244
/*

0 commit comments

Comments
 (0)