aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer
Commit message (Collapse)AuthorAge
...
* Revise FlushRelationBuffers/ReleaseRelationBuffers per discussion withTom Lane2000-05-19
| | | | | | | | | | | | | | | | | | | | | Hiroshi. ReleaseRelationBuffers now removes rel's buffers from pool, instead of merely marking them nondirty. The old code would leave valid buffers for a deleted relation, which didn't cause any known problems but can't possibly be a good idea. There were several places which called ReleaseRelationBuffers *and* FlushRelationBuffers, which is now unnecessary; but there were others that did not. FlushRelationBuffers no longer emits a warning notice if it finds dirty buffers to flush, because with the current bufmgr behavior that's not an unexpected condition. Also, FlushRelationBuffers will flush out all dirty buffers for the relation regardless of block number. This ensures that pg_upgrade's expectations are met about tuple on-row status bits being up-to-date on disk. Lastly, tweak BufTableDelete() to clear the buffer's tag so that no one can mistake it for being a still-valid buffer for the page it once held. Formerly, the buffer would not be found by buffer hashtable searches after BufTableDelete(), but it would still be thought to belong to its old relation by the routines that sequentially scan the shared-buffer array. Again I know of no bugs caused by that, but it still can't be a good idea.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Tweak smgrblindwrt per advice from Vadim: add parameter indicatingTom Lane2000-04-10
| | | | | | whether to do fsync or not, and if so (which should be seldom) just do the fsync immediately. This way we need not build data structures in md.c/fd.c for blind writes.
* Buffer manager modifications to keep a local buffer-dirtied bit as wellTom Lane2000-04-09
| | | | | | | | as a shared dirtybit for each shared buffer. The shared dirtybit still controls writing the buffer, but the local bit controls whether we need to fsync the buffer's file. This arrangement fixes a bug that allowed some required fsyncs to be missed, and should improve performance as well. For more info see my post of same date on pghackers.
* Get rid of SetBufferWriteMode(), which was an accident waiting to happen.Tom Lane2000-03-31
| | | | | | | | In the event of an elog() while the mode was set to immediate write, there was no way for it to be set back to the normal delayed write. The mechanism was a waste of space and cycles anyway, since the only user was varsup.c, which could perfectly well call FlushBuffer directly. Now it does just that, and the notion of a write mode is gone.
* Marginal performance improvement in LockBuffer --- calculate addressTom Lane2000-03-14
| | | | | | of BufferLocks[] entry just once. Seems to save 10% or so of the routine's runtime, which'd not be worth worrying about if it weren't such a hotspot.
* Oops, commited a test version of this file by accident. Revert.Tom Lane2000-02-21
|
* Change parse-time representation of float literals (which include oversizeTom Lane2000-02-21
| | | | | | | | integers) to be strings instead of 'double'. We convert from string form to internal representation only after type resolution has determined the correct type for the constant. This eliminates loss-of-precision worries and gets rid of the change in behavior seen at 17 digits with the previous kluge.
* Fix assert bug(was my fault)Hiroshi Inoue2000-02-17
|
* Add:Bruce Momjian2000-01-26
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* Fix for TODO item * spinlock stuck problem when elog(FATAL)Hiroshi Inoue2000-01-17
| | | | and elog(ERROR) inside bufmgr.
* Fixed all elog related warnings, as well as a few others.Peter Eisentraut2000-01-15
|
* Fix it's and its to be correct.Bruce Momjian2000-01-05
|
* New LDOUT makefile variable for QNX os.Bruce Momjian1999-12-13
|
* Make LD -r as macros that can be changed for QNX.Bruce Momjian1999-12-09
|
* Come to think of it, DropBuffers() could have the same problem asTom Lane1999-11-22
| | | | | ReleaseRelationBuffers --- need to wait if anyone is trying to flush out that buffer.
* ReleaseRelationBuffers() failed to check for I/O in progress on a bufferTom Lane1999-11-22
| | | | | | | it wants to release. This leads to a race condition: does the backend that's trying to flush the buffer do so before the one that's deleting the relation does so? Usually no problem, I expect, but on occasion this could lead to hard-to-reproduce complaints from md.c, especially mdblindwrt.
* Commit to make clearer distinction for temp names and real names.Bruce Momjian1999-11-16
| | | | Thanks to Tom Lane for ideas.
* New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian1999-11-07
| | | | | | Fewer calls to nameout. Better use of RelationGetRelationName.
* XLOG (also known as WAL -:)) Bootstrap/Startup/Shutdown.Vadim B. Mikheev1999-10-06
| | | | | First step in cleaning up backend initialization code. Fix for FATAL: now FATAL is ERROR + exit.
* Make tree compilable (+WAL).Vadim B. Mikheev1999-09-28
|
* Several changes here, not very related but touching some of the same files.Tom Lane1999-09-24
| | | | | | | | | | | | | | | | | | | | | * Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-18
| | | | | | | | | | | | | | | | | additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* Add config.h as needed.Bruce Momjian1999-07-17
|
* Final cleanup.Bruce Momjian1999-07-16
|
* Update #include cleanupsBruce Momjian1999-07-16
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-15
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-15
|
* More cpu cleanups, only for 6.6.Bruce Momjian1999-07-13
|
* Avoid disk writes for read-only transactions.Vadim B. Mikheev1999-06-29
|
* Add var defines for no testandsetBruce Momjian1999-06-26
|
* Move default NBuffers setting into config.h, and rename itTom Lane1999-06-12
| | | | | to DEF_NBUFFERS for readability. Make sure the default value is OK according to postmaster.c's new sanity check for -B values.
* Removed bad Assert(!buf->ri_lock) when unlocking exclusivelyVadim B. Mikheev1999-06-11
| | | | locked buffer.
* 1. Fix for elog(ERROR, "EvalPlanQual: t_xmin is uncommitted ?!")Vadim B. Mikheev1999-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and possibly for other cases too: DO NOT cache status of transaction in unknown state (i.e. non-committed and non-aborted ones) Example: T1 reads row updated/inserted by running T2 and cache T2 status. T2 commits. Now T1 reads a row updated by T2 and with HEAP_XMAX_COMMITTED in t_infomask (so cached T2 status is not changed). Now T1 EvalPlanQual gets updated row version without HEAP_XMIN_COMMITTED -> TransactionIdDidCommit(t_xmin) and TransactionIdDidAbort(t_xmin) return FALSE and T2 decides that t_xmin is not committed and gets ERROR above. It's too late to find more smart way to handle such cases and so I just changed xact status caching and got rid TransactionIdFlushCache() from code. Changed: transam.c, xact.c, lmgr.c and transam.h - last three just because of TransactionIdFlushCache() is removed. 2. heapam.c: T1 marked a row for update. T2 waits for T1 commit/abort. T1 commits. T3 updates the row before T2 locks row page. Now T2 sees that new row t_xmax is different from xact id (T1) T2 was waiting for. Old code did Assert here. New one goes to HeapTupleSatisfiesUpdate. Obvious changes too. 3. Added Assert to vacuum.c 4. bufmgr.c: break Assert(buf->r_locks == 0 && !buf->ri_lock) into two Asserts.
* 1. xact.c: update comments about changing MyProc->xid and MyProc->xmin.Vadim B. Mikheev1999-06-06
| | | | | | | | | | | 2. varsup.c:ReadNewTransactionId(): don't read nextXid from disk - this func doesn't allocate next xid, so ShmemVariableCache->nextXid may be used (but GetNewTransactionId() must be called first). 3. vacuum.c: change elog(ERROR, "Child item....") to elog(NOTICE) - this is not ERROR, proper handling is just not implemented, yet. 4. s_lock.c: increase S_MAX_BUSY by 2 times. 5. shmem.c:GetSnapshotData(): have to call ReadNewTransactionId() _after_ SpinAcquire(ShmemIndexLock).
* Missing semicolons in non-HAS_TEST_AND_SET code paths :-(Tom Lane1999-05-29
|
* Make 0x007f -> (unsigned)0x7f to make pgindent happy.Bruce Momjian1999-05-25
|
* pgindent run over code.Bruce Momjian1999-05-25
|
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-10
| | | | real affect now.
* 1. Vacuum is updated for MVCC.Vadim B. Mikheev1999-03-28
| | | | | | | 2. Much faster btree tuples deletion in the case when first on page index tuple is deleted (no movement to the left page(s)). 3. Remember blkno of new root page in BTPageOpaque of left/right siblings when root page is splitted.
* We have tested the patches on three platforms:Bruce Momjian1999-03-14
| | | | | | | | | | | | | NetBSD/macppc LinuxPPC FreeBSD 2.2.6-RELEASE All of them seem happy with the regression test. Note that, however, compiling with optimization enabled on NetBSD/macppc causes an initdb failure (other two platforms are ok). After checking the asm code, we are suspecting that might be a compiler(egcs) bug. Tatsuo Ishii
* Repair some pretty serious problems in dynahash.c andTom Lane1999-02-22
| | | | | | shared memory space allocation. It's a wonder we have not seen bug reports traceable to this area ... it's quite clear that the routine dir_realloc() has never worked correctly, for example.
* From: Tatsuo Ishii <t-ishii@sra.co.jp>Marc G. Fournier1999-02-21
| | | | | | Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef NOT_USED" for current. I have tested these patches in that the postgres binaries are identical.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-03
|
* Add TEMP tables/indexes. Add COPY pfree(). Other cleanups.Bruce Momjian1999-02-02
|
* Replace direct inclusions of c.h with inclusion of postgres.h,Tom Lane1999-01-17
| | | | to ensure that config.h is included as well.
* Long awaited port for NetBSD/m68k was finally done by Mr. MutsukiBruce Momjian1998-12-26
| | | | | | | | | | Nakajima. Since he is not subscribing the mailing list, I'm posting his patches by his request. According to him, he has successfully compiled and passed the regression test on Mac SE/30 running NetBSD/m68k. Also, another person has reported that with the patches PostgreSQL is working on NetBSD/sun3 too. -- Tatsuo Ishii
* I have ported PostgreSQL 6.4 to Cobalt Qube running Linux 2.0.33 withBruce Momjian1998-12-18
| | | | | | | MIPS cpu (I think it's R4000). I have tested the patches on LinuxPPC and FreeBSD. I believe they do not harm other platforms. -- Tatsuo Ishii