1. 06 Sep, 2004 1 commit
  2. 31 Aug, 2004 1 commit
  3. 29 Aug, 2004 2 commits
  4. 17 Jul, 2004 1 commit
    • Tom Lane's avatar
      Invent ResourceOwner mechanism as per my recent proposal, and use it to · fe548629
      Tom Lane authored
      keep track of portal-related resources separately from transaction-related
      resources.  This allows cursors to work in a somewhat sane fashion with
      nested transactions.  For now, cursor behavior is non-subtransactional,
      that is a cursor's state does not roll back if you abort a subtransaction
      that fetched from the cursor.  We might want to change that later.
      fe548629
  5. 01 Jul, 2004 1 commit
  6. 18 Jun, 2004 1 commit
  7. 11 Jun, 2004 1 commit
    • Tom Lane's avatar
      Add some code to Assert that when we release pin on a buffer, we are · e6cba715
      Tom Lane authored
      not holding the buffer's cntx_lock or io_in_progress_lock.  A recent
      report from Litao Wu makes me wonder whether it is ever possible for
      us to drop a buffer and forget to release its cntx_lock.  The Assert
      does not fire in the regression tests, but that proves little ...
      e6cba715
  8. 31 May, 2004 3 commits
    • Tom Lane's avatar
      Additional mop-up for sync-to-fsync changes: avoid issuing fsyncs for · 91d20ff7
      Tom Lane authored
      temp tables, and avoid WAL-logging truncations of temp tables.  Do issue
      fsync on truncated files (not sure this is necessary but it seems like
      a good idea).
      91d20ff7
    • Tom Lane's avatar
      Minor code rationalization: FlushRelationBuffers just returns void, · e6747079
      Tom Lane authored
      rather than an error code, and does elog(ERROR) not elog(WARNING)
      when it detects a problem.  All callers were simply elog(ERROR)'ing on
      failure return anyway, and I find it hard to envision a caller that would
      not, so we may as well simplify the callers and produce the more useful
      error message directly.
      e6747079
    • Tom Lane's avatar
      Per previous discussions, get rid of use of sync(2) in favor of · 9b178555
      Tom Lane authored
      explicitly fsync'ing every (non-temp) file we have written since the
      last checkpoint.  In the vast majority of cases, the burden of the
      fsyncs should fall on the bgwriter process not on backends.  (To this
      end, we assume that an fsync issued by the bgwriter will force out
      blocks written to the same file by other processes using other file
      descriptors.  Anyone have a problem with that?)  This makes the world
      safe for WIN32, which ain't even got sync(2), and really makes the world
      safe for Unixen as well, because sync(2) never had the semantics we need:
      it offers no way to wait for the requested I/O to finish.
      
      Along the way, fix a bug I recently introduced in xlog recovery:
      file truncation replay failed to clear bufmgr buffers for the dropped
      blocks, which could result in 'PANIC:  heap_delete_redo: no block'
      later on in xlog replay.
      9b178555
  9. 29 May, 2004 1 commit
    • Tom Lane's avatar
      Separate out bgwriter code into a logically separate module, rather · 076a055a
      Tom Lane authored
      than being random pieces of other files.  Give bgwriter responsibility
      for all checkpoint activity (other than a post-recovery checkpoint);
      so this child process absorbs the functionality of the former transient
      checkpoint and shutdown subprocesses.  While at it, create an actual
      include file for postmaster.c, which for some reason never had its own
      file before.
      076a055a
  10. 08 May, 2004 1 commit
    • Tom Lane's avatar
      Get rid of rd_nblocks field in relcache entries. Turns out this was · 4af34211
      Tom Lane authored
      costing us lots more to maintain than it was worth.  On shared tables
      it was of exactly zero benefit because we couldn't trust it to be
      up to date.  On temp tables it sometimes saved an lseek, but not often
      enough to be worth getting excited about.  And the real problem was that
      we forced an lseek on every relcache flush in order to update the field.
      So all in all it seems best to lose the complexity.
      4af34211
  11. 25 Apr, 2004 1 commit
  12. 22 Apr, 2004 1 commit
  13. 21 Apr, 2004 1 commit
    • Tom Lane's avatar
      Another round of code cleanup on bufmgr. Use BM_VALID flag to keep track · 95a03e9c
      Tom Lane authored
      of whether we have successfully read data into a buffer; this makes the
      error behavior a bit more transparent (IMHO anyway), and also makes it
      work correctly for local buffers which don't use Start/TerminateBufferIO.
      Collapse three separate functions for writing a shared buffer into one.
      This overlaps a bit with cleanups that Neil proposed awhile back, but
      seems not to have committed yet.
      95a03e9c
  14. 19 Apr, 2004 1 commit
    • Tom Lane's avatar
      Code review for ARC patch. Eliminate static variables, improve handling · 011c3e62
      Tom Lane authored
      of VACUUM cases so that VACUUM requests don't affect the ARC state at all,
      avoid corner case where BufferSync would uselessly rewrite a buffer that
      no longer contains the page that was to be flushed.  Make some minor
      other cleanups in and around the bufmgr as well, such as moving PinBuffer
      and UnpinBuffer into bufmgr.c where they really belong.
      011c3e62
  15. 12 Feb, 2004 2 commits
  16. 10 Feb, 2004 2 commits
    • Tom Lane's avatar
      Centralize implementation of delay code by creating a pg_usleep() · 58f337a3
      Tom Lane authored
      subroutine in src/port/pgsleep.c.  Remove platform dependencies from
      miscadmin.h and put them in port.h where they belong.  Extend recent
      vacuum cost-based-delay patch to apply to VACUUM FULL, ANALYZE, and
      non-btree index vacuuming.
      
      By the way, where is the documentation for the cost-based-delay patch?
      58f337a3
    • Tom Lane's avatar
      Restructure smgr API as per recent proposal. smgr no longer depends on · 87bd9563
      Tom Lane authored
      the relcache, and so the notion of 'blind write' is gone.  This should
      improve efficiency in bgwriter and background checkpoint processes.
      Internal restructuring in md.c to remove the not-very-useful array of
      MdfdVec objects --- might as well just use pointers.
      Also remove the long-dead 'persistent main memory' storage manager (mm.c),
      since it seems quite unlikely to ever get resurrected.
      87bd9563
  17. 06 Feb, 2004 1 commit
  18. 04 Feb, 2004 1 commit
  19. 30 Jan, 2004 1 commit
  20. 24 Jan, 2004 1 commit
    • Jan Wieck's avatar
      Added GUC variable bgwriter_flush_method controlling the action · d77b63b1
      Jan Wieck authored
      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
      d77b63b1
  21. 09 Jan, 2004 1 commit
  22. 07 Jan, 2004 1 commit
  23. 20 Dec, 2003 1 commit
  24. 14 Dec, 2003 1 commit
    • Neil Conway's avatar
      I posted some bufmgr cleanup a few weeks ago, but it conflicted with · fef0c834
      Neil Conway authored
      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.
      fef0c834
  25. 01 Dec, 2003 1 commit
  26. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  27. 21 Nov, 2003 1 commit
  28. 19 Nov, 2003 1 commit
    • Jan Wieck's avatar
      Background writer process · cfeca621
      Jan Wieck authored
      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
      cfeca621
  29. 13 Nov, 2003 3 commits
  30. 25 Sep, 2003 1 commit
  31. 10 Aug, 2003 1 commit
    • Tom Lane's avatar
      Repair potential deadlock created by recent changes to recycle btree · ffafacc1
      Tom Lane authored
      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.
      ffafacc1
  32. 04 Aug, 2003 2 commits