1. 23 3月, 2007 1 次提交
  2. 07 3月, 2007 1 次提交
  3. 06 3月, 2007 1 次提交
  4. 04 3月, 2007 3 次提交
  5. 02 3月, 2007 1 次提交
    • T
      Suppress useless searches for unused line pointers in PageAddItem. To do · fb276438
      Tom Lane 提交于
      this, add a 16-bit "flags" field to page headers by stealing some bits from
      pd_tli.  We use one flag bit as a hint to indicate whether there are any
      unused line pointers; the remaining 15 are available for future use.
      
      This is a cut-down form of an idea proposed by Hiroki Kataoka in July 2005.
      At the time it was rejected because the original patch increased the size of
      page headers and it wasn't clear that the benefit outweighed the distributed
      cost.  The flag-bit approach gets most of the benefit without requiring an
      increase in the page header size.
      
      Heikki Linnakangas and Tom Lane
      fb276438
  6. 28 2月, 2007 2 次提交
    • M
      Remove temporary Windows-specific debugging code. · 2c6feff5
      Magnus Hagander 提交于
      2c6feff5
    • T
      Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). · 234a02b2
      Tom Lane 提交于
      Get rid of VARATT_SIZE and VARATT_DATA, which were simply redundant with
      VARSIZE and VARDATA, and as a consequence almost no code was using the
      longer names.  Rename the length fields of struct varlena and various
      derived structures to catch anyplace that was accessing them directly;
      and clean up various places so caught.  In itself this patch doesn't
      change any behavior at all, but it is necessary infrastructure if we hope
      to play any games with the representation of varlena headers.
      Greg Stark and Tom Lane
      234a02b2
  7. 22 2月, 2007 1 次提交
    • B
      btree source code cleanups: · 6f519ad0
      Bruce Momjian 提交于
      I refactored findsplitloc and checksplitloc so that the division of
      labor is more clear IMO. I pushed all the space calculation inside the
      loop to checksplitloc.
      
      I also fixed the off by 4 in free space calculation caused by
      PageGetFreeSpace subtracting sizeof(ItemIdData), even though it was
      harmless, because it was distracting and I felt it might come back to
      bite us in the future if we change the page layout or alignments.
      There's now a new function PageGetExactFreeSpace that doesn't do the
      subtraction.
      
      findsplitloc now tries the "just the new item to right page" split as
      well. If people don't like the refactoring, I can write a patch to just
      add that.
      
      Heikki Linnakangas
      6f519ad0
  8. 21 2月, 2007 1 次提交
  9. 16 2月, 2007 1 次提交
    • A
      Restructure autovacuum in two processes: a dummy process, which runs · 18206509
      Alvaro Herrera 提交于
      continuously, and requests vacuum runs of "autovacuum workers" to postmaster.
      The workers do the actual vacuum work.  This allows for future improvements,
      like allowing multiple autovacuum jobs running in parallel.
      
      For now, the code keeps the original behavior of having a single autovac
      process at any time by sleeping until the previous worker has finished.
      18206509
  10. 09 2月, 2007 1 次提交
  11. 02 2月, 2007 1 次提交
    • B
      Wording cleanup for error messages. Also change can't -> cannot. · 8b4ff8b6
      Bruce Momjian 提交于
      Standard English uses "may", "can", and "might" in different ways:
      
              may - permission, "You may borrow my rake."
      
              can - ability, "I can lift that log."
      
              might - possibility, "It might rain today."
      
      Unfortunately, in conversational English, their use is often mixed, as
      in, "You may use this variable to do X", when in fact, "can" is a better
      choice.  Similarly, "It may crash" is better stated, "It might crash".
      8b4ff8b6
  12. 25 1月, 2007 1 次提交
  13. 21 1月, 2007 1 次提交
  14. 18 1月, 2007 1 次提交
  15. 17 1月, 2007 1 次提交
    • T
      Revise bgwriter fsync-request mechanism to improve robustness when a table · 6d660587
      Tom Lane 提交于
      is deleted.  A backend about to unlink a file now sends a "revoke fsync"
      request to the bgwriter to make it clean out pending fsync requests.  There
      is still a race condition where the bgwriter may try to fsync after the unlink
      has happened, but we can resolve that by rechecking the fsync request queue
      to see if a revoke request arrived meanwhile.  This eliminates the former
      kluge of "just assuming" that an ENOENT failure is okay, and lets us handle
      the fact that on Windows it might be EACCES too without introducing any
      questionable assumptions.  After an idea of mine improved by Magnus.
      
      The HEAD patch doesn't apply cleanly to 8.2, but I'll see about a back-port
      later.  In the meantime this could do with some testing on Windows; I've been
      able to force it through the code path via ENOENT, but that doesn't prove that
      it actually fixes the Windows problem ...
      6d660587
  16. 16 1月, 2007 1 次提交
  17. 10 1月, 2007 2 次提交
  18. 06 1月, 2007 1 次提交
  19. 04 1月, 2007 1 次提交
    • T
      Clean up smgr.c/md.c APIs as per discussion a couple months ago. Instead of · ef072219
      Tom Lane 提交于
      having md.c return a success/failure boolean to smgr.c, which was just going
      to elog anyway, let md.c issue the elog messages itself.  This allows better
      error reporting, particularly in cases such as "short read" or "short write"
      which Peter was complaining of.  Also, remove the kluge of allowing mdread()
      to return zeroes from a read-beyond-EOF: this is now an error condition
      except when InRecovery or zero_damaged_pages = true.  (Hash indexes used to
      require that behavior, but no more.)  Also, enforce that mdwrite() is to be
      used for rewriting existing blocks while mdextend() is to be used for
      extending the relation EOF.  This restriction lets us get rid of the old
      ad-hoc defense against creating huge files by an accidental reference to
      a bogus block number: we'll only create new segments in mdextend() not
      mdwrite() or mdread().  (Again, when InRecovery we allow it anyway, since
      we need to allow updates of blocks that were later truncated away.)
      Also, clean up the original makeshift patch for bug #2737: move the
      responsibility for padding relation segments to full length into md.c.
      ef072219
  20. 28 12月, 2006 1 次提交
    • T
      Modify local buffer management to request memory for local buffers in blocks · 72619f81
      Tom Lane 提交于
      of increasing size, instead of one at a time.  This reduces the memory
      management overhead when num_temp_buffers is large: in the previous coding
      we would actually waste 50% of the space used for temp buffers, because aset.c
      would round the individual requests up to 16K.  Problem noted while studying
      a performance issue reported by Steven Flatt.
      
      Back-patch as far as 8.1 --- older versions used few enough local buffers
      that the issue isn't significant for them.
      72619f81
  21. 24 11月, 2006 1 次提交
  22. 22 11月, 2006 1 次提交
    • T
      On systems that have setsid(2) (which should be just about everything except · 3ad0728c
      Tom Lane 提交于
      Windows), arrange for each postmaster child process to be its own process
      group leader, and deliver signals SIGINT, SIGTERM, SIGQUIT to the whole
      process group not only the direct child process.  This provides saner behavior
      for archive and recovery scripts; in particular, it's possible to shut down a
      warm-standby recovery server using "pg_ctl stop -m immediate", since delivery
      of SIGQUIT to the startup subprocess will result in killing the waiting
      recovery_command.  Also, this makes Query Cancel and statement_timeout apply
      to scripts being run from backends via system().  (There is no support in the
      core backend for that, but it's widely done using untrusted PLs.)  Per gripe
      from Stephen Harris and subsequent discussion.
      3ad0728c
  23. 20 11月, 2006 1 次提交
    • T
      When truncating a relation in-place (eg during VACUUM), do not try to unlink · 1a5c450f
      Tom Lane 提交于
      any no-longer-needed segments; just truncate them to zero bytes and leave
      the files in place for possible future re-use.  This avoids problems when
      the segments are re-used due to relation growth shortly after truncation.
      Before, the bgwriter, and possibly other backends, could still be holding
      open file references to the old segment files, and would write dirty blocks
      into those files where they'd disappear from the view of other processes.
      
      Back-patch as far as 8.0.  I believe the 7.x branches are not vulnerable,
      because they had no bgwriter, and "blind" writes by other backends would
      always be done via freshly-opened file references.
      1a5c450f
  24. 07 11月, 2006 1 次提交
  25. 06 11月, 2006 1 次提交
    • T
      Fix recently-understood problems with handling of XID freezing, particularly · 48188e16
      Tom Lane 提交于
      in PITR scenarios.  We now WAL-log the replacement of old XIDs with
      FrozenTransactionId, so that such replacement is guaranteed to propagate to
      PITR slave databases.  Also, rather than relying on hint-bit updates to be
      preserved, pg_clog is not truncated until all instances of an XID are known to
      have been replaced by FrozenTransactionId.  Add new GUC variables and
      pg_autovacuum columns to allow management of the freezing policy, so that
      users can trade off the size of pg_clog against the amount of freezing work
      done.  Revise the already-existing code that forces autovacuum of tables
      approaching the wraparound point to make it more bulletproof; also, revise the
      autovacuum logic so that anti-wraparound vacuuming is done per-table rather
      than per-database.  initdb forced because of changes in pg_class, pg_database,
      and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.
      48188e16
  26. 23 10月, 2006 1 次提交
  27. 16 10月, 2006 1 次提交
    • T
      Redesign the patch for allocation of shmem space and LWLocks for add-on · e0dece12
      Tom Lane 提交于
      modules; the first try was not usable in EXEC_BACKEND builds (e.g.,
      Windows).  Instead, just provide some entry points to increase the
      allocation requests during postmaster start, and provide a dedicated
      LWLock that can be used to synchronize allocation operations performed
      by backends.  Per discussion with Marc Munro.
      e0dece12
  28. 04 10月, 2006 1 次提交
  29. 28 9月, 2006 1 次提交
  30. 26 9月, 2006 1 次提交
  31. 23 9月, 2006 1 次提交
  32. 22 9月, 2006 1 次提交
    • T
      Fix free space map to correctly track the total amount of FSM space needed · 9e936693
      Tom Lane 提交于
      even when a single relation requires more than max_fsm_pages pages.  Also,
      make VACUUM emit a warning in this case, since it likely means that VACUUM
      FULL or other drastic corrective measure is needed.  Per reports from Jeff
      Frost and others of unexpected changes in the claimed max_fsm_pages need.
      9e936693
  33. 19 9月, 2006 1 次提交
    • T
      Add built-in userlock manipulation functions to replace the former · 9b4cda0d
      Tom Lane 提交于
      contrib functionality.  Along the way, remove the USER_LOCKS configuration
      symbol, since it no longer makes any sense to try to compile that out.
      No user documentation yet ... mmoncure has promised to write some.
      Thanks to Abhijit Menon-Sen for creating a first draft to work from.
      9b4cda0d
  34. 18 9月, 2006 1 次提交
    • T
      Marginal cleanup in arrangements for ensuring StrategyHintVacuum is cleared · 2e5e856f
      Tom Lane 提交于
      after an error during VACUUM.  We have a PG_TRY block anyway around the only
      call sites, so just reset it in the CATCH clause instead of having
      AtEOXact_Buffers blindly do it during xact end.  I think the old code was
      actively wrong for the case of a failure during ANALYZE inside a
      subtransaction --- the flag wouldn't get cleared until main transaction end.
      Probably not worth back-patching though.
      2e5e856f
  35. 07 9月, 2006 1 次提交
  36. 03 9月, 2006 1 次提交
    • T
      Arrange for GetSnapshotData to copy live-subtransaction XIDs from the · 8fad2e3f
      Tom Lane 提交于
      PGPROC array into snapshots, and use this information to avoid visits
      to pg_subtrans in HeapTupleSatisfiesSnapshot.  This appears to solve
      the pg_subtrans-related context swap storm problem that's been reported
      by several people for 8.1.  While at it, modify GetSnapshotData to not
      take an exclusive lock on ProcArrayLock, as closer analysis shows that
      shared lock is always sufficient.
      Itagaki Takahiro and Tom Lane
      8fad2e3f