Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 16dcd5e

Browse files
committed
GIN index build's allocatedMemory counter needs to be long, not uint32.
Else, in a 64-bit machine with maintenance_work_mem set to above 4Gb, the counter overflows and we never recognize having reached the maintenance_work_mem limit. I believe this explains out-of-memory failure recently reported by Sean Davis. This is a bug, so backpatch to 8.2.
1 parent 0157945 commit 16dcd5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/include/access/gin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2006-2007, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/include/access/gin.h,v 1.14 2007/11/15 21:14:42 momjian Exp $
7+
* $PostgreSQL: pgsql/src/include/access/gin.h,v 1.15 2007/11/16 21:50:06 tgl Exp $
88
*--------------------------------------------------------------------------
99
*/
1010

@@ -453,7 +453,7 @@ typedef struct
453453
uint32 maxdepth;
454454
EntryAccumulator **stack;
455455
uint32 stackpos;
456-
uint32 allocatedMemory;
456+
long allocatedMemory;
457457

458458
uint32 length;
459459
EntryAccumulator *entryallocator;

0 commit comments

Comments
 (0)