Commit 16dcd5e5 authored by Tom Lane's avatar Tom Lane

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.
parent 01579454
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Copyright (c) 2006-2007, PostgreSQL Global Development Group * Copyright (c) 2006-2007, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/include/access/gin.h,v 1.14 2007/11/15 21:14:42 momjian Exp $ * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.15 2007/11/16 21:50:06 tgl Exp $
*-------------------------------------------------------------------------- *--------------------------------------------------------------------------
*/ */
...@@ -453,7 +453,7 @@ typedef struct ...@@ -453,7 +453,7 @@ typedef struct
uint32 maxdepth; uint32 maxdepth;
EntryAccumulator **stack; EntryAccumulator **stack;
uint32 stackpos; uint32 stackpos;
uint32 allocatedMemory; long allocatedMemory;
uint32 length; uint32 length;
EntryAccumulator *entryallocator; EntryAccumulator *entryallocator;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment