1. 22 3月, 2014 2 次提交
  2. 21 3月, 2014 2 次提交
    • H
      Replace the XLogInsert slots with regular LWLocks. · 68a2e52b
      Heikki Linnakangas 提交于
      The special feature the XLogInsert slots had over regular LWLocks is the
      insertingAt value that was updated atomically with releasing backends
      waiting on it. Add new functions to the LWLock API to do that, and replace
      the slots with LWLocks. This reduces the amount of duplicated code.
      (There's still some duplication, but at least it's all in lwlock.c now.)
      
      Reviewed by Andres Freund.
      68a2e52b
    • T
      Again fix initialization of auto-tuned effective_cache_size. · af930e60
      Tom Lane 提交于
      The previous method was overly complex and underly correct; in particular,
      by assigning the default value with PGC_S_OVERRIDE, it prevented later
      attempts to change the setting in postgresql.conf, as noted by Jeff Janes.
      We should just assign the default value with source PGC_S_DYNAMIC_DEFAULT,
      which will have the desired priority relative to the boot_val as well as
      user-set values.
      
      There is still a gap in this method: if there's an explicit assignment of
      effective_cache_size = -1 in the postgresql.conf file, and that assignment
      appears before shared_buffers is assigned, the code will substitute 4 times
      the bootstrap default for shared_buffers, and that value will then persist
      (since it will have source PGC_S_FILE).  I don't see any very nice way
      to avoid that though, and it's not a case to be expected in practice.
      The existing comments in guc-file.l look forward to a redesign of the
      DYNAMIC_DEFAULT mechanism; if that ever happens, we should consider this
      case as one of the things we'd like to improve.
      af930e60
  3. 20 3月, 2014 3 次提交
    • B
      libpq: pass a memory allocation failure error up to PQconndefaults() · a4c8f143
      Bruce Momjian 提交于
      Previously user name memory allocation failures were ignored and the
      default user name set to NULL.
      a4c8f143
    • R
      test_shm_mq: Improve regression tests. · d1bdab2f
      Robert Haas 提交于
      Per discussion with Tom Lane.
      d1bdab2f
    • A
      Setup error context callback for transaction lock waits · f88d4cfc
      Alvaro Herrera 提交于
      With this in place, a session blocking behind another one because of
      tuple locks will get a context line mentioning the relation name, tuple
      TID, and operation being done on tuple.  For example:
      
      LOG:  process 11367 still waiting for ShareLock on transaction 717 after 1000.108 ms
      DETAIL:  Process holding the lock: 11366. Wait queue: 11367.
      CONTEXT:  while updating tuple (0,2) in relation "foo"
      STATEMENT:  UPDATE foo SET value = 3;
      
      Most usefully, the new line is displayed by log entries due to
      log_lock_waits, although of course it will be printed by any other log
      message as well.
      
      Author: Christian Kruse, some tweaks by Álvaro Herrera
      Reviewed-by: Amit Kapila, Andres Freund, Tom Lane, Robert Haas
      f88d4cfc
  4. 19 3月, 2014 12 次提交
  5. 18 3月, 2014 8 次提交
  6. 17 3月, 2014 9 次提交
    • H
      Fix thinko: have trueTriConsistentFn return GIN_TRUE. · d663d439
      Heikki Linnakangas 提交于
      While we're at it, also improve comments in ginlogic.c.
      d663d439
    • F
      Fix typos in comments. · 2bccced1
      Fujii Masao 提交于
      Thom Brown
      2bccced1
    • F
      Fix bug in clean shutdown of walsender that pg_receiving is connecting to. · 5c6d9fc4
      Fujii Masao 提交于
      On clean shutdown, walsender waits for all WAL to be replicated to a standby,
      and exits. It determined whether that replication had been completed by
      checking whether its sent location had been equal to a standby's flush
      location. Unfortunately this condition never becomes true when the standby
      such as pg_receivexlog which always returns an invalid flush location is
      connecting to walsender, and then walsender waits forever.
      
      This commit changes walsender so that it just checks a standby's write
      location if a flush location is invalid.
      
      Back-patch to 9.1 where enough infrastructure for this exists.
      5c6d9fc4
    • M
      Fix small typo in comment · 02703ff2
      Magnus Hagander 提交于
      Michael Paquier
      02703ff2
    • A
      plperl: Fix memory leak in hek2cstr · bd1154ed
      Alvaro Herrera 提交于
      Backpatch all the way back to 9.1, where it was introduced by commit
      50d89d42.
      
      Reported by Sergey Burladyan in #9223
      Author: Alex Hunsaker
      bd1154ed
    • T
      Fix unportable shell-script syntax in pg_upgrade's test.sh. · 0268d21e
      Tom Lane 提交于
      I discovered the hard way that on some old shells, the locution
          FOO=""   unset FOO
      does not behave the same as
          FOO="";  unset FOO
      and in fact leaves FOO set to an empty string.  test.sh was inconsistently
      spelling it different ways on adjacent lines.
      
      This got broken relatively recently, in commit c737a2e5, so the lack of
      field reports to date doesn't represent a lot of evidence that the problem
      is rare.
      0268d21e
    • P
      Make punctuation consistent · 2861e8e9
      Peter Eisentraut 提交于
      2861e8e9
    • P
      Fix whitespace · e2b95947
      Peter Eisentraut 提交于
      e2b95947
    • T
      Fix advertised dispsize for libpq's sslmode connection parameter. · f4051e36
      Tom Lane 提交于
      "8" was correct back when "disable" was the longest allowed value, but
      since "verify-full" was added, it should be "12".  Given the lack of
      complaints, I wouldn't be surprised if nobody is actually using these
      values ... but still, if they're in the API, they should be right.
      
      Noticed while pursuing a different problem.  It's been wrong for quite
      a long time, so back-patch to all supported branches.
      f4051e36
  7. 16 3月, 2014 3 次提交
    • M
      Cleanups from the remove-native-krb5 patch · 0294023a
      Magnus Hagander 提交于
      krb_srvname is actually not available anymore as a parameter server-side, since
      with gssapi we accept all principals in our keytab. It's still used in libpq for
      client side specification.
      
      In passing remove declaration of krb_server_hostname, where all the functionality
      was already removed.
      
      Noted by Stephen Frost, though a different solution than his suggestion
      0294023a
    • T
      First-draft release notes for 9.3.4. · e3c9f232
      Tom Lane 提交于
      As usual, the release notes for older branches will be made by cutting
      these down, but put them up for community review first.
      e3c9f232
    • T
      Update time zone data files to tzdata release 2014a. · aba7f567
      Tom Lane 提交于
      DST law changes in Fiji, Turkey; historical changes in Israel, Ukraine.
      aba7f567
  8. 14 3月, 2014 1 次提交
    • H
      Fix race condition in B-tree page deletion. · efada2b8
      Heikki Linnakangas 提交于
      In short, we don't allow a page to be deleted if it's the rightmost child
      of its parent, but that situation can change after we check for it.
      
      Problem
      -------
      
      We check that the page to be deleted is not the rightmost child of its
      parent, and then lock its left sibling, the page itself, its right sibling,
      and the parent, in that order. However, if the parent page is split after
      the check but before acquiring the locks, the target page might become the
      rightmost child, if the split happens at the right place. That leads to an
      error in vacuum (I reproduced this by setting a breakpoint in debugger):
      
      ERROR:  failed to delete rightmost child 41 of block 3 in index "foo_pkey"
      
      We currently re-check that the page is still the rightmost child, and throw
      the above error if it's not. We could easily just give up rather than throw
      an error, but that approach doesn't scale to half-dead pages. To recap,
      although we don't normally allow deleting the rightmost child, if the page
      is the *only* child of its parent, we delete the child page and mark the
      parent page as half-dead in one atomic operation. But before we do that, we
      check that the parent can later be deleted, by checking that it in turn is
      not the rightmost child of the grandparent (potentially recursing all the
      way up to the root). But the same situation can arise there - the
      grandparent can be split while we're not holding the locks. We end up with
      a half-dead page that we cannot delete.
      
      To make things worse, the keyspace of the deleted page has already been
      transferred to its right sibling. As the README points out, the keyspace at
      the grandparent level is "out-of-whack" until the half-dead page is deleted,
      and if enough tuples with keys in the transferred keyspace are inserted, the
      page might get split and a downlink might be inserted into the grandparent
      that is out-of-order. That might not cause any serious problem if it's
      transient (as the README ponders), but is surely bad if it stays that way.
      
      Solution
      --------
      
      This patch changes the page deletion algorithm to avoid that problem. After
      checking that the topmost page in the chain of to-be-deleted pages is not
      the rightmost child of its parent, and then deleting the pages from bottom
      up, unlink the pages from top to bottom. This way, the intermediate stages
      are similar to the intermediate stages in page splitting, and there is no
      transient stage where the keyspace is "out-of-whack". The topmost page in
      the to-be-deleted chain doesn't have a downlink pointing to it, like a page
      split before the downlink has been inserted.
      
      This also allows us to get rid of the cleanup step after WAL recovery, if we
      crash during page deletion. The deletion will be continued at next VACUUM,
      but the tree is consistent for searches and insertions at every step.
      
      This bug is old, all supported versions are affected, but this patch is too
      big to back-patch (and changes the WAL record formats of related records).
      We have not heard any reports of the bug from users, so clearly it's not
      easy to bump into. Maybe backpatch later, after this has had some field
      testing.
      
      Reviewed by Kevin Grittner and Peter Geoghegan.
      efada2b8