1. 30 Aug, 2019 1 commit
    • Tom Lane's avatar
      Doc: remove some long-obsolete information from installation.sgml. · 76c2af92
      Tom Lane authored
      Section 16.2 pointed to platform-specific FAQ files that we removed
      way back in 8.4.  Section 16.7 contained a bunch of information about
      AIX and HPUX bugs that were squashed decades ago, plus discussions of
      old compiler versions that are certainly moot now that we require C99
      support.  Since we're obviously not maintaining this stuff carefully,
      just remove it.  The HPUX sub-section seems like it can go away
      entirely, since everything it said that was still applicable was
      redundant with material elsewhere in the chapter.
      
      In passing, I couldn't resist the temptation to do a small amount
      of copy-editing on nearby text.
      
      Back-patch to v12, since this stuff is surely obsolete in any
      branch that requires C99.
      
      Discussion: https://postgr.es/m/15538.1567042743@sss.pgh.pa.us
      76c2af92
  2. 29 Aug, 2019 2 commits
  3. 28 Aug, 2019 5 commits
    • Tom Lane's avatar
      744c848d
    • Heikki Linnakangas's avatar
      Fix overflow check and comment in GIN posting list encoding. · bde7493d
      Heikki Linnakangas authored
      The comment did not match what the code actually did for integers with
      the 43rd bit set. You get an integer like that, if you have a posting
      list with two adjacent TIDs that are more than 2^31 blocks apart.
      According to the comment, we would store that in 6 bytes, with no
      continuation bit on the 6th byte, but in reality, the code encodes it
      using 7 bytes, with a continuation bit on the 6th byte as normal.
      
      The decoding routine also handled these 7-byte integers correctly, except
      for an overflow check that assumed that one integer needs at most 6 bytes.
      Fix the overflow check, and fix the comment to match what the code
      actually does. Also fix the comment that claimed that there are 17 unused
      bits in the 64-bit representation of an item pointer. In reality, there
      are 64-32-11=21.
      
      Fitting any item pointer into max 6 bytes was an important property when
      this was written, because in the old pre-9.4 format, item pointers were
      stored as plain arrays, with 6 bytes for every item pointer. The maximum
      of 6 bytes per integer in the new format guaranteed that we could convert
      any page from the old format to the new format after upgrade, so that the
      new format was never larger than the old format. But we hardly need to
      worry about that anymore, and running into that problem during upgrade,
      where an item pointer is expanded from 6 to 7 bytes such that the data
      doesn't fit on a page anymore, is implausible in practice anyway.
      
      Backpatch to all supported versions.
      
      This also includes a little test module to test these large distances
      between item pointers, without requiring a 16 TB table. It is not
      backpatched, I'm including it more for the benefit of future development
      of new posting list formats.
      
      Discussion: https://www.postgresql.org/message-id/33bfc20a-5c86-f50c-f5a5-58e9925d05ff%40iki.fi
      Reviewed-by: Masahiko Sawada, Alexander Korotkov
      bde7493d
    • Thomas Munro's avatar
      Avoid catalog lookups in RelationAllowsEarlyPruning(). · 720b59b5
      Thomas Munro authored
      RelationAllowsEarlyPruning() performed a catalog scan, but is used
      in two contexts where that was a bad idea:
      
      1.  In heap_page_prune_opt(), which runs very frequently in some large
          scans.  This caused major performance problems in a field report
          that was easy to reproduce.
      
      2.  In TestForOldSnapshot(), which runs while we hold a buffer content
          lock.  It's not clear if this was guaranteed to be free of buffer
          deadlock risk.
      
      The check was introduced in commit 2cc41acd and defended against a
      real problem: 9.6's hash indexes have no page LSN and so we can't
      allow early pruning (ie the snapshot-too-old feature).  We can remove
      the check from all later releases though: hash indexes are now logged,
      and there is no way to create UNLOGGED indexes on regular logged
      tables.
      
      If a future release allows such a combination, it might need to put
      a similar check in place, but it'll need some more thought.
      
      Back-patch to 10.
      
      Author: Thomas Munro
      Reviewed-by: Tom Lane, who spotted the second problem
      Discussion: https://postgr.es/m/CA%2BhUKGKT8oTkp5jw_U4p0S-7UG9zsvtw_M47Y285bER6a2gD%2Bg%40mail.gmail.com
      Discussion: https://postgr.es/m/CAA4eK1%2BWy%2BN4eE5zPm765h68LrkWc3Biu_8rzzi%2BOYX4j%2BiHRw%40mail.gmail.com
      720b59b5
    • Michael Paquier's avatar
      Improve coverage of utils/float.h · 80d0e5ba
      Michael Paquier authored
      check_float4_val() checks after underflow and overflow of values
      converted from float8 to float4, but there has never been any regression
      tests for that.  This brings the coverage of float.h to 100%.
      
      Author: Movead Li
      Discussion: https://postgr.es/m/20190822174636998766188@highgo.ca
      80d0e5ba
    • Michael Paquier's avatar
      Disable timeouts when running pg_rewind with online source cluster · be182e4f
      Michael Paquier authored
      In this case, the transfer uses a libpq connection, which is subject to
      the timeout parameters set at system level, and this can make the rewind
      operation suddenly canceled which is not good for automation.  One
      workaround to such issues would be to use PGOPTIONS to enforce the
      wanted timeout parameters, but that's annoying, and for example pg_dump,
      which can run potentially long-running queries disables all types of
      timeouts.
      
      lock_timeout and statement_timeout are the ones which can cause problems
      now.  Note that pg_rewind does not use transactions, so disabling
      idle_in_transaction_session_timeout is optional, but it feels safer to
      do so for the future.
      
      This is back-patched down to 9.5.  idle_in_transaction_session_timeout
      is only present since 9.6.
      
      Author: Alexander Kukushkin
      Discussion: https://postgr.es/m/CAFh8B=krcVXksxiwVQh1SoY+ziJ-JC=6FcuoBL3yce_40Es5_g@mail.gmail.com
      Backpatch-through: 9.5
      be182e4f
  4. 27 Aug, 2019 8 commits
  5. 26 Aug, 2019 7 commits
    • Tom Lane's avatar
      Fix 007_sync_rep.pl to notice failures in ALTER SYSTEM SET. · fb57f40e
      Tom Lane authored
      If a test case tried to set an invalid value of synchronous_standby_names,
      the test script didn't detect that, which seems like a bad idea.
      Noticed while testing a proposed patch that broke some of these
      test cases.
      fb57f40e
    • Tom Lane's avatar
      Fix postmaster state machine to handle dead_end child crashes better. · ee327823
      Tom Lane authored
      A report from Alvaro Herrera shows that if we're in PM_STARTUP
      state, and we spawn a dead_end child to reject some incoming
      connection request, and that child dies with an unexpected exit
      code, the postmaster does not respond well.  We correctly send
      SIGQUIT to the startup process, but then:
      
      * if the startup process exits with nonzero exit code, as expected,
      we thought that that indicated a crash and aborted startup.
      
      * if the startup process exits with zero exit code, which is possible
      due to the inherent race condition, we'd advance to PM_RUN state
      which is fine --- but the code forgot that AbortStartTime would be
      nonzero in this situation.  We'd either die on the Asserts saying
      that it was zero, or perhaps misbehave later on.  (A quick look
      suggests that the only misbehavior might be busy-waiting due to
      DetermineSleepTime doing the wrong thing.)
      
      To fix the first point, adjust the state-machine logic to recognize
      that a nonzero exit code is expected after sending SIGQUIT, and have
      it transition to a state where we can restart the startup process.
      To fix the second point, change the Asserts to clear the variable
      rather than just claiming it should be clear already.
      
      Perhaps we could improve this further by not treating a crash of
      a dead_end child as a reason for panic'ing the database.  However,
      since those child processes are connected to shared memory, that
      seems a bit risky.  There are few good reasons for a dead_end child
      to report failure anyway (the cause of this in Alvaro's report is
      quite unclear).  On balance, therefore, a minimal fix seems best.
      
      This is an oversight in commit 45811be9.  While that was back-patched,
      I'm hesitant to back-patch this change.  The lack of reasons for a
      dead_end child to fail suggests that the case should be very rare in
      the field, which squares with the lack of reports; so it seems like
      this might not be worth the risk of introducing new issues.  In any
      case we can let it bake awhile in HEAD before considering a back-patch.
      
      Discussion: https://postgr.es/m/20190615160950.GA31378@alvherre.pgsql
      ee327823
    • Tom Lane's avatar
      Make comment in fmgr.h match the one in fmgr.c. · 348778dd
      Tom Lane authored
      Incompletely quoting an API spec does nobody any good.  Noted by
      Paul Jungwirth.  Looks like the discrepancy was my fault originally :-(
      
      Discussion: https://postgr.es/m/CA+renyU_J8TU_d3Kr0PkuOgFbpypextendu7a+_d5NOfVdvDeA@mail.gmail.com
      348778dd
    • Peter Eisentraut's avatar
      Fix gettext triggers specification · f2690338
      Peter Eisentraut authored
      In cc8d4151, the arguments of
      warn_or_exit_horribly() were changed but this was not updated.
      f2690338
    • Andrew Dunstan's avatar
      Adjust to latest Msys2 kernel release number · c62b8443
      Andrew Dunstan authored
      Previously 'uname -r' on Msys2 reported a kernele release starting with
      2. The latest version starts with 3. In commit 1638623f we specifically
      looked for one starting with 2. This is now changed to look for any
      digit between 2 and 9.
      
      backpatch to release 10.
      c62b8443
    • Andrew Dunstan's avatar
      Treat MINGW and MSYS the same in pg_upgrade test script · acb96eb7
      Andrew Dunstan authored
      On msys2, 'uname -s' reports a string starting MSYS instead on MINGW
      as happens on msys1. Treat these both the same way. This reverts
      608a7101 in favor of a more general solution.
      
      Backpatch to all live branches.
      acb96eb7
    • Michael Paquier's avatar
      Fix error handling of vacuumdb and reindexdb when running out of fds · 71d84efb
      Michael Paquier authored
      When trying to use a high number of jobs, vacuumdb (and more recently
      reindexdb) has only checked for a maximum number of jobs used, causing
      confusing failures when running out of file descriptors when the jobs
      open connections to Postgres.  This commit changes the error handling so
      as we do not check anymore for a maximum number of allowed jobs when
      parsing the option value with FD_SETSIZE, but check instead if a file
      descriptor is within the supported range when opening the connections
      for the jobs so as this is detected at the earliest time possible.
      
      Also, improve the error message to give a hint about the number of jobs
      recommended, using a wording given by the reviewers of the patch.
      
      Reported-by: Andres Freund
      Author: Michael Paquier
      Reviewed-by: Andres Freund, Álvaro Herrera, Tom Lane
      Discussion: https://postgr.es/m/20190818001858.ho3ev4z57fqhs7a5@alap3.anarazel.de
      Backpatch-through: 9.5
      71d84efb
  6. 25 Aug, 2019 3 commits
  7. 24 Aug, 2019 4 commits
  8. 23 Aug, 2019 1 commit
  9. 22 Aug, 2019 3 commits
  10. 21 Aug, 2019 5 commits
  11. 20 Aug, 2019 1 commit