summaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
AgeCommit message (Collapse)Author
2002-01-01Do not accept interrupts in RESUME_INTERRUPTS() and END_CRIT_SECTION()Tom Lane
macros, but only at explicit CHECK_FOR_INTERRUPTS() calls. Not clear whether overenthusiastic acceptance of interrupts accounts for any real bugs, but it definitely seems risky and unnecessary.
2001-12-04Replace pq_getbytes(&ch, 1) calls with pq_getbyte(), which is easierTom Lane
to use and significantly faster. This tweak saves 25% (!) of the runtime of COPY IN in a test with 8000-character lines. I wouldn't normally commit a performance improvement this late in the cycle, but 25% got my attention...
2001-11-10Clean up usage-statistics display code (ShowUsage and friends). StatFpTom Lane
is gone, usage messages now go through elog(DEBUG).
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-10-28Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian
spacing. Also adds space for one-line comments.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-10-21Fix getopt-vs-init_ps_display problem by copying original argv[] info,Tom Lane
per suggestion from Peter. Simplify several APIs by transmitting the original argv location directly from main.c to ps_status.c, instead of passing it down through several levels of subroutines.
2001-10-19Set optreset on platforms that have it before launching postmasterTom Lane
subprocesses; perhaps this will fix portability problem just noted by Lockhart. Also, move test for bad permissions of DataDir to a more logical place.
2001-10-19Ensure that all startup paths (postmaster, standalone postgres, orTom Lane
bootstrap) check for a valid PG_VERSION file before looking at anything else in the data directory. This fixes confusing error report when trying to start current sources in a pre-7.1 data directory. Per trouble report from Rich Shepard 10/18/01.
2001-10-19Move init_ps_display from postgres.c to postmaster.c, putting itTom Lane
just after receipt of the startup packet. Now, postmaster children that are waiting for client authentication response will show as 'postgres: user database host authentication'. Also, do an init_ps_display for startup/shutdown/checkpoint subprocesses, so that they are readily identifiable as well. Fix an obscure race condition that could lead to Assert failure in the postmaster --- attempting to start a checkpoint process before any connections have been received led to calling PostmasterRandom before setting random_seed.
2001-09-27Remove useless LockDisable() function and associated overhead, per myTom Lane
proposal of 26-Aug.
2001-09-21Add an overall timeout on the client authentication cycle, so thatTom Lane
a hung client or lost connection can't indefinitely block a postmaster child (not to mention the possibility of deliberate DoS attacks). Timeout is controlled by new authentication_timeout GUC variable, which I set to 60 seconds by default ... does that seem reasonable?
2001-09-08Clean up some confusion about where and how to set whereToSendOutput.Tom Lane
We will no longer try to send elog messages to the client before we have initialized backend libpq (oops); however, reporting bogus commandline switches via elog does work now (not irrelevant, because of PGOPTIONS). Fix problem with inappropriate sending of checkpoint-process messages to stderr.
2001-09-07Enable SIGTERM and SIGQUIT during client authentication soJan Wieck
the postmaster can kill the forked off processes when shutdown is requested. Jan
2001-08-04Fix handling of SIGCHLD, per recent pghackers discussion: on someTom Lane
platforms system(2) gets confused unless the signal handler is set to SIG_DFL, not SIG_IGN. pgstats.c now uses pqsignal() as it should, not signal(). Also, arrange for the stats collector process to show a reasonable ID in 'ps', rather than looking like a postmaster.
2001-07-31Cleanup code for preparsing pg_hba.conf and pg_ident.conf. Store lineTom Lane
number in the data structure so that we can give at least a minimally useful idea of where the mistake is when we issue syntax error messages. Move the ClientAuthentication() call to where it should have been in the first place, so that postmaster memory releasing can happen in a reasonable place also. Update obsolete comments, correct one real bug (auth_argument was not picked up correctly).
2001-07-30Load pg_hba.conf and pg_ident.conf on startup and SIGHUP into List ofBruce Momjian
Lists, and use that for user validation. Bruce Momjian
2001-06-29Fix erroneous GUC variable references from commandline-GUC patch.Tom Lane
2001-06-25Fix a couple remaining places where GUC variables were assigned toTom Lane
directly, rather than through SetConfigOption().
2001-06-23> Marko Kreen <marko@l-t.ee> writes:Bruce Momjian
> > secure_ctx changes too. it will be PGC_BACKEND after '-p'. > > Oh, okay, I missed that part. Could we see the total state of the > patch --- ie, a diff against current CVS, not a bunch of deltas? > I've gotten confused about what's in and what's out. Ok, here it is. Cleared the ctx comment too - after -p it will be PGC_BACKEND in any case. Marko Kreen
2001-06-22Statistical system views (yet without the config stuff, butJan Wieck
it's hard to keep such massive changes in sync with the tree so I need to get it in and work from there now). Jan
2001-06-20Handle reading of startup packet and authentication exchange after forkingPeter Eisentraut
a new postmaster child process. This should eliminate problems with authentication blocking (e.g., ident, SSL init) and also reduce problems with the accept queue filling up under heavy load. The option to send elog output to a different file per backend (postgres -o) has been disabled for now because the initialization would have to happen in a different order and it's not clear we want to keep this anyway.
2001-06-19Back out SET ALL patch because it is breaking things.Bruce Momjian
2001-06-18RESET ALL secondary patch:Bruce Momjian
Here is Tomified version of my 2 pending patches. Dropped the set_.._real change as it is not needed. Desc would be: * use GUC for settings from cmdline Marko Kreen
2001-06-12Extend GUC concepts of parse_hook and assign_hook to all four supportedTom Lane
datatypes, not only strings. parse_hook is useless for bool, I suppose, but it seems possibly useful for int and double to apply variable-specific constraints that are more complex than simple range limits. assign_hook is definitely useful for all datatypes --- we need it right now for bool to support date cache reset when changing Australian timezone rule setting. Also, clean up some residual problems with the reset all/show all patch, including memory leaks and mistaken reset of PostPortNumber. It seems best that RESET ALL not touch variables that don't have SUSET or USERSET context.
2001-06-07reset all: command line and .conf options change defaultsBruce Momjian
on RESET ALL those are restored. show all: GUC + non-GUC. SHOW ALL, RESET ALL Marko Kreen
2001-04-14Add debug_query_string global variable for pgmonitor and debugging use.Bruce Momjian
2001-03-26Add period to message.Bruce Momjian
2001-03-26Change message to _the_ administrator. There is only one administrativeBruce Momjian
account. This connection has been terminated by the administrator.
2001-03-23Mark exception and assert global variables as DLLIMPORT, so that plpgsqlTom Lane
can be compiled with asserts enabled on Windoze.
2001-03-22Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-03-14'waiting' status display had extra space, removed.Bruce Momjian
Change the administrator to 'an' administrator.
2001-03-14New shutdown wording:Bruce Momjian
This connection has been terminated by the administrator
2001-03-13XLOG (and related) changes:Tom Lane
* Store two past checkpoint locations, not just one, in pg_control. On startup, we fall back to the older checkpoint if the newer one is unreadable. Also, a physical copy of the newest checkpoint record is kept in pg_control for possible use in disaster recovery (ie, complete loss of pg_xlog). Also add a version number for pg_control itself. Remove archdir from pg_control; it ought to be a GUC parameter, not a special case (not that it's implemented yet anyway). * Suppress successive checkpoint records when nothing has been entered in the WAL log since the last one. This is not so much to avoid I/O as to make it actually useful to keep track of the last two checkpoints. If the things are right next to each other then there's not a lot of redundancy gained... * Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs on alternate bytes. Polynomial borrowed from ECMA DLT1 standard. * Fix XLOG record length handling so that it will work at BLCKSZ = 32k. * Change XID allocation to work more like OID allocation. (This is of dubious necessity, but I think it's a good idea anyway.) * Fix a number of minor bugs, such as off-by-one logic for XLOG file wraparound at the 4 gig mark. * Add documentation and clean up some coding infelicities; move file format declarations out to include files where planned contrib utilities can get at them. * Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or every CHECKPOINT_TIMEOUT seconds, whichever comes first. It is also possible to force a checkpoint by sending SIGUSR1 to the postmaster (undocumented feature...) * Defend against kill -9 postmaster by storing shmem block's key and ID in postmaster.pid lockfile, and checking at startup to ensure that no processes are still connected to old shmem block (if it still exists). * Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency stop, for symmetry with postmaster and xlog utilities. Clean up signal handling in bootstrap.c so that xlog utilities launched by postmaster will react to signals better. * Standalone bootstrap now grabs lockfile in target directory, as added insurance against running it in parallel with live postmaster.
2001-03-09hold interupts during LockWaitCancel().Hiroshi Inoue
2001-02-24When under postmaster, bogus arguments should cause proc_exit(0) notTom Lane
proc_exit(1). Unless you think a system-wide restart is an appropriate response to bogus PGOPTIONS, that is.
2001-02-18Remove bogus set_ps_display call --- changing displayed status here isTom Lane
either wrong or unnecessary in most cases, and on systems where setting status takes a kernel call, the overhead of setting status three times per command rather than two is annoying.
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-24Add "idle in transaction" status messageBruce Momjian
2001-01-24Fix formatting of db crash.Bruce Momjian
2001-01-19Make critical sections (elog->crash) and interrupt holdoff sectionsTom Lane
into distinct concepts, per recent discussion on pghackers.
2001-01-16Oops, I had managed to break query-cancel-while-waiting-for-lock.Tom Lane
2001-01-14Restructure backend SIGINT/SIGTERM handling so that 'die' interruptsTom Lane
are treated more like 'cancel' interrupts: the signal handler sets a flag that is examined at well-defined spots, rather than trying to cope with an interrupt that might happen anywhere. See pghackers discussion of 1/12/01.
2001-01-12Add more critical-section calls: all code sections that hold spinlocksTom Lane
are now critical sections, so as to ensure die() won't interrupt us while we are munging shared-memory data structures. Avoid insecure intermediate states in some code that proc_exit will call, like palloc/pfree. Rename START/END_CRIT_CODE to START/END_CRIT_SECTION, since that seems to be what people tend to call them anyway, and make them be called with () like a function call, in hopes of not confusing pg_indent. I doubt that this is sufficient to make SIGTERM safe anywhere; there's just too much code that could get invoked during proc_exit().
2001-01-07Fix recent breakage of query-cancel logic, see my pghackers messageTom Lane
of 6 Jan 2001 21:55.
2000-12-20Prevent freshly-started backend from ignoring SIGUSR1, per race conditionTom Lane
observed by Inoue. Also, don't call ProcRemove() from postmaster if we have detected a backend crash --- too risky if shared memory is corrupted. It's not needed anyway, considering we are going to reinitialize shared memory and semaphores as soon as the last child is dead.
2000-12-18>> Here is a patch for the beos port (All regression tests are OK).Bruce Momjian
>> xlog.c : special case for beos to avoid 'link' which does not work yet >> beos/sem.c : implementation of new sem_ctl call (GETPID) and a new >sem_op >> flag (IPCNOWAIT) >> dynloader/beos.c : add a verification of symbol validity (seem that the >> loader sometime return OK with an invalid symbol) >> postmaster.c : add beos forking support for the new checkpoint process >> postgres.c : remove beos special case for getrusage >> beos.h : Correction of a bas definition of AF_UNIX, misc defnitions >> >> >> thanks >> >> >> cyril Cyril VELTER
2000-12-18Ensure that 'errno' is saved and restored by all signal handlers thatTom Lane
might change it. Experimentation shows that the signal handler call mechanism does not save/restore errno for you, at least not on Linux or HPUX, so this is definitely a real risk.
2000-12-18Clean up backend-exit-time cleanup behavior. Use on_shmem_exit callbacksTom Lane
to ensure that we have released buffer refcounts and so forth, rather than putting ad-hoc operations before (some of the calls to) proc_exit. Add commentary to discourage future hackers from repeating that mistake.