Correct value of LW_SHARED_MASK.
authorAndres Freund <andres@anarazel.de>
Tue, 22 Sep 2015 09:05:48 +0000 (11:05 +0200)
committerAndres Freund <andres@anarazel.de>
Tue, 22 Sep 2015 09:14:14 +0000 (11:14 +0200)
The previous wrong value lead to wrong LOCK_DEBUG output, never showing
any shared lock holders.

Reported-By: Alexander Korotkov
Discussion: CAPpHfdsPmWqz9FB0AnxJrwp1=KLF0n=-iB+QvR0Q8GSmpFVdUQ@mail.gmail.com
Backpatch: 9.5, where the bug was introduced.

src/backend/storage/lmgr/lwlock.c

index 9179d1b356b930dd2de5682e8b57c72daad1fa2a..fd4b479f10c9611c6ec35a3f349abefdffbf4a8b 100644 (file)
@@ -107,7 +107,7 @@ extern slock_t *ShmemLock;
 
 #define LW_LOCK_MASK               ((uint32) ((1 << 25)-1))
 /* Must be greater than MAX_BACKENDS - which is 2^23-1, so we're fine. */
-#define LW_SHARED_MASK             ((uint32)(1 << 23))
+#define LW_SHARED_MASK             ((uint32) ((1 << 24)-1))
 
 /*
  * This is indexed by tranche ID and stores metadata for all tranches known