Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30df79a

Browse files
committed
Widen the nLocks counts in local lock tables from int to int64. This
forestalls potential overflow when the same table (or other object, butusually tables) is accessed by very many successive queries within a singletransaction. Per report from Michael Milligan.Back-patch to 8.0, which is as far back as the patch conveniently applies.There have been no reports of overflow in pre-8.3 releases, but clearly therisk existed all along. (Michael's report suggests that 8.3 may consume lockcounts faster than prior releases, but with no test case to look at it's hardto be sure about that. Widening the counts seems a good future-proofingmeasure in any event.)
1 parent8948ee3 commit30df79a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/include/storage/lock.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.113 2008/05/12 00:00:54 alvherre Exp $
10+
* $PostgreSQL: pgsql/src/include/storage/lock.h,v 1.114 2008/09/16 01:56:26 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -391,7 +391,7 @@ typedef struct LOCALLOCKOWNER
391391
* Must use a forward struct reference to avoid circularity.
392392
*/
393393
structResourceOwnerData*owner;
394-
intnLocks;/* # of times held by this owner */
394+
int64nLocks;/* # of times held by this owner */
395395
}LOCALLOCKOWNER;
396396

397397
typedefstructLOCALLOCK
@@ -403,7 +403,7 @@ typedef struct LOCALLOCK
403403
LOCK*lock;/* associated LOCK object in shared mem */
404404
PROCLOCK*proclock;/* associated PROCLOCK object in shmem */
405405
uint32hashcode;/* copy of LOCKTAG's hash value */
406-
intnLocks;/* total number of times lock is held */
406+
int64nLocks;/* total number of times lock is held */
407407
intnumLockOwners;/* # of relevant ResourceOwners */
408408
intmaxLockOwners;/* allocated size of array */
409409
LOCALLOCKOWNER*lockOwners;/* dynamically resizable array */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp