summaryrefslogtreecommitdiff
path: root/src/backend/access/transam
AgeCommit message (Collapse)Author
2001-04-05Fix comment that Vadim found confusing.Tom Lane
2001-04-05StartupXLOG(): initialize XLogCtl->Insert to new page if there isVadim B. Mikheev
no room for a record on last log page.
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-18Remove NEXTXID xlog record type to avoid three-way deadlock risk.Tom Lane
NEXTXID isn't really necessary, per previous discussion in pghackers, but I mulishy insisted we should put it in anyway. Mea culpa.
2001-03-18Make sure ControlFile logId/logSeg don't go backwards (barely possible given aTom Lane
slow backend, if we update unconditionally as the code did before).
2001-03-17Rearrange XLogFileInit so that control-file spinlock is not held while fillingTom Lane
the new log file with zeroes, only while renaming it into place. This should prevent problems with 'stuck spinlock' errors under heavy load.
2001-03-16Support syncing WAL log to disk using either fsync(), fdatasync(),Tom Lane
O_SYNC, or O_DSYNC (as available on a given platform). Add GUC parameter to control sync method. Also, add defense to XLogWrite to prevent it from going nuts if passed a target write position that's past the end of the buffers so far filled by XLogInsert.
2001-03-14Use SEP_CHAR consistently in forming XLOG pathnames.Tom Lane
2001-03-13Change xlog page-header format to include StartUpID. Use the SUI toTom Lane
detect case that next page in log came from an older run than the prior page. This avoids the necessity to re-zero the log after recovery from a crash, which is good because we need not risk destroying valuable log information. This forces another initdb since yesterday :-(. Need to get that log reset utility done...
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-02-26Implement COMMIT_SIBLINGS parameter to allow pre-commit delay to occurTom Lane
only if at least N other backends currently have open transactions. This is not a great deal of intelligence about whether a delay might be profitable ... but it beats no intelligence at all. Note that the default COMMIT_DELAY is still zero --- this new code does nothing unless that setting is changed. Also, mark ENABLEFSYNC as a system-wide setting. It's no longer safe to allow that to be set per-backend, since we may be relying on some other backend's fsync to have synced the WAL log.
2001-02-22Avoid 'FATAL: out of free buffers: time to abort !" errorHiroshi Inoue
during WAL recovery. Recovery failure is always serious.
2001-02-18Change default commit_delay to zero, update documentation.Tom Lane
2001-02-18Change s_lock to not use any zero-delay select() calls; these are just aTom Lane
waste of cycles on single-CPU machines, and of dubious utility on multi-CPU machines too. Tweak s_lock_stuck so that caller can specify timeout interval, and increase interval before declaring stuck spinlock for buffer locks and XLOG locks. On systems that have fdatasync(), use that rather than fsync() to sync WAL log writes. Ensure that WAL file is entirely allocated during XLogFileInit.
2001-02-13Comments about GetFreeXLBuffer().Vadim B. Mikheev
GetFreeXLBuffer(): use Insert->LgwrResult instead of private LgwrResult copy if it's more fresh (attempt to avoid acquiring info_lck/lgwr_lck).
2001-02-13Removed abort() in XLogFileOpen.Vadim B. Mikheev
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-19Make critical sections (elog->crash) and interrupt holdoff sectionsTom Lane
into distinct concepts, per recent discussion on pghackers.
2001-01-18Comment out xlrec in xact_redo - no support for file unlinking onVadim B. Mikheev
commit yet.
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-091. Checkpoint.undo may be after checkpoint itself:Vadim B. Mikheev
- no more elog(STOP) in StartupXLOG(); - both checkpoint' undo & redo are used to define oldest on-line log file. 2. Ability to pre-allocate a few log files at checkpoint time (wal_files option). Off by default.
2001-01-02Clean up non-reentrant interface for hash_seq/HashTableWalk, so thatTom Lane
starting a new hashtable search no longer clobbers any other search active anywhere in the system. Fix RelationCacheInvalidate() so that it will not crash or go into an infinite loop if invoked recursively, as for example by a second SI Reset message arriving while we are still processing a prior one.
2000-12-30Fixed misprint in heap update WALoging.Vadim B. Mikheev
2000-12-29Fix failure in CreateCheckPoint on some Alpha boxes --- it's not OK toTom Lane
assume that TAS() will always succeed the first time, even if the lock is known to be free. Also, make sure that code will eventually time out and report a stuck spinlock, rather than looping forever. Small cleanups in s_lock.h, too.
2000-12-28New WAL version - CRC and data blocks backup.Vadim B. Mikheev
2000-12-22Revise lock manager to support "session level" locks as well as "transactionTom Lane
level" locks. A session lock is not released at transaction commit (but it is released on transaction abort, to ensure recovery after an elog(ERROR)). In VACUUM, use a session lock to protect the master table while vacuuming a TOAST table, so that the TOAST table can be done in an independent transaction. I also took this opportunity to do some cleanup and renaming in the lock code. The previously noted bug in ProcLockWakeup, that it couldn't wake up any waiters beyond the first non-wakeable waiter, is now fixed. Also found a previously unknown bug of the same kind (failure to scan all members of a lock queue in some cases) in DeadLockCheck. This might have led to failure to detect a deadlock condition, resulting in indefinite waits, but it's difficult to characterize the conditions required to trigger a failure.
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-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.
2000-12-11Remove elog for online log files.Vadim B. Mikheev
2000-12-11elog(LOG)-->elog(DEBUG) for skipped logs.Vadim B. Mikheev
2000-12-08Resurrect -F switch: it controls fsyncs again, though the fsyncs areTom Lane
mostly just on the WAL logfile nowadays. But if people want to disable fsync for performance, why should we say no?
2000-12-07RecordTransactionAbort() shouldn't log XLOG_XACT_ABORTHiroshi Inoue
if the transaction has already been committed ?
2000-12-03Disable elog(ERROR|FATAL) in signal handlers inVadim B. Mikheev
critical sections of code.
2000-11-30No more #ifdef XLOG.Vadim B. Mikheev
2000-11-30XLOG stuff for sequences.Vadim B. Mikheev
CommitDelay in guc.c
2000-11-28Significant cleanups in SysV IPC handling (shared mem and semaphores).Tom Lane
IPC key assignment will now work correctly even when multiple postmasters are using same logical port number (which is possible given -k switch). There is only one shared-mem segment per postmaster now, not 3. Rip out broken code for non-TAS case in bufmgr and xlog, substitute a complete S_LOCK emulation using semaphores in spin.c. TAS and non-TAS logic is now exactly the same. When deadlock is detected, "Deadlock detected" is now the elog(ERROR) message, rather than a NOTICE that comes out before an unhelpful ERROR.
2000-11-27Check for link(2) failure.Tom Lane
2000-11-25Store current LC_COLLATE and LC_CTYPE settings in pg_control during initdb;Tom Lane
re-adopt these settings at every postmaster or standalone-backend startup. This should fix problems with indexes becoming corrupt due to failure to provide consistent locale environment for postmaster at all times. Also, refuse to start up a non-locale-enabled compilation in a database originally initdb'd with a non-C locale. Suppress LIKE index optimization if locale is not "C" or "POSIX" (are there any other locales where it's safe?). Issue NOTICE during initdb if selected locale disables LIKE optimization.
2000-11-21Refine log/error messages. Print out the errno message, not the number.Peter Eisentraut
Remove timestamps from messages where this would be redundant with the log_timestamp option.
2000-11-21Put external declarations into header files.Peter Eisentraut
2000-11-21miscVadim B. Mikheev
2000-11-21Fix OID bootstraping.Vadim B. Mikheev
2000-11-21Init ShmemVariableCache in BootStrapXLOG()Vadim B. Mikheev
(should fix OID bootstraping).
2000-11-20Include postgres.h before checking #ifdef XLOG.Peter Eisentraut
2000-11-20Compile WAL by default.Vadim B. Mikheev
2000-11-16Change SearchSysCache coding conventions so that a reference count isTom Lane
maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
2000-11-16That variable I removed broke XLOG, that part of the deltaBruce Momjian
should have read: Alfred Perlstein
2000-11-16Make pgsql compile on FreeBSD-alpha.Bruce Momjian
Context diff this time. Remove -m486 compile args for FreeBSD-i386, compile -O2 on i386. Compile with only -O on alpha for codegen safety. Make the port use the TEST_AND_SET for alpha and i386 on FreeBSD. Fix a lot of bogus string formats for outputting pointers (cast to int and %u/%x replaced with no cast and %p), and 'Size'(size_t) are now cast to 'unsigned long' and output with %lu/ Remove an unused variable. Alfred Perlstein