1. 13 7月, 2018 4 次提交
    • A
      Initialize sequence page under buffer content lock · d331cc78
      Asim R P 提交于
      Shared buffer access rules mandate that a pin as well as content lock
      in exclusive mode is needed to update a shared buffer.
      d331cc78
    • T
      Fix race condition in DELETE RETURNING. · 3637c5d4
      Tom Lane 提交于
      When RETURNING is specified, ExecDelete would return a virtual-tuple slot
      that could contain pointers into an already-unpinned disk buffer.  Another
      process could change the buffer contents before we get around to using the
      data, resulting in garbage results or even a crash.  This seems of fairly
      low probability, which may explain why there are no known field reports of
      the problem, but it's definitely possible.  Fix by forcing the result slot
      to be "materialized" before we release pin on the disk buffer.
      
      Back-patch to 9.0; in earlier branches there is no bug because
      ExecProcessReturning sent the tuple to the destination immediately.  Also,
      this is already fixed in HEAD as part of the writable-foreign-tables patch
      (where the fix is necessary for DELETE RETURNING to work at all with
      postgres_fdw).
      3637c5d4
    • A
      Shared buffer should not be accessed after it is unpinned · 942c67e3
      Asim R P 提交于
      We seemed to be doing that in this case.  This was caught by enabling
      memory_protect_buffer_pool GUC.
      942c67e3
    • E
      Update gpsd and minirepro to capture HLL counter · 4cdfd41a
      Ekta Khanna 提交于
      Prior to this commit, the minirepro and gpsd util, captured the hll
      counter from the `pg_statistic` table as `int[]` instead of a `bytea[]`,
      which caused errors while trying to load it. This commit fixes this
      issue.
      4cdfd41a
  2. 12 7月, 2018 11 次提交
  3. 11 7月, 2018 6 次提交
    • A
      Improve handling of rd_cdbpolicy. · 0bfc7251
      Ashwin Agrawal 提交于
      Pointers from Relation object needs to be handled with special care. As having
      refcount on the object doesn't mean the object is not modified. Incase of cache
      invalidation message handling Relation object gets *rebuild*. As part of rebuild
      only guarantee maintained is that Relation object address will not change. But
      the memory addresses inside the Relation object gets freed and freshly allocated
      and populated with latest data from catalog.
      
      For example below code sequence is dangerous
      
          rel->rd_cdbpolicy = original_policy;
          GpPolicyReplace(RelationGetRelid(rel), original_policy);
      
      If relcache invalidation message is served after assigning value to
      rd_cdbpolicy, the rebuild will free the memory for rd_cdbpolicy (which means
      original_policy) and replaced with current contents of
      gp_distribution_policy. So, when GpPolicyReplace() called with original_policy
      is going to access freed memory. Plus, rd_cdbpolicy will have stale value in
      cache and not intended refreshed value. This issue was hit in CI few times and
      reproduces with higher frequency with `-DRELCACHE_FORCE_RELEASE`.
      
      Hence this patch fixes all uses to rd_cdbpolicy to make use of rd_cdbpolicy
      pointer directly from Relation object and also to update the catalog first
      before assigning the value to rd_cdbpolicy.
      0bfc7251
    • P
      Fix duplicate distributed keys for CTAS · 7680b762
      Pengzhou Tang 提交于
      To keep it consistent with the "Create table" syntax, CTAS should also
      disallow duplicate distributed keys, otherwise backup and restore will
      mess up.
      7680b762
    • D
    • A
      Fix alter table CLI help documentation · 30617fe0
      Asim R P 提交于
      In ALTER TABLE SET DISTRIBUTED BY, the "WITH(reorganize=...)" option
      must be specified before the "DISTRIBUTED ..." clause.
      30617fe0
    • T
      Change behave to use parse 1.8.2 · 8ac4bc72
      Todd Sedano 提交于
      Parse 1.8.2 is consistent with the other python libraries
      defined in the python-dependencies.txt file
      Co-authored-by: NTodd Sedano <tsedano@pivotal.io>
      Co-authored-by: NChris Hajas <chajas@pivotal.io>
      8ac4bc72
    • M
      docs - PL/Container - added note - domain object not supported. (#5257) · 374ae43f
      Mel Kiyama 提交于
      * docs - PL/Container - added note - domain object not supported.
      
      * docs - PL/Container - updated note for non-support of domain object
      374ae43f
  4. 10 7月, 2018 12 次提交
  5. 09 7月, 2018 4 次提交
  6. 07 7月, 2018 2 次提交
    • J
      Do not automatically create an array type for child partitions · a8f5a045
      Jimmy Yih 提交于
      As part of the Postgres 8.3 merge, all heap tables now automatically
      create an array type. The array type will usually be created with
      typname '_<heap_name>' since the automatically created composite type
      already takes the typname '<heap_name>' first. If typname
      '_<heap_name>' is taken, the logic will continue to prepend
      underscores until no collision (truncating the end if typname gets
      past NAMEDATALEN of 64). This might be an oversight in upstream
      Postgres since certain scenarios involving creating a large number of
      heap tables with similar names could result in a lot of typname
      collisions until no heap tables with similar names can be
      created. This is very noticable in Greenplum heap partition tables
      because Greenplum has logic to automatically name child partitions
      with similar names instead of having the user name each child
      partition.
      
      To prevent typname collision failures when creating a heap partition
      table with a large number of child partitions, we will now stop
      automatically creating the array type for child partitions.
      
      References:
      https://www.postgresql.org/message-id/flat/20070302234016.GF3665%40fetter.org
      https://github.com/postgres/postgres/commit/bc8036fc666a8f846b1d4b2f935af7edd90eb5aa
      a8f5a045
    • C
      Release access share lock in pg_get_partition_def functions · a8c54b94
      Chris Hajas 提交于
      The pg_get_partition_template_def and pg_get_partition_def functions
      take accesss share locks, but do not release them until the end of the
      transaction. If a transaction is long-running, this can conflict with
      other user operations. Is it not necessary to hold the lock indefinitely
      as the lock is only needed for the duration of the function call.
      Co-authored-by: NChris Hajas <chajas@pivotal.io>
      Co-authored-by: NKaren Huddleston <khuddleston@pivotal.io>
      a8c54b94
  7. 06 7月, 2018 1 次提交
    • J
      Fix create gang failure on dns lookup error on down mirrors. · dd861e72
      Jialun 提交于
      If a segment exists in gp_segment_configuration but its ip address can
      not be resolved we will run into a runtime error on gang creation:
      
          ERROR:  could not translate host name "segment-0a", port "40000" to
          address: Name or service not known (cdbutil.c:675)
      
      This happens even if segment-0a is a mirror and is marked as down.  With
      this error queries can not be executed, gpstart and gpstop will also
      fail.
      
      One way to trigger the issue:
      
      - create a multiple segments cluster;
      - remove sdw1's dns entry from /etc/hosts on mdw;
      - kill postgres primary process on sdw1;
      
      FTS can detect this error and automatically switch to mirror, but
      queries can not be executed.
      dd861e72