Thom Brown wrote:

> Hit another issue with exactly the same procedure:
> 
> pgbench=# create index minmaxtest on pgbench_accounts using minmax (aid);
> ERROR:  lock 176475 is not held

That's what I get for restructuring the way buffers are acquired to use
the FSM, and then neglecting to test creation on decently-sized indexes.
Fix attached.

I just realized that xlog replay is also broken.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
diff --git a/src/backend/access/minmax/minmax.c b/src/backend/access/minmax/minmax.c
index 3b41100..47cb05e 100644
--- a/src/backend/access/minmax/minmax.c
+++ b/src/backend/access/minmax/minmax.c
@@ -1510,10 +1510,8 @@ mm_getinsertbuffer(Relation irel, Buffer *buffer, Size itemsz)
 		}
 
 		if (!BufferIsInvalid(*buffer))
-		{
-			MarkBufferDirty(*buffer);
-			UnlockReleaseBuffer(*buffer);
-		}
+			ReleaseBuffer(*buffer);
+
 		*buffer = buf;
 	}
 	else
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to