summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/sinval.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright for the year 2010.Bruce Momjian2010-01-021-2/+2
|
* Create a multiplexing structure for signals to Postgres child processes.Tom Lane2009-07-311-19/+16
| | | | | | | | | | | | | | | This patch gets us out from under the Unix limitation of two user-defined signal types. We already had done something similar for signals directed to the postmaster process; this adds multiplexing for signals directed to backends and auxiliary processes (so long as they're connected to shared memory). As proof of concept, replace the former usage of SIGUSR1 and SIGUSR2 for backends with use of the multiplexing mechanism. There are still some hard-wired definitions of SIGUSR1 and SIGUSR2 for other process types, but getting rid of those doesn't seem interesting at the moment. Fujii Masao
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-111-11/+12
| | | | provided by Andrew.
* Update copyright for 2009.Bruce Momjian2009-01-011-2/+2
|
* Revert SIGUSR1 multiplexing patch, per Tom's objection.Heikki Linnakangas2008-12-091-10/+13
|
* Provide support for multiplexing SIGUSR1 signal. The upcoming synchronousHeikki Linnakangas2008-12-091-13/+10
| | | | | | replication patch needs a signal, but we've already used SIGUSR1 and SIGUSR2 in normal backends. This patch allows reusing SIGUSR1 for that, and for other purposes too if the need arises.
* Rewrite the sinval messaging mechanism to reduce contention and avoidTom Lane2008-06-191-37/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | unnecessary cache resets. The major changes are: * When the queue overflows, we only issue a cache reset to the specific backend or backends that still haven't read the oldest message, rather than resetting everyone as in the original coding. * When we observe backend(s) falling well behind, we signal SIGUSR1 to only one backend, the one that is furthest behind and doesn't already have a signal outstanding for it. When it finishes catching up, it will in turn signal SIGUSR1 to the next-furthest-back guy, if there is one that is far enough behind to justify a signal. The PMSIGNAL_WAKEN_CHILDREN mechanism is removed. * We don't attempt to clean out dead messages after every message-receipt operation; rather, we do it on the insertion side, and only when the queue fullness passes certain thresholds. * Split SInvalLock into SInvalReadLock and SInvalWriteLock so that readers don't block writers nor vice versa (except during the infrequent queue cleanout operations). * Transfer multiple sinval messages for each acquisition of a read or write lock.
* Move ProcState definition into sinvaladt.c from sinvaladt.h, since it's notAlvaro Herrera2008-03-171-3/+1
| | | | | | needed anywhere after my previous patch. Noticed by Tom Lane. Also, remove #include <signal.h> from sinval.c.
* Modify interactions between sinval.c and sinvaladt.c. The code that actuallyAlvaro Herrera2008-03-161-54/+4
| | | | | | | | deals with the queue, including locking etc, is all in sinvaladt.c. This means that the struct definition of the queue, and the queue pointer, are now internal "implementation details" inside sinvaladt.c. Per my proposal dated 25-Jun-2007 and followup discussion.
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-011-2/+2
|
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-051-2/+2
| | | | back-stamped for this.
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-141-2/+1
|
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-051-2/+2
|
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-221-16/+16
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-151-52/+47
|
* Convert the arithmetic for shared memory size calculation from 'int'Tom Lane2005-08-201-3/+3
| | | | | | | | | | | to 'Size' (that is, size_t), and install overflow detection checks in it. This allows us to remove the former arbitrary restrictions on NBuffers etc. It won't make any difference in a 32-bit machine, but in a 64-bit machine you could theoretically have terabytes of shared buffers. (How efficiently we could manage 'em remains to be seen.) Similarly, num_temp_buffers, work_mem, and maintenance_work_mem can be set above 2Gb on a 64-bit machine. Original patch from Koichi Suzuki, additional work by moi.
* Split the shared-memory array of PGPROC pointers out of the sinvalTom Lane2005-05-191-760/+4
| | | | | | communication structure, and make it its own module with its own lock. This should reduce contention at least a little, and it definitely makes the code seem cleaner. Per my recent proposal.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-311-2/+2
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* RecentXmin is too recent to use as the cutoff point for accessingTom Lane2004-09-161-11/+23
| | | | | | | pg_subtrans --- what we need is the oldest xmin of any snapshot in use in the current top transaction. Introduce a new variable TransactionXmin to play this role. Fixes intermittent regression failure reported by Neil Conway.
* Fix a number of places where brittle data structures or overly strongTom Lane2004-09-061-5/+12
| | | | | | | | | Asserts would lead to a server core dump if an error occurred while trying to abort a failed subtransaction (thereby leading to re-execution of whatever parts of AbortSubTransaction had already run). This of course does not prevent such an error from creating an infinite loop, but at least we don't make the situation worse. Responds to an open item on the subtransactions to-do list.
* Pgindent run for 8.0.Bruce Momjian2004-08-291-71/+70
|
* Update copyright to 2004.Bruce Momjian2004-08-291-2/+2
|
* Rearrange pg_subtrans handling as per recent discussion. pg_subtransTom Lane2004-08-231-2/+15
| | | | | | | updates are no longer WAL-logged nor even fsync'd; we do not need to, since after a crash no old pg_subtrans data is needed again. We truncate pg_subtrans to RecentGlobalXmin at each checkpoint. slru.c's API is refactored a little bit to separate out the necessary decisions.
* Tweak code so that pg_subtrans is never consulted for XIDs older thanTom Lane2004-08-221-2/+4
| | | | | | | | | | RecentXmin (== MyProc->xmin). This ensures that it will be safe to truncate pg_subtrans at RecentGlobalXmin, which should largely eliminate any fear of bloat. Along the way, eliminate SubTransXidsHaveCommonAncestor, which isn't really needed and could not give a trustworthy result anyway under the lookback restriction. In an unrelated but nearby change, #ifdef out GetUndoRecPtr, which has been dead code since 2001 and seems unlikely to ever be resurrected.
* Xmin calculations should consider only top transaction IDs, andTom Lane2004-08-151-3/+3
| | | | | | therefore starting with GetCurrentTransactionId is wrong. Fixes miscomputation of RecentGlobalXmin leading to bizarre behavior reported by Gavin Sherry.
* Some mop-up work for savepoints (nested transactions). Store a smallTom Lane2004-08-011-75/+227
| | | | | | | | | | | | number of active subtransaction XIDs in each backend's PGPROC entry, and use this to avoid expensive probes into pg_subtrans during TransactionIdIsInProgress. Extend EOXactCallback API to allow add-on modules to get control at subxact start/end. (This is deliberately not compatible with the former API, since any uses of that API probably need manual review anyway.) Add basic reference documentation for SAVEPOINT and related commands. Minor other cleanups to check off some of the open issues for subtransactions. Alvaro Herrera and Tom Lane.
* Fix seriously nasty memory leak in new TransactionIdIsInProgress code.Tom Lane2004-07-011-4/+9
|
* Nested transactions. There is still much left to do, especially on theTom Lane2004-07-011-8/+85
| | | | | | | performance front, but with feature freeze upon us I think it's time to drive a stake in the ground and say that this will be in 7.5. Alvaro Herrera, with some help from Tom Lane.
* Per previous discussions, here are two functions to send INT and TERMBruce Momjian2004-06-021-1/+35
| | | | | | | (cancel and terminate) signals to other backends. They permit only INT and TERM, and permits sending only to postgresql backends. Magnus Hagander
* Handle impending sinval queue overflow by means of a separate signalTom Lane2004-05-231-1/+230
| | | | | | | | | | | | | | | | | (SIGUSR1, which we have not been using recently) instead of piggybacking on SIGUSR2-driven NOTIFY processing. This has several good results: the processing needed to drain the sinval queue is a lot less than the processing needed to answer a NOTIFY; there's less contention since we don't have a bunch of backends all trying to acquire exclusive lock on pg_listener; backends that are sitting inside a transaction block can still drain the queue, whereas NOTIFY processing can't run if there's an open transaction block. (This last is a fairly serious issue that I don't think we ever recognized before --- with clients like JDBC that tend to sit with open transaction blocks, the sinval queue draining mechanism never really worked as intended, probably resulting in a lot of useless cache-reset overhead.) This is the last of several proposed changes in response to Philip Warner's recent report of sinval-induced performance problems.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-291-1/+1
|
* Repair RI trigger visibility problems (this time for sure ;-)) per recentTom Lane2003-10-011-5/+5
| | | | | | | discussion on pgsql-hackers: in READ COMMITTED mode we just have to force a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have to run the scan under a current snapshot and then complain if any rows would be updated/deleted that are not visible in the transaction snapshot.
* Repair some REINDEX problems per recent discussions. The relcache isTom Lane2003-09-241-1/+7
| | | | | | | | | | | | | now able to cope with assigning new relfilenode values to nailed-in-cache indexes, so they can be reindexed using the fully crash-safe method. This leaves only shared system indexes as special cases. Remove the 'index deactivation' code, since it provides no useful protection in the shared- index case. Require reindexing of shared indexes to be done in standalone mode, but remove other restrictions on REINDEX. -P (IgnoreSystemIndexes) now prevents using indexes for lookups, but does not disable index updates. It is therefore safe to allow from PGOPTIONS. Upshot: reindexing system catalogs can be done without a standalone backend for all cases except shared catalogs.
* Update copyrights to 2003.Bruce Momjian2003-08-041-2/+2
|
* pgindent run.Bruce Momjian2003-08-041-5/+4
|
* Error message editing in backend/storage.Tom Lane2003-07-241-6/+10
|
* Up to now, SerializableSnapshot and QuerySnapshot are malloc'ed andBruce Momjian2003-06-121-8/+18
| | | | | | | | | free'd for every transaction or statement, respectively. This patch puts these data structures into static memory, thus saving a few CPU cycles and two malloc calls per transaction or (in isolation level READ COMMITTED) per query. Manfred Koizar
* Make debug_ GUC varables output DEBUG1 rather than LOG, and mention inBruce Momjian2003-05-271-3/+3
| | | | | docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location. Doc changes included.
* btree page recycling can be done as soon as page's next-xact label isTom Lane2003-02-231-3/+6
| | | | | older than current Xmin; we don't have to wait till it's older than GlobalXmin.
* Code review for superuser_reserved_connections patch. Don't try to doTom Lane2002-11-211-7/+6
| | | | | | database access outside a transaction; revert bogus performance improvement in SIBackendInit(); improve comments; add documentation (this part courtesy Neil Conway).
* pgindent run.Bruce Momjian2002-09-041-9/+10
|
* Remove sys/types.h in files that include postgres.h, and hence c.h,Bruce Momjian2002-09-021-2/+1
| | | | because c.h has sys/types.h.
* This patch reserves the last superuser_reserved_connections slots forBruce Momjian2002-08-291-1/+25
| | | | | | | | | | | | | | | | | | | connections by the superuser only. This patch replaces the last patch I sent a couple of days ago. It closes a connection that has not been authorised by a superuser if it would leave less than the GUC variable ReservedBackends (superuser_reserved_connections in postgres.conf) backend process slots free in the SISeg. This differs to the first patch which only reserved the last ReservedBackends slots in the procState array. This has made the free slot test more expensive due to the use of a lock. After thinking about a comment on the first patch I've also made it a fatal error if the number of reserved slots is not less than the maximum number of connections. Nigel J. Andrews
* Update copyright to 2002.Bruce Momjian2002-06-201-2/+2
|
* Katherine Ward wrote:Jan Wieck2002-06-111-14/+14
| | | | | | | | | | | | | | > Changes to avoid collisions with WIN32 & MFC names... > 1. Renamed: > a. PROC => PGPROC > b. GetUserName() => GetUserNameFromId() > c. GetCurrentTime() => GetCurrentDateTime() > d. IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim > > 2. Added _P to some lex/yacc tokens: > CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT Jan
* Mark index entries "killed" when they are no longer visible to anyTom Lane2002-05-241-8/+35
| | | | | | | | | | | | | | | transaction, so as to avoid returning them out of the index AM. Saves repeated heap_fetch operations on frequently-updated rows. Also detect queries on unique keys (equality to all columns of a unique index), and don't bother continuing scan once we have found first match. Killing is implemented in the btree and hash AMs, but not yet in rtree or gist, because there isn't an equally convenient place to do it in those AMs (the outer amgetnext routine can't do it without re-pinning the index page). Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and index_insert to make this a little easier.
* Remove global variable scanCommandId in favor of storing a command IDTom Lane2002-05-211-1/+4
| | | | | | | | | | | in snapshots, per my proposal of a few days ago. Also, tweak heapam.c routines (heap_insert, heap_update, heap_delete, heap_mark4update) to be passed the command ID to use, instead of doing GetCurrentCommandID. For catalog updates they'll still get passed current command ID, but for updates generated from the main executor they'll get passed the command ID saved in the snapshot the query is using. This should fix some corner cases associated with functions and triggers that advance current command ID while an outer query is still in progress.
* Some kibitzing about appropriate elog levels for sinval messages.Tom Lane2002-03-021-3/+3
|
* Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian2002-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | now just below FATAL in server_min_messages. Added more text to highlight ordering difference between it and client_min_messages. --------------------------------------------------------------------------- REALLYFATAL => PANIC STOP => PANIC New INFO level the prints to client by default New LOG level the prints to server log by default Cause VACUUM information to print only to the client NOTICE => INFO where purely information messages are sent DEBUG => LOG for purely server status messages DEBUG removed, kept as backward compatible DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added DebugLvl removed in favor of new DEBUG[1-5] symbols New server_min_messages GUC parameter with values: DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC New client_min_messages GUC parameter with values: DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC Server startup now logged with LOG instead of DEBUG Remove debug_level GUC parameter elog() numbers now start at 10 Add test to print error message if older elog() values are passed to elog() Bootstrap mode now has a -d that requires an argument, like postmaster
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-251-23/+25
| | | | tests pass.