aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
Commit message (Collapse)AuthorAge
...
* Cost based vacuum delay feature.Jan Wieck2004-02-06
| | | | Jan
* Backing out the background writer sync() option.Jan Wieck2004-02-04
| | | | Jan
* Remove sleep() and use single PG_SLEEP call for Win32 signal handlingBruce Momjian2004-01-30
| | | | | | and consistency. Change PG_USLEEP to use SleepEx() for signal interuptability.
* Added GUC variable bgwriter_flush_method controlling the actionJan Wieck2004-01-24
| | | | | | | | | | | | | done by the background writer between writing dirty blocks and napping. none (default) no action sync bgwriter calls smgrsync() causing a sync(2) A global sync() is only good on dedicated database servers, so more flush methods should be added in the future. Jan
* Change PG_DELAY from msec to usec and use it consistenly rather thanBruce Momjian2004-01-09
| | | | select(). Add Win32 Sleep() for delay.
* More janitorial work: remove the explicit casting of NULL literals to aNeil Conway2004-01-07
| | | | | | | | pointer type when it is not necessary to do so. For future reference, casting NULL to a pointer type is only necessary when (a) invoking a function AND either (b) the function has no prototype OR (c) the function is a varargs function.
* bufmgr.c failed to compile on Darwin, because it didn't includeTom Lane2003-12-20
| | | | <sys/time.h> where struct timeval is defined.
* I posted some bufmgr cleanup a few weeks ago, but it conflicted withNeil Conway2003-12-14
| | | | | | | | | | | | | | | | | | | | | | | | some concurrent changes Jan was making to the bufmgr. Here's an updated version of the patch -- it should apply cleanly to CVS HEAD and passes the regression tests. This patch makes the following changes: - remove the UnlockAndReleaseBuffer() and UnlockAndWriteBuffer() macros, and replace uses of them with calls to the appropriate functions. - remove a bunch of #ifdef BMTRACE code: it is ugly & broken (i.e. it doesn't compile) - make BufferReplace() return a bool, not an int - cleanup some logic in bufmgr.c; should be functionality equivalent to the previous code, just cleaner now - remove the BM_PRIVATE flag as it is unused - improve a few comments, etc.
* Force zero_damaged_pages to be effectively ON during recovery from WAL,Tom Lane2003-12-01
| | | | | since there is no need to worry about damaged pages when we are going to overwrite them anyway from the WAL. Per recent discussion.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Remove unused variable.Tom Lane2003-11-21
|
* Background writer processJan Wieck2003-11-19
| | | | | | | | This first part of the background writer does no syncing at all. It's only purpose is to keep the LRU heads clean so that regular backends seldom to never have to call write(). Jan
* 2nd try for the ARC strategy.Jan Wieck2003-11-13
| | | | | | | | | I added a couple more Assertions while tracking down the exact cause of the former bug. All 93 regression tests pass now. Jan
* ARC strategy backed out ... sorryJan Wieck2003-11-13
| | | | Jan
* Replacement of the buffer replacement strategy with an ARCJan Wieck2003-11-13
| | | | | | algorithm adopted for PostgreSQL. Jan
* Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut2003-09-25
| | | | | terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
* Repair potential deadlock created by recent changes to recycle btreeTom Lane2003-08-10
| | | | | | | | | | index pages: when _bt_getbuf asks the FSM for a free index page, it is possible (and, in some cases, even moderately likely) that the answer will be the same page that _bt_split is trying to split. _bt_getbuf already knew that the returned page might not be free, but it wasn't prepared for the possibility that even trying to lock the page could be problematic. Fix by doing a conditional rather than unconditional grab of the page lock.
* Update copyrights to 2003.Bruce Momjian2003-08-04
|
* pgindent run.Bruce Momjian2003-08-04
|
* Error message editing in backend/storage.Tom Lane2003-07-24
|
* Make use of new error context stack mechanism to allow random errorsTom Lane2003-05-10
| | | | | | | | | | detected during buffer dump to be labeled with the buffer location. For example, if a page LSN is clobbered, we now produce something like ERROR: XLogFlush: request 2C000000/8468EC8 is not satisfied --- flushed only to 0/8468EF0 CONTEXT: writing block 0 of relation 428946/566240 whereas before there was no convenient way to find out which page had been trashed.
* Add code to apply some simple sanity checks to the header fields of aTom Lane2003-03-28
| | | | | | | | page when it's read in, per pghackers discussion around 17-Feb. Add a GUC variable zero_damaged_pages that causes the response to be a WARNING followed by zeroing the page, rather than the normal ERROR; this is per Hiroshi's suggestion that there needs to be a way to get at the data in the rest of the table.
* This trivial patch removes the usage of some old statistics code that noBruce Momjian2003-02-13
| | | | | | | | | longer works -- IncrHeapAccessStat() didn't actually *do* anything anymore, so no reason to keep it around AFAICS. I also fixed a grammatical error in a comment. Neil Conway
* Cosmetic fixes from Neil Conway.Tom Lane2002-09-14
|
* pgindent run.Bruce Momjian2002-09-04
|
* Remove sys/types.h in files that include postgres.h, and hence c.h,Bruce Momjian2002-09-02
| | | | because c.h has sys/types.h.
* Tom Lane wrote:Bruce Momjian2002-08-15
| | | | | | | | | | | | | | | | | > There's no longer a separate call to heap_storage_create in that routine > --- the right place to make the test is now in the storage_create > boolean parameter being passed to heap_create. A simple change, but > it passeth patch's understanding ... Thanks. Attached is a patch against cvs tip as of 8:30 PM PST or so. Turned out that even after fixing the failed hunks, there was a new spot in bufmgr.c which needed to be fixed (related to temp relations; RelationUpdateNumberOfBlocks). But thankfully the regression test code caught it :-) Joe Conway
* Code review of CLUSTER patch. Clean up problems with relcache gettingTom Lane2002-08-11
| | | | confused, toasted data getting lost, etc.
* Restructure local-buffer handling per recent pghackers discussion.Tom Lane2002-08-06
| | | | | | | | | | | | | | The local buffer manager is no longer used for newly-created relations (unless they are TEMP); a new non-TEMP relation goes through the shared bufmgr and thus will participate normally in checkpoints. But TEMP relations use the local buffer manager throughout their lifespan. Also, operations in TEMP relations are not logged in WAL, thus improving performance. Since it's no longer necessary to fsync relations as they move out of the local buffers into shared buffers, quite a lot of smgr.c/md.c/fd.c code is no longer needed and has been removed: there's no concept of a dirty relation anymore in md.c/fd.c, and we never fsync anything but WAL. Still TODO: improve local buffer management algorithms so that it would be reasonable to increase NLocBuffer.
* Minor code cleanup in bufmgr.c and bufmgr.h, mainly by moving repeatedBruce Momjian2002-07-02
| | | | | | | | | lines of code into internal routines (drop_relfilenode_buffers, release_buffer) and by hiding unused routines (PrintBufferDescs, PrintPinnedBufs) behind #ifdef NOT_USED. Remove AbortBufferIO() declaration from bufmgr.c (already declared in bufmgr.h) Manfred Koizar
* Update copyright to 2002.Bruce Momjian2002-06-20
|
* WriteBuffer return value:Bruce Momjian2002-06-15
| | | | | | | >I'd vote for changing WriteBuffer to >return void, and have it elog() on bad argument. Manfred Koizar
* Remove some pre-WAL relics:Bruce Momjian2002-06-15
| | | | | | | | | SharedBufferChanged BufferRelidLastDirtied BufferTagLastDirtied BufferDirtiedByMe Manfred Koizar
* The patch I sent to -patches a little while ago wasn't applied: itBruce Momjian2002-04-15
| | | | | | | | | | was in the thread "make BufferGetBlockNumber() a macro". Tom objected to the original patch, so I prepared a new one which doesn't change BufferGetBlockNumber() into a macro, it just cleans up some comments and fixes an assertion. The patch is attached. Neil Conway
* Change made to elog:Bruce Momjian2002-03-06
| | | | | | | | | | | | | | | | | | | o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
* Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian2002-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Clean up usage-statistics display code (ShowUsage and friends). StatFpTom Lane2001-11-10
| | | | is gone, usage messages now go through elog(DEBUG).
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Implement new 'lightweight lock manager' that's intermediate betweenTom Lane2001-09-29
| | | | | | | | | existing lock manager and spinlocks: it understands exclusive vs shared lock but has few other fancy features. Replace most uses of spinlocks with lightweight locks. All remaining uses of spinlocks have very short lock hold times (a few dozen instructions), so tweak spinlock backoff code to work efficiently given this assumption. All per my proposal on pghackers 26-Sep-01.
* Implement LockBufferForCleanup(), which will allow concurrent VACUUMTom Lane2001-07-06
| | | | | to wait until it's safe to remove tuples and compact free space in a shared buffer page. Miscellaneous small code cleanups in bufmgr, too.
* Make the found-a-buffer-when-we-were-expecting-to-extend-the-rel pathTom Lane2001-07-02
| | | | | actually work. It had been throwing an Assert as of my recent changes to bufmgr.c, but was not really right even before that AFAICT.
* Further work on connecting the free space map (which is still just aTom Lane2001-06-29
| | | | | | | | stub) into the rest of the system. Adopt a cleaner approach to preventing deadlock in concurrent heap_updates: allow RelationGetBufferForTuple to select any page of the rel, and put the onus on it to lock both buffers in a consistent order. Remove no-longer-needed isExtend hack from API of ReleaseAndReadBuffer.
* Statistical system views (yet without the config stuff, butJan Wieck2001-06-22
| | | | | | | 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
* Remove RelationGetBufferWithBuffer(), which is horribly confused aboutTom Lane2001-06-09
| | | | | | | | | appropriate pin-count manipulation, and instead use ReleaseAndReadBuffer. Make use of the fact that the passed-in buffer (if there is one) must be pinned to avoid grabbing the bufmgr spinlock when we are able to return this same buffer. Eliminate unnecessary 'previous tuple' and 'next tuple' fields of HeapScanDesc and IndexScanDesc, thereby removing a whole lot of bookkeeping from heap_getnext() and related routines.
* Modify RelationGetBufferForTuple() so that we only do lseek and lockTom Lane2001-05-12
| | | | | | | | | | | when we need to move to a new page; as long as we can insert the new tuple on the same page as before, we only need LockBuffer and not the expensive stuff. Also, twiddle bufmgr interfaces to avoid redundant lseeks in RelationGetBufferForTuple and BufferAlloc. Successive inserts now require one lseek per page added, rather than one per tuple with several additional ones at each page boundary as happened before. Lock contention when multiple backends are inserting in same table is also greatly reduced.
* Avoid unnecessary lseek() calls by cleanups in md.c. mdfd_lstbcnt wasTom Lane2001-05-10
| | | | | | | | | not being consulted anywhere, so remove it and remove the _mdnblocks() calls that were used to set it. Change smgrextend interface to pass in the target block number (ie, current file length) --- the caller always knows this already, having already done smgrnblocks(), so it's silly to do it over again inside mdextend. Net result: extension of a file now takes one lseek(SEEK_END) and a write(), not three lseeks and a write.
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Check bufHdr->cntxDirty and call StartBufferIO in BufferSync()Vadim B. Mikheev2001-03-21
| | | | | | | | *before* acquiring shlock on buffer context. This way we should be protected against conflicts with FlushRelationBuffers. (Seems we never do excl lock and then StartBufferIO for the same buffer, so there should be no deadlock here, - but we'd better check this very soon).
* Change s_lock to not use any zero-delay select() calls; these are just aTom Lane2001-02-18
| | | | | | | | | | 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.