1. 08 1月, 2018 1 次提交
    • T
      Back off chattiness in RemovePgTempFiles(). · eeb3c2df
      Tom Lane 提交于
      In commit 561885db, as part of normalizing RemovePgTempFiles's error
      handling, I removed its behavior of silently ignoring ENOENT failures
      during directory opens.  Thomas Munro points out that this is a bad idea at
      the top level, because we don't create pgsql_tmp directories until needed.
      Thus this coding could produce LOG messages in perfectly normal situations,
      which isn't what I intended.  Restore the suppression of ENOENT logging,
      but only at top level --- it would still be unexpected for a nested temp
      directory to disappear between seeing it in the parent directory and
      opening it.
      
      Discussion: https://postgr.es/m/CAEepm=2y06SehAkTnd5sU_eVqdv5P-=Srt1y5vYNQk6yVDVaPw@mail.gmail.com
      eeb3c2df
  2. 06 1月, 2018 9 次提交
    • S
      Add TIMELINE to backup_label file · 6271fceb
      Simon Riggs 提交于
      Allows new test to confirm timelines match
      
      Author: Michael Paquier
      Reviewed-by: David Steele
      6271fceb
    • S
      Default monitoring roles - errata · 6668a54e
      Simon Riggs 提交于
      25fff407 introduced
      default monitoring roles. Apply these corrections:
      
      * Allow access to pg_stat_get_wal_senders()
        by role pg_read_all_stats
      
      * Correct comment in pg_stat_get_wal_receiver()
        to show it is no longer superuser-only.
      
      Author: Feike Steenbergen
      Reviewed-by: Michael Paquier
      
      Apply to HEAD, then later backpatch to 10
      6668a54e
    • T
      Remove return values of ConditionVariableSignal/Broadcast. · ccf312a4
      Tom Lane 提交于
      In the wake of commit aced5a92, the semantics of these results are
      a bit squishy: we can tell whether we signaled some other process(es),
      but we do not know which ones were real waiters versus mere sentinels
      for ConditionVariableBroadcast operations.  It does not help much that
      ConditionVariableBroadcast will attempt to pass on the signal to the
      next real waiter, because (a) there might not be one, and (b) that will
      only happen awhile later, anyway.  So these results could overstate how
      much effect the calls really had.
      
      However, no existing caller of either function pays any attention to its
      result value, so it seems reasonable to just define that as a required
      property of a correct algorithm.  To encourage correctness and save some
      tiny number of cycles, change both functions to return void.
      
      Patch by me, per an observation by Thomas Munro.  No back-patch, since
      if any third parties happen to be using these functions, they might not
      appreciate an API break in a minor release.
      
      Discussion: https://postgr.es/m/CAEepm=0NWKehYw7NDoUSf8juuKOPRnCyY3vuaSvhrEWsOTAa3w@mail.gmail.com
      ccf312a4
    • T
      Reorder steps in ConditionVariablePrepareToSleep for more safety. · 3cac0ec8
      Tom Lane 提交于
      In the admittedly-very-unlikely case that AddWaitEventToSet fails,
      ConditionVariablePrepareToSleep would error out after already having
      set cv_sleep_target, which is probably bad, and after having already
      set cv_wait_event_set, which is very bad.  Transaction abort might or
      might not clean up cv_sleep_target properly; but there is nothing
      that would be aware that the WaitEventSet wasn't fully constructed,
      so that all future condition variable sleeps would be broken.
      We can easily guard against these hazards with slight restructuring.
      
      Back-patch to v10 where condition_variable.c was introduced.
      
      Discussion: https://postgr.es/m/CAEepm=0NWKehYw7NDoUSf8juuKOPRnCyY3vuaSvhrEWsOTAa3w@mail.gmail.com
      3cac0ec8
    • T
      Rewrite ConditionVariableBroadcast() to avoid live-lock. · aced5a92
      Tom Lane 提交于
      The original implementation of ConditionVariableBroadcast was, per its
      self-description, "the dumbest way possible".  Thomas Munro found out
      it was a bit too dumb.  An awakened process may immediately re-queue
      itself, if the specific condition it's waiting for is not yet satisfied.
      If this happens before ConditionVariableBroadcast is able to see the wait
      queue as empty, then ConditionVariableBroadcast will re-awaken the same
      process, repeating the cycle.  Given unlucky timing this back-and-forth
      can repeat indefinitely; loops lasting thousands of seconds have been
      seen in testing.
      
      To fix, add our own process to the end of the wait queue to serve as a
      sentinel, and exit the broadcast loop once our process is not there
      anymore.  There are various special considerations described in the
      comments, the principal disadvantage being that wakers can no longer
      be sure whether they awakened a real waiter or just a sentinel.  But in
      practice nobody pays attention to the result of ConditionVariableSignal
      or ConditionVariableBroadcast anyway, so that problem seems hypothetical.
      
      Back-patch to v10 where condition_variable.c was introduced.
      
      Tom Lane and Thomas Munro
      
      Discussion: https://postgr.es/m/CAEepm=0NWKehYw7NDoUSf8juuKOPRnCyY3vuaSvhrEWsOTAa3w@mail.gmail.com
      aced5a92
    • R
      Factor error generation out of ExecPartitionCheck. · 19c47e7c
      Robert Haas 提交于
      At present, we always raise an ERROR if the partition constraint
      is violated, but a pending patch for UPDATE tuple routing will
      consider instead moving the tuple to the correct partition.
      Refactor to make that simpler.
      
      Amit Khandekar, reviewed by Amit Langote, David Rowley, and me.
      
      Discussion: http://postgr.es/m/CAJ3gD9cue54GbEzfV-61nyGpijvjZgCcghvLsB0_nL8Nm8HzCA@mail.gmail.com
      19c47e7c
    • B
      pg_upgrade: remove C comment · 84a6f63e
      Bruce Momjian 提交于
      Revert another part of 959ee6d2 .
      
      Backpatch-through: 10
      84a6f63e
    • B
      pg_upgrade: revert part of patch for ease of translation · 3e6f01fd
      Bruce Momjian 提交于
      Revert part of 959ee6d2 .
      
      Backpatch-through: 10
      3e6f01fd
    • B
      pg_upgrade: simplify code layout in a few places · 959ee6d2
      Bruce Momjian 提交于
      Backpatch-through: 9.4 (9.3 didn't need improving)
      959ee6d2
  3. 05 1月, 2018 10 次提交
  4. 04 1月, 2018 11 次提交
  5. 03 1月, 2018 7 次提交
    • P
      Allow ldaps when using ldap authentication · 35c0754f
      Peter Eisentraut 提交于
      While ldaptls=1 provides an RFC 4513 conforming way to do LDAP
      authentication with TLS encryption, there was an earlier de facto
      standard way to do LDAP over SSL called LDAPS.  Even though it's not
      enshrined in a standard, it's still widely used and sometimes required
      by organizations' network policies.  There seems to be no reason not to
      support it when available in the client library.  Therefore, add support
      when using OpenLDAP 2.4+ or Windows.  It can be configured with
      ldapscheme=ldaps or ldapurl=ldaps://...
      
      Add tests for both ways of requesting LDAPS and a test for the
      pre-existing ldaptls=1.  Modify the 001_auth.pl test for "diagnostic
      messages", which was previously relying on the server rejecting
      ldaptls=1.
      
      Author: Thomas Munro
      Reviewed-By: Peter Eisentraut
      Discussion: https://postgr.es/m/CAEepm=1s+pA-LZUjQ-9GQz0Z4rX_eK=DFXAF1nBQ+ROPimuOYQ@mail.gmail.com
      35c0754f
    • A
      Fix isolation test to be less timing-dependent · 2268e6af
      Alvaro Herrera 提交于
      I did this by adding another locking process, which makes the other two
      wait.  This way the output should be stable enough.
      
      Per buildfarm and Andres Freund
      Discussion: https://postgr.es/m/20180103034445.t3utrtrnrevfsghm@alap3.anarazel.de
      2268e6af
    • B
      Update copyright for 2018 · 9d4649ca
      Bruce Momjian 提交于
      Backpatch-through: certain files through 9.3
      9d4649ca
    • A
      Simplify representation of aggregate transition values a bit. · f9ccf92e
      Andres Freund 提交于
      Previously aggregate transition values for hash and other forms of
      aggregation (i.e. sort and no group by) were represented
      differently. Hash based aggregation used a grouping set indexed array
      pointing to an array of transition values, whereas other forms of
      aggregation used one flattened array with the index being computed out
      of grouping set and transition offsets.
      
      That made upcoming changes hard, so represent both as grouping set
      indexed array of per-group data.
      
      As a nice side-effect this also makes aggregation slightly faster,
      because computing offsets with `transno + (setno * numTrans)` turns
      out not to be that cheap (too big for x86 lea for example).
      
      Author: Andres Freund
      Discussion: https://postgr.es/m/20171128003121.nmxbm2ounxzb6n2t@alap3.anarazel.de
      f9ccf92e
    • T
      Ensure proper alignment of tuples in HashMemoryChunkData buffers. · 5dc692f7
      Tom Lane 提交于
      The previous coding relied (without any documentation) on the data[]
      member of HashMemoryChunkData being at a MAXALIGN'ed offset.  If it
      was not, the tuples would not be maxaligned either, leading to failures
      on alignment-picky machines.  While there seems to be no live bug on any
      platform we support, this is clearly pretty fragile: any addition to or
      rearrangement of the fields in HashMemoryChunkData could break it.
      Let's remove the hazard by getting rid of the data[] member and instead
      using pointer arithmetic with an explicitly maxalign'ed offset.
      
      Discussion: https://postgr.es/m/14483.1514938129@sss.pgh.pa.us
      5dc692f7
    • A
      Fix deadlock hazard in CREATE INDEX CONCURRENTLY · 54eff531
      Alvaro Herrera 提交于
      Multiple sessions doing CREATE INDEX CONCURRENTLY simultaneously are
      supposed to be able to work in parallel, as evidenced by fixes in commit
      c3d09b3b specifically to support this case.  In reality, one of the
      sessions would be aborted by a misterious "deadlock detected" error.
      
      Jeff Janes diagnosed that this is because of leftover snapshots used for
      system catalog scans -- this was broken by 8aa3e47510b9 keeping track of
      (registering) the catalog snapshot.  To fix the deadlocks, it's enough
      to de-register that snapshot prior to waiting.
      
      Backpatch to 9.4, which introduced MVCC catalog scans.
      
      Include an isolationtester spec that 8 out of 10 times reproduces the
      deadlock with the unpatched code for me (Álvaro).
      
      Author: Jeff Janes
      Diagnosed-by: Jeff Janes
      Reported-by: Jeremy Finzel
      Discussion: https://postgr.es/m/CAMa1XUhHjCv8Qkx0WOr1Mpm_R4qxN26EibwCrj0Oor2YBUFUTg%40mail.gmail.com
      54eff531
    • P
      Don't cast between GinNullCategory and bool · 43803626
      Peter Eisentraut 提交于
      The original idea was that we could use an isNull-style bool array
      directly as a GinNullCategory array.  However, the existing code already
      acknowledges that that doesn't really work, because of the possibility
      that bool as currently defined can have arbitrary bit patterns for true
      values.  So it has to loop through the nullFlags array to set each bool
      value to an acceptable value.  But if we are looping through the whole
      array anyway, we might as well build a proper GinNullCategory array
      instead and abandon the type casting.  That makes the code much safer in
      case bool is ever changed to something else.
      Reviewed-by: NMichael Paquier <michael.paquier@gmail.com>
      43803626
  6. 02 1月, 2018 1 次提交
    • A
      Fix EXPLAIN ANALYZE output for Parallel Hash. · 93ea78b1
      Andres Freund 提交于
      In a race case, EXPLAIN ANALYZE could fail to display correct nbatch
      and size information.  Refactor so that participants report only on
      batches they worked on rather than trying to report on all of them,
      and teach explain.c to consider the HashInstrumentation object from
      all participants instead of picking the first one it can find.  This
      should fix an occasional build farm failure in the "join" regression
      test.
      
      Author: Thomas Munro
      Reviewed-By: Andres Freund
      Discussion: https://postgr.es/m/30219.1514428346%40sss.pgh.pa.us
      93ea78b1
  7. 01 1月, 2018 1 次提交