1. 03 3月, 2002 1 次提交
    • B
      Commit to match discussed elog() changes. Only update is that LOG is · a033daf5
      Bruce Momjian 提交于
      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
      a033daf5
  2. 18 2月, 2002 1 次提交
    • B
      Add better error text: · c4488473
      Bruce Momjian 提交于
                      elog(LOG, "XLogWrite: new log file created - "
                           "consider increasing 'wal_files' in postgresql.conf.");
      c4488473
  3. 15 1月, 2002 1 次提交
  4. 29 12月, 2001 1 次提交
    • T
      Ensure that all direct uses of spinlock-protected data structures use · d3fc362e
      Tom Lane 提交于
      'volatile' pointers to access those structures, so that optimizing
      compilers will not decide to move the structure accesses outside of the
      spinlock-acquire-to-spinlock-release sequence.  There are no known bugs
      in these uses at present, but based on bad experience with lwlock.c,
      it seems prudent to ensure that we protect these other uses too.
      Per pghackers discussion around 12-Dec.  (Note: it should not be
      necessary to worry about structures protected by LWLocks, since the
      LWLock acquire and release operations are not inline macros.)
      d3fc362e
  5. 23 12月, 2001 1 次提交
  6. 20 12月, 2001 1 次提交
  7. 06 11月, 2001 1 次提交
  8. 05 11月, 2001 1 次提交
    • T
      Merge three existing ways of signaling postmaster from child processes, · fb5f1b2c
      Tom Lane 提交于
      so that only one signal number is used not three.  Flags in shared
      memory tell the reason(s) for the current signal.  This method is
      extensible to handle more signal reasons without chewing up even more
      signal numbers, but the immediate reason is to keep pg_pwd reloads
      separate from SIGHUP processing in the postmaster.
      Also clean up some problems in the postmaster with delayed response to
      checkpoint status changes --- basically, it wouldn't schedule a checkpoint
      if it wasn't getting connection requests on a regular basis.
      fb5f1b2c
  9. 28 10月, 2001 1 次提交
  10. 25 10月, 2001 1 次提交
  11. 29 9月, 2001 1 次提交
    • T
      Implement new 'lightweight lock manager' that's intermediate between · 499abb0c
      Tom Lane 提交于
      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.
      499abb0c
  12. 27 9月, 2001 1 次提交
  13. 06 9月, 2001 1 次提交
  14. 26 8月, 2001 1 次提交
    • T
      Replace implementation of pg_log as a relation accessed through the · 2589735d
      Tom Lane 提交于
      buffer manager with 'pg_clog', a specialized access method modeled
      on pg_xlog.  This simplifies startup (don't need to play games to
      open pg_log; among other things, OverrideTransactionSystem goes away),
      should improve performance a little, and opens the door to recycling
      commit log space by removing no-longer-needed segments of the commit
      log.  Actual recycling is not there yet, but I felt I should commit
      this part separately since it'd still be useful if we chose not to
      do transaction ID wraparound.
      2589735d
  15. 24 8月, 2001 1 次提交
  16. 11 8月, 2001 1 次提交
    • T
      Make OIDs optional, per discussions in pghackers. WITH OIDS is still the · bf56f075
      Tom Lane 提交于
      default, but OIDS are removed from many system catalogs that don't need them.
      Some interesting side effects: TOAST pointers are 20 bytes not 32 now;
      pg_description has a three-column key instead of one.
      
      Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey
      has some usefulness; pg_dump dumps comments on indexes, rules, and
      triggers in a valid order.
      
      initdb forced.
      bf56f075
  17. 23 7月, 2001 1 次提交
  18. 19 7月, 2001 1 次提交
    • T
      Arrange to recycle old XLOG log segment files as new segment files, · 7d4d5c00
      Tom Lane 提交于
      rather than deleting them only to have to create more.  Steady state
      is 2*CHECKPOINT_SEGMENTS + WAL_FILES + 1 segment files, which will
      simply be renamed rather than constantly deleted and recreated.
      To make this safe, added current XLOG file/offset number to page
      header of XLOG pages, so that an un-overwritten page from an old
      incarnation of a logfile can be reliably told from a valid page.
      This change means that if you try to restart postmaster in a CVS-tip
      database after installing the change, you'll get a complaint about
      bad XLOG page magic number.  If you don't want to initdb, run
      contrib/pg_resetxlog (and be sure you shut down the old postmaster
      cleanly).
      7d4d5c00
  19. 22 6月, 2001 1 次提交
  20. 07 6月, 2001 1 次提交
    • T
      Adjust WAL code so that checkpoints truncate the xlog at the previous · 1173344e
      Tom Lane 提交于
      checkpoint's redo pointer, not its undo pointer, per discussion in
      pghackers a few days ago.  No point in hanging onto undo information
      until we have the ability to do something with it --- and this solves
      a rather large problem with log space for long-running transactions.
      Also, change all calls of write() to detect the case where write
      returned a count less than requested, but failed to set errno.
      Presume that this situation indicates ENOSPC, and give the appropriate
      error message, rather than a random message associated with the previous
      value of errno.
      1173344e
  21. 03 6月, 2001 1 次提交
  22. 30 5月, 2001 1 次提交
  23. 23 5月, 2001 1 次提交
  24. 06 4月, 2001 1 次提交
  25. 05 4月, 2001 1 次提交
  26. 22 3月, 2001 1 次提交
  27. 19 3月, 2001 1 次提交
  28. 18 3月, 2001 2 次提交
  29. 16 3月, 2001 1 次提交
    • T
      Support syncing WAL log to disk using either fsync(), fdatasync(), · 9d645fd8
      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.
      9d645fd8
  30. 15 3月, 2001 1 次提交
  31. 14 3月, 2001 1 次提交
    • T
      Change xlog page-header format to include StartUpID. Use the SUI to · 1b87e24c
      Tom 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...
      1b87e24c
  32. 13 3月, 2001 1 次提交
    • T
      XLOG (and related) changes: · 4d14fe00
      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.
      4d14fe00
  33. 26 2月, 2001 1 次提交
    • T
      Implement COMMIT_SIBLINGS parameter to allow pre-commit delay to occur · 9c993658
      Tom 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.
      9c993658
  34. 18 2月, 2001 1 次提交
    • T
      Change s_lock to not use any zero-delay select() calls; these are just a · 33cc5d8a
      Tom 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.
      33cc5d8a
  35. 14 2月, 2001 1 次提交
  36. 13 2月, 2001 1 次提交
  37. 25 1月, 2001 1 次提交
  38. 14 1月, 2001 1 次提交
  39. 13 1月, 2001 1 次提交
    • T
      Add more critical-section calls: all code sections that hold spinlocks · 6162432d
      Tom 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().
      6162432d