[BUGS] [PATCH] Don't bail with legitimate -N/-B options

2008-02-16 Thread Andreas Kling

Greetings,

Starting PostgreSQL 8.3.0 with the default options used by Gentoo Linux 
(-N 40 -B 80) causes it to bail with an error message.


"the number of buffers (-B) must be at least twice the number of allowed 
connections (-N) and at least 16"


The problem is that NBuffers is actually "max autovacuum connections" + 
NBuffers.


My attached patch fixes this by adding "max autovacuum connections" * 2 
to NBuffers before the check.


Best regards,
Andreas Kling
ACG Nyström AB
Index: src/backend/postmaster/postmaster.c
===
--- src/backend/postmaster/postmaster.c	(revision 30129)
+++ src/backend/postmaster/postmaster.c	(working copy)
@@ -685,6 +685,9 @@ PostmasterMain(int argc, char *argv[])
 	/* And switch working directory into it */
 	ChangeToDataDir();
 
+	/* Add buffers to accomodate backends "reserved" for autovacuum */
+	NBuffers += autovacuum_max_workers * 2;
+
 	/*
 	 * Check for invalid combinations of GUC settings.
 	 */

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [BUGS] [PATCH] Don't bail with legitimate -N/-B options

2008-02-16 Thread Andreas Kling

Magnus Hagander wrote:
Anybody know *why* Gentoo does such a thing? Having shared buffers at 
the very lowest possible boundary just seems counterproductive.  Plus, 
the normal way to set these things would be in postgresql.conf, why 
override them on the commandline?


It's not the first time I've seen people complain about this, it'd be 
good to know why.
It's been brought up on the Gentoo bugzilla 
(http://bugs.gentoo.org/show_bug.cgi?id=206725), so hopefully something 
will come of that.


Those are not comments on the actual patch, of course. For that one, 
it looks to me like it's the wrong fix. I don't think we should be 
adding to shared buffers like that - if somebody asked for a specific 
value they should get that. But in that case the error message needs 
to be changed, since it's misleading.

If we follow that logic, there shouldn't be an error message at all. ;-)

Cheers,
Andreas

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly