Thread: pgsql/src/backend/postmaster (postmaster.c)
Date: Tuesday, June 27, 2000 @ 23:31:54 Author: tgl Update of /home/projects/pgsql/cvsroot/pgsql/src/backend/postmaster from hub.org:/home/projects/pgsql/tmp/cvs-serv57303/src/backend/postmaster Modified Files: postmaster.c ----------------------------- Log Message ----------------------------- First phase of memory management rewrite (see backend/utils/mmgr/README for details). It doesn't really do that much yet, since there are no short-term memory contexts in the executor, but the infrastructure is in place and long-term contexts are handled reasonably. A few long- standing bugs have been fixed, such as 'VACUUM; anything' in a single query string crashing. Also, out-of-memory is now considered a recoverable ERROR, not FATAL. Eliminate a large amount of crufty, now-dead code in and around memory management. Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and backend startup.
PGPORT environment variable is ignored again. PostPortName seems to be reset in ResetAllOptions(). Regards. Hiroshi Inoue Inoue@tpf.co.jp > -----Original Message----- > From: pgsql-committers-owner@hub.org [mailto:pgsql-committers-owner@hub. > org]On Behalf Of Tom Lane > Sent: Wednesday, June 28, 2000 12:32 PM > To: pgsql-committers@postgresql.org > Subject: [COMMITTERS] pgsql/src/backend/postmaster (postmaster.c) > > > Date: Tuesday, June 27, 2000 @ 23:31:54 > Author: tgl > > Update of /home/projects/pgsql/cvsroot/pgsql/src/backend/postmaster > from > hub.org:/home/projects/pgsql/tmp/cvs-serv57303/src/backend/postmaster > > Modified Files: > postmaster.c > > ----------------------------- Log Message ----------------------------- > > First phase of memory management rewrite (see backend/utils/mmgr/README > for details). It doesn't really do that much yet, since there are no > short-term memory contexts in the executor, but the infrastructure is > in place and long-term contexts are handled reasonably. A few long- > standing bugs have been fixed, such as 'VACUUM; anything' in a single > query string crashing. Also, out-of-memory is now considered a > recoverable ERROR, not FATAL. > Eliminate a large amount of crufty, now-dead code in and around > memory management. > Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and > backend startup. >
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes: > PGPORT environment variable is ignored again. > PostPortName seems to be reset in ResetAllOptions(). Think you want to complain to Peter, not me. I haven't been touching any options-handling code... regards, tom lane
> -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > > "Hiroshi Inoue" <Inoue@tpf.co.jp> writes: > > PGPORT environment variable is ignored again. > > PostPortName seems to be reset in ResetAllOptions(). > > Think you want to complain to Peter, not me. I haven't been touching > any options-handling code... > Seems you have changed the position of ResetAllOptions() as follows. @@ -378,15 +378,38 @@ */ umask((mode_t) 0077); - ResetAllOptions(); - MyProcPid = getpid(); + + /* + * Fire up essential subsystems: error and memory management + */ + EnableExceptionHandling(true); + MemoryContextInit(); + + /* + * By default, palloc() requests in the postmaster will be allocated + * in the PostmasterContext, which is space that can be recycled by + * backends. Allocated data that needs to be available to backends + * should be allocated in TopMemoryContext. + */ + PostmasterContext = AllocSetContextCreate(TopMemoryContext, + "Postmaster", + ALLOCSET_DEFAULT_MINSIZE, + ALLOCSET_DEFAULT_INITSIZE, + ALLOCSET_DEFAULT_MAXSIZE); + MemoryContextSwitchTo(PostmasterContext); + + /* + * Options setup + */ if (getenv("PGDATA")) DataDir = strdup(getenv("PGDATA")); /* default value */ if (getenv("PGPORT")) PostPortName = atoi(getenv("PGPORT")); + ResetAllOptions(); +
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes: > Seems you have changed the position of ResetAllOptions() as follows. > + /* > + * Options setup > + */ > if (getenv("PGDATA")) > DataDir = strdup(getenv("PGDATA")); /* default value */ > if (getenv("PGPORT")) > PostPortName = atoi(getenv("PGPORT")); > + ResetAllOptions(); Hmm, actually I was trying to move it to after the memory-context creation code, but I guess your point is that ResetAllOptions() is ignoring these env-var-based settings. Seems like the correct fix is that guc.c ought to be handling this logic, not postmaster.c. Peter, what do you think? regards, tom lane
On Mon, 3 Jul 2000, Tom Lane wrote: > Hmm, actually I was trying to move it to after the memory-context > creation code, but I guess your point is that ResetAllOptions() is > ignoring these env-var-based settings. Seems like the correct fix > is that guc.c ought to be handling this logic, not postmaster.c. > Peter, what do you think? I concur. -- Peter Eisentraut Sernanders vaeg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden
eisentrp@csis.gvsu.edu writes: >> ... Seems like the correct fix >> is that guc.c ought to be handling this logic, not postmaster.c. >> Peter, what do you think? > I concur. OK, do you want to fix it, or shall I? BTW, it is now possible for guc.c to use palloc in TopMemoryContext, if you want to do that. There's no real functional difference between that and malloc --- except that MemoryContextStats() could include the space used by guc.c --- but if it's just irritating you to use malloc then you could change it. regards, tom lane
Tom Lane writes: > OK, do you want to fix it, or shall I? I will. I got some half-finished code lying around that touches that. > BTW, it is now possible for guc.c to use palloc in TopMemoryContext, > if you want to do that. There's no real functional difference between > that and malloc --- except that MemoryContextStats() could include > the space used by guc.c --- but if it's just irritating you to use > malloc then you could change it. Well, I would really like a way to register an entire memory context to be swept away by elog(ERROR). But that's probably too specialized. But yes, I will look into that. -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden