1. 30 3月, 2011 1 次提交
    • H
      Check that we've reached end-of-backup also when we're not performing · acf47401
      Heikki Linnakangas 提交于
      archive recovery.
      
      It's possible to restore an online backup without recovery.conf, by simply
      copying all the necessary WAL files to pg_xlog. "pg_basebackup -x" does that
      too. That's the use case where this cross-check is useful.
      
      Backpatch to 9.0. We used to do this in earlier versins, but in 9.0 the code
      was inadvertently changed so that the check is only performed after archive
      recovery.
      
      Fujii Masao.
      acf47401
  2. 24 3月, 2011 1 次提交
    • S
      Minor changes to recovery pause behaviour. · b5f2f2a7
      Simon Riggs 提交于
      Change location LOG message so it works each time we pause, not
      just for final pause.
      Ensure that we pause only if we are in Hot Standby and can connect
      to allow us to run resume function. This change supercedes the
      code to override parameter recoveryPauseAtTarget to false if not
      attempting to enter Hot Standby, which is now removed.
      b5f2f2a7
  3. 23 3月, 2011 1 次提交
  4. 21 3月, 2011 1 次提交
  5. 18 3月, 2011 1 次提交
  6. 11 3月, 2011 2 次提交
  7. 08 3月, 2011 2 次提交
    • H
      Truncate predicate lock manager's SLRU lazily at checkpoint. That's safer · 4cd3fb6e
      Heikki Linnakangas 提交于
      than doing it aggressively whenever the tail-XID pointer is advanced, because
      this way we don't need to do it while holding SerializableXactHashLock.
      
      This also fixes bug #5915 spotted by YAMAMOTO Takashi, and removes an
      obsolete comment spotted by Kevin Grittner.
      4cd3fb6e
    • H
      If recovery_target_timeline is set to 'latest' and standby mode is enabled, · 1a4ab9ec
      Heikki Linnakangas 提交于
      periodically rescan the archive for new timelines, while waiting for new WAL
      segments to arrive. This allows you to set up a standby server that follows
      the TLI change if another standby server is promoted to master. Before this,
      you had to restart the standby server to make it notice the new timeline.
      
      This patch only scans the archive for TLI changes, it won't follow a TLI
      change in streaming replication. That is much needed too, but it would be a
      much bigger patch than I dare to sneak in this late in the release cycle.
      
      There was discussion on improving the sanity checking of the WAL segments so
      that the system would notice more reliably if the new timeline isn't an
      ancestor of the current one, but that is not included in this patch.
      
      Reviewed by Fujii Masao.
      1a4ab9ec
  8. 25 2月, 2011 1 次提交
    • R
      Named restore point improvements. · 79ad8fc5
      Robert Haas 提交于
      Emit a log message when creating a named restore point, and improve
      documentation for pg_create_restore_point().
      
      Euler Taveira de Oliveira, 	per suggestions from Thom Brown, with some
      additional wordsmithing by me.
      79ad8fc5
  9. 17 2月, 2011 1 次提交
    • S
      Hot Standby feedback for avoidance of cleanup conflicts on standby. · bca8b7f1
      Simon Riggs 提交于
      Standby optionally sends back information about oldestXmin of queries
      which is then checked and applied to the WALSender's proc->xmin.
      GetOldestXmin() is modified slightly to agree with GetSnapshotData(),
      so that all backends on primary include WALSender within their snapshots.
      Note this does nothing to change the snapshot xmin on either master or
      standby. Feedback piggybacks on the standby reply message.
      vacuum_defer_cleanup_age is no longer used on standby, though parameter
      still exists on primary, since some use cases still exist.
      
      Simon Riggs, review comments from Fujii Masao, Heikki Linnakangas, Robert Haas
      bca8b7f1
  10. 16 2月, 2011 1 次提交
    • R
      pg_ctl promote · 4695da5a
      Robert Haas 提交于
      Fujii Masao, reviewed by Robert Haas, Stephen Frost, and Magnus Hagander.
      4695da5a
  11. 15 2月, 2011 1 次提交
  12. 11 2月, 2011 1 次提交
    • H
      Send status updates back from standby server to master, indicating how far · b186523f
      Heikki Linnakangas 提交于
      the standby has written, flushed, and applied the WAL. At the moment, this
      is for informational purposes only, the values are only shown in
      pg_stat_replication system view, but in the future they will also be needed
      for synchronous replication.
      
      Extracted from Simon riggs' synchronous replication patch by Robert Haas, with
      some tweaking by me.
      b186523f
  13. 09 2月, 2011 3 次提交
  14. 08 2月, 2011 1 次提交
    • S
      Remove rare corner case for data loss when triggering standby server. · faa05505
      Simon Riggs 提交于
      If the standby was streaming when trigger file arrives, check also in the
      archive for additional WAL files. This is a corner case since it is
      unlikely that we would trigger a failover while the master is still
      available and sending data to standby, while at the same time running in
      archive mode and also while the streaming standby has fallen behind archive.
      Someone would eventually be unlucky; we must plug all gaps however small.
      
      Fujii Masao
      faa05505
  15. 03 2月, 2011 1 次提交
    • R
      Log restartpoints in the same fashion as checkpoints. · 0af695fd
      Robert Haas 提交于
      Prior to 9.0, restartpoints never created, deleted, or recycled WAL
      files, but now they can.  This code makes log_checkpoints treat
      checkpoints and restartpoints symmetrically.  It also adjusts up
      the documentation of the parameter to mention restartpoints.
      
      Fujii Masao.  Docs by me, as suggested by Itagaki Takahiro.
      0af695fd
  16. 01 2月, 2011 1 次提交
    • H
      Support multiple concurrent pg_basebackup backups. · 997b48ed
      Heikki Linnakangas 提交于
      With this patch, pg_basebackup doesn't write a backup_label file in the
      data directory, so it doesn't interfere with a pg_start/stop_backup() based
      backup anymore. backup_label is still included in the backup, but it is
      injected directly into the tar stream.
      
      Heikki Linnakangas, reviewed by Fujii Masao and Magnus Hagander.
      997b48ed
  17. 23 1月, 2011 1 次提交
    • T
      Allow the wal_buffers setting to be auto-tuned to a reasonable value. · 0f73aae1
      Tom Lane 提交于
      If wal_buffers is initially set to -1 (which is now the default), it's
      replaced by 1/32nd of shared_buffers, with a minimum of 8 (the old default)
      and a maximum of the XLOG segment size.  The allowed range for manual
      settings is still from 4 up to whatever will fit in shared memory.
      
      Greg Smith, with implementation correction by me.
      0f73aae1
  18. 10 1月, 2011 1 次提交
    • M
      Split pg_start_backup() and pg_stop_backup() into two pieces · 4448917d
      Magnus Hagander 提交于
      Move the actual functionality into a separate function that's
      easier to call internally, and change the SQL-callable function
      to be a wrapper calling this.
      
      Also create a pg_abort_backup() function, only callable internally,
      that does only the most vital parts of pg_stop_backup(), making it
      safe(r) to call from error handlers.
      4448917d
  19. 02 1月, 2011 1 次提交
  20. 29 12月, 2010 2 次提交
    • R
      Support unlogged tables. · 53dbc27c
      Robert Haas 提交于
      The contents of an unlogged table are WAL-logged; thus, they are not
      available on standby servers and are truncated whenever the database
      system enters recovery.  Indexes on unlogged tables are also unlogged.
      Unlogged GiST indexes are not currently supported.
      53dbc27c
    • M
      Add REPLICATION privilege for ROLEs · 9b8aff8c
      Magnus Hagander 提交于
      This privilege is required to do Streaming Replication, instead of
      superuser, making it possible to set up a SR slave that doesn't
      have write permissions on the master.
      
      Superuser privileges do NOT override this check, so in order to
      use the default superuser account for replication it must be
      explicitly granted the REPLICATION permissions. This is backwards
      incompatible change, in the interest of higher default security.
      9b8aff8c
  21. 14 12月, 2010 1 次提交
  22. 11 12月, 2010 1 次提交
    • T
      Use symbolic names not octal constants for file permission flags. · 04f4e10c
      Tom Lane 提交于
      Purely cosmetic patch to make our coding standards more consistent ---
      we were doing symbolic some places and octal other places.  This patch
      fixes all C-coded uses of mkdir, chmod, and umask.  There might be some
      other calls I missed.  Inconsistency noted while researching tablespace
      directory permissions issue.
      04f4e10c
  23. 07 12月, 2010 1 次提交
    • H
      Fix bugs in the hot standby known-assigned-xids tracking logic. If there's · 5a031a55
      Heikki Linnakangas 提交于
      an old transaction running in the master, and a lot of transactions have
      started and finished since, and a WAL-record is written in the gap between
      the creating the running-xacts snapshot and WAL-logging it, recovery will fail
      with "too many KnownAssignedXids" error. This bug was reported by
      Joachim Wieland on Nov 19th.
      
      In the same scenario, when fewer transactions have started so that all the
      xids fit in KnownAssignedXids despite the first bug, a more serious bug
      arises. We incorrectly initialize the clog code with the oldest still running
      transaction, and when we see the WAL record belonging to a transaction with
      an XID larger than one that committed already before the checkpoint we're
      recovering from, we zero the clog page containing the already committed
      transaction, leading to data loss.
      
      In hindsight, trying to track xids in the known-assigned-xids array before
      seeing the running-xacts record was too complicated. To fix that, hold
      XidGenLock while the running-xacts snapshot is taken and WAL-logged. That
      ensures that no transaction can begin or end in that gap, so that in recvoery
      we know that the snapshot contains all transactions running at that point in
      WAL.
      5a031a55
  24. 06 12月, 2010 1 次提交
  25. 03 12月, 2010 1 次提交
    • R
      Use GUC lexer for recovery.conf parsing. · 970a1868
      Robert Haas 提交于
      This eliminates some crufty, special-purpose code and, as a non-trivial
      side benefit, allows recovery.conf parameters to be unquoted.
      
      Dimitri Fontaine, with review and cleanup by Alvaro Herrera, Itagaki
      Takahiro, and me.
      970a1868
  26. 24 11月, 2010 1 次提交
  27. 12 11月, 2010 1 次提交
  28. 10 11月, 2010 1 次提交
  29. 02 11月, 2010 1 次提交
    • H
      Bootstrap WAL to begin at segment logid=0 logseg=1 (000000010000000000000001) · 8c843fff
      Heikki Linnakangas 提交于
      rather than 0/0, so that we can safely use 0/0 as an invalid value. This is a
      more future-proof fix for the corner-case bug in streaming replication that
      was fixed yesterday. We had a similar corner-case bug with log/seg 0/0 back in
      February as well. Avoiding 0/0 as a valid value should prevent bugs like that
      in the future. Per Tom Lane's idea.
      
      Back-patch to 9.0. Since this only affects bootstrapping, it makes no
      difference to existing installations. We don't need to worry about the
      bug in existing installations, because if you've managed to get past the
      initial base backup already, you won't hit the bug in the future either.
      8c843fff
  30. 01 11月, 2010 1 次提交
    • H
      Fix corner-case bug in tracking of latest removed WAL segment during · 931b6db3
      Heikki Linnakangas 提交于
      streaming replication. We used log/seg 0/0 to indicate that no WAL segments
      have been removed since startup, but 0/0 is a valid value for the very first
      WAL segment after initdb. To make that disambiguous, store
      (latest removed WAL segment + 1) in the global variable.
      
      Per report from Matt Chesler, also reproduced by Greg Smith.
      931b6db3
  31. 27 10月, 2010 1 次提交
  32. 15 10月, 2010 2 次提交
  33. 21 9月, 2010 1 次提交
  34. 15 9月, 2010 1 次提交