1. 01 9月, 2017 15 次提交
    • D
      Revert "Update time zone data files to tzdata release 2016a" · 54b44445
      Daniel Gustafsson 提交于
      This reverts commit 1596d323 since
      it broke cluster startup, clearly it needs more attention before
      being ready.
      54b44445
    • D
      Update time zone data files to tzdata release 2016a · 1596d323
      Daniel Gustafsson 提交于
      This puts on on par with upstream PostgreSQL 9.1.20, released on
      2016-02-11, for tzdata and the below referenced commit. The reason
      for not updating further is that there are tzdata format changes
      in 9.1.21, 2016a is the last release we can import without merging
      code changes as well.
      
        commit 6887d72d06a2f36508d5be9cca316088d4c60b26
        Author: Tom Lane <tgl@sss.pgh.pa.us>
        Date:   Fri Feb 5 10:59:09 2016 -0500
      
          Update time zone data files to tzdata release 2016a.
      
          DST law changes in Cayman Islands, Metlakatla, Trans-Baikal Territory
          (Zabaykalsky Krai).  Historical corrections for Pakistan.
      1596d323
    • D
      Fix Copyright and file headers across the tree · ed7414ee
      Daniel Gustafsson 提交于
      This bumps the copyright years to the appropriate years after not
      having been updated for some time.  Also reformats existing code
      headers to match the upstream style to ensure consistency.
      ed7414ee
    • D
      Scrub linenumbers from errors in GPPC tests · 790b93fc
      Daniel Gustafsson 提交于
      The linenumbers are prone to change (and ideally shouldn't be there
      at all since we should use ereport instead), so scrub them from the
      test output with a matchsubs rule. The recent changes for copyright
      notices broke this since it added a line to the file.
      790b93fc
    • D
      Set errcode on AO checksum errors · 60f9ac3d
      Daniel Gustafsson 提交于
      The missing errcode makes the ereport call include the line number
      of the invocation from the .c file, which not only isn't too useful
      but cause the tests to fail on adding/removing code from the file.
      60f9ac3d
    • H
      Improve the error messages in a few COPY FROM SEGMENT cases. · 43b59d57
      Heikki Linnakangas 提交于
      * Use ereport() with a proper error code, rather than elog(), so that you
        don't get the source file name and line number in the message, and the
        serious-looking backtrace in the log.
      
      * Remove the hint that advised "SET gp_enable_segment_copy_checking=off",
        when a row failed the check that it's being loaded to the correct
        segment. Ignoring the mismatch seems like very bad idea, because if
        your rows are in incorrect segments, all bets are off, and you'll likely
        get incorrect query results when you try to query the table.
      43b59d57
    • P
      Redefine function groupReleaseMemQuota() · d3734aa9
      Pengzhou Tang 提交于
      d3734aa9
    • P
      Fix floating-point exception when defining index concurrently under resource group · 249c3c23
      Pengzhou Tang 提交于
      When define index concurrently, DefineIndex() commits current transaction and
      dispatch a command to segments without resource group info, therefore, QE get
      a capability info with zero configured, the problem is groupReleaseMemQuota()
      use the empty capability info wrong and caused a floating-point exception.
      
      According to the code, it should use prevSharedInfo->caps instead
      249c3c23
    • J
      cd91caac
    • D
      Ensure error stack before using as array subscript · c94d890b
      Daniel Gustafsson 提交于
      -1 is a valid value for errordata_stack_depth until errstart() has
      been called which inits the stack. In correct usage it's thus fine
      to use it as an array subscript without inspecting it, since demote
      and dismiss are useless outside an error context. Incorrect usage
      would however cause a memory error so guard against that since it's
      the right thing to do.
      c94d890b
    • D
      Use safe string copying in libpq SSL support · d2957303
      Daniel Gustafsson 提交于
      strncpy() can render the buffer non-NULL terminated on input which
      is MAXPGPATH characters long. This is not only incorrect code, it's
      a mismerge since upstream has never used strncpy here, but strlcpy.
      Fix by replacing with strlcpy calls, thus aligning us with upstream
      better as well.
      d2957303
    • D
      Set word counter value in bitmap page · 48557d26
      Daniel Gustafsson 提交于
      The num_cwords member was left blank which cause issues for the
      freeing function which operates based on its value.
      48557d26
    • D
      Always read returnvalue from stat calls · 742e5415
      Daniel Gustafsson 提交于
      {f}stat() can fail and reading the stat buffer without checking for
      status is bad hygiene. Ensure to always test return value and take
      the appropriate error path in case of stat error.
      742e5415
    • D
      Avoid reading uninitialized data · 00735953
      Daniel Gustafsson 提交于
      Iff the value isn't a varlena, then dataLen and dataStart won't be
      set but we may still come to inspect them later on. Avoid reading
      uninitialized variables by zeroing them in that case and check for
      that before reading.
      00735953
    • D
      Ensure to NULL terminate string · 25e06aeb
      Daniel Gustafsson 提交于
      The strncpy() will make path2 non-NULL terminated in the (rare?)
      cases where filespaceLocation2 is MAXPGPATH chars long. Use strlcpy
      instead like other places in the codepath does and ensure we always
      have a NULL terminated string.
      25e06aeb
  2. 31 8月, 2017 8 次提交
  3. 30 8月, 2017 7 次提交
    • H
      Remove bogus/unnecessary gpdiff "mvd" directives. · 6f73417b
      Heikki Linnakangas 提交于
      Most, if not all, of the queries in the qp_olap_windowerr test, contained
      gpdiff "mvd" directives, to tell gpdiff what the expected order of output
      rows is. However, all of the queries in that test fail on purpose, because
      of varios errors. That means that the "mvd" directives didn't do anything,
      because there were not result sets in the output.
      
      However, commit de548159, added a few tests that return a result set,
      to the end of the test script. That caused the preceding "mvd" directives
      to be applied, incorrectly, to those new result sets. That produced a lot
      of messages like "specified MVD column out of range: 3 vs 1" in the
      console. While harmless, they didn't cause the test to fail, let's be tidy.
      6f73417b
    • H
      Remove misc unused code. · 37d2a5b3
      Heikki Linnakangas 提交于
      'nuff said.
      37d2a5b3
    • Y
      Add client and loader support for aix7_ppc_64 platform (#3051) · f3720b76
      Yuan Zhao 提交于
      1. Add dependency packages to Ivy
      2. Modify set_bld_arch.sh to correctly recongize aix7
      3. Disable unsupported python libraries on aix7.
      4. Disable gpmapreduce for aix7
      5. Set ADDON_DIR for aix7
         Signed-off-by: Peifeng Qiu pqiu@pivotal.io
      f3720b76
    • T
      Backport Postgres commit 9b1b9446f563c85d1fe6bb8fca91a2608f3b9577, with minor changes · f86622d9
      Tom Meyer 提交于
      Original commit message:
      
      This speeds up reassigning locks to the parent owner, when the transaction
      holds a lot of locks, but only a few of them belong to the current resource
      owner. This is particularly helps pg_dump when dumping a large number of
      objects.
      
      The cache can hold up to 15 locks in each resource owner. After that, the
      cache is marked as overflowed, and we fall back to the old method of
      scanning the whole local lock table. The tradeoff here is that the cache has
      to be scanned whenever a lock is released, so if the cache is too large,
      lock release becomes more expensive. 15 seems enough to cover pg_dump, and
      doesn't have much impact on lock release.
      
      Jeff Janes, reviewed by Amit Kapila and Heikki Linnakangas.
      f86622d9
    • H
      Eliminate '#include "utils/resowner.h"' from lock.h · 6b25c0a8
      Heikki Linnakangas 提交于
      It was getting in the way of backporting commit 9b1b9446f5 from PostgreSQL,
      which added an '#include "storage/lock.h"' to resowner.h, forming a cycle.
      
      The include was only needed for the decalaration of awaitedOwner global
      variable. Replace "ResourceOwner" with the equivalent "struct
      ResourceOwnerData *" to avoid it.
      
      This revealed a bunch of other files that were relying on resowner.h
      being indirectly included through lock.h. Include resowner.h directly
      in those files.
      
      The ResPortalIncrement.owner field was not used for anything, so instead
      of including resowner.h in that file, just remove the field that needed
      it.
      6b25c0a8
    • X
      Stop FTS probes for mirrorless cluster · 1b18d210
      Xin Zhang 提交于
      An FTS probe to the primaries in a mirrorless cluster will never
      result in the update of gp_segment_configuration.  If a primary goes
      down, we must keep the primary marked as up so that gpstart can start
      the primary back up.  All transactions will abort and nothing should
      work except for read-only queries to master-only catalog tables.
      
      Stopping the FTS probes for mirrorless cluster introduced an infinite
      loop in FtsNotifyProber in which the dispatcher waits in an infinite
      loop for fts_statusVersion to change.  To break the infinite loop, we
      acknowledge the forced probe request as a no-op and update
      fts_statusVersion to break the loop for the dispatcher.  The
      dispatcher should then act same as before this commit.
      
      We also add #define for character value of GpFaultStrategy.
      
      Authors: Xin Zhang, Ashwin Agrawal, and Jimmy Yih
      1b18d210
    • T
  4. 29 8月, 2017 10 次提交
    • W
      fix bug : gpload does not stop after informatica sends exit call (#3089) · fdc9e0a2
      Weinan WANG 提交于
      Some unreentrant functions are invoked in signal handler.
      
      To fix this bug: change signal handler to asynchronous modle.
      
      using global variable "sig_flag" to store last signal state,every 1s polling or
      after failed happen in block IO function(such as send/ receive) check "sig_flag".
      
        fix bug : gpload does not stop after informatica sends exit call
      
          Some unreentrant functions are invoked in signal handler.
      
          To fix this bug: change signal handler to asynchronous modle.
      
          using global variable "sig_flag" to store last signal state,every 1s polling or
          after failed happen in block IO function(such as send/ receive) check "sig_flag".
      fdc9e0a2
    • H
      Fix copy-pasto in error message. · ccad4f8e
      Heikki Linnakangas 提交于
      Introduced by commit 522c7c09, spotted by Coverity.
      ccad4f8e
    • H
      Move parse node for DO block to where it is in the upstream. · 3d064ae6
      Heikki Linnakangas 提交于
      In PostgresQL, the DO block is after RemoveFuncStmt. It was slightly
      misplaced when it was backported from PostgreSQL 9.0.
      3d064ae6
    • D
      Use ereport() for user facing errors · 926b25c2
      Daniel Gustafsson 提交于
      Any error that the user is expected to see should be using the
      ereport() macro rather than its older cousin elog(). Also avoid
      closing resources just before erroring out as the error cleanup
      will be handled automatically, and move a long message to have
      an errhint instead.
      926b25c2
    • P
      Use IsResGroupEnabled in regress.c to pass binary swap. · 3bffbb2b
      Pengzhou Tang 提交于
      In binary swap test, new binary is replaced by old binary and then run
      pg_dump, however, pg_dump will still try to load new regress.so, so if
      regress.so contain new symbols only belong to new binary, it will report
      an error. For resGroupPalloc() ifself, IsResGroupEnabled or
      IsResGroupActivated make no much difference, so to make binary swap pass,
      we still use IsResGroupEnabled.
      3bffbb2b
    • H
      Fix broken heap_form_tuple function. · 4b6d4da8
      Heikki Linnakangas 提交于
      I'm not sure if we broke this during the 8.3 merge, or if it was broken
      even before that, but our version of heap_form_tuple was confused over
      what the isnull argument is. The difference between heap_form_tuple()
      and heap_formtuple() is the values used in the "isnull" array, but
      our heap_form_tuple passed a 'char' array to the internal heap_fill_tuple()
      function, which assumes a 'bool' arry.
      
      That caused an assertion failure in hstore regression tests (and almost
      certainly a crash or at least wrong results without assertions, though I
      didn't check.)
      
      To fix, take the version of heap_form_tuple() from PostgreSQL 8.4, which
      converts the 'char' array to a 'bool' array, and then calls the new
      heap_formtuple() function.
      4b6d4da8
    • P
      Initialize SPIMemReserved Within InitResManager · 4895bbb1
      Pengzhou Tang 提交于
      SPIMemReserved was initialized in CreateSharedMemoryAndSemaphores which
      make no sense, this commit put it under InitResManager where the resource
      memory policy is set.
      4895bbb1
    • H
      Refactor window function grammar rules, to reduce diff vs. upstream. · df8d694e
      Heikki Linnakangas 提交于
      As a pleasent side-effect, the window specification in a
      "func_expr OVER (window_spec)" rule now gets its parse location set
      correctly. Thanks to that, a few error messages now give a user-friendly
      error location line.
      df8d694e
    • H
      Disable broken \ef psql command. · 62f9cdd7
      Heikki Linnakangas 提交于
      GPDB 5 doesn't have the pg_get_functiondef server function needed by \ef,
      so it doesn't work.
      
      Fixes github issue #3076.
      
      This is a backport of an upstream commit that conveniently fixes this:
      
      commit 2463f5da3ccd67b266ee7a9b8c0906221a501b9e
      Author: Tom Lane <tgl@sss.pgh.pa.us>
      Date:   Thu Nov 10 18:37:05 2011 -0500
      
          Throw nice error if server is too old to support psql's \ef or \sf command.
      
          Previously, you'd get "function pg_catalog.pg_get_functiondef(integer) does
          not exist", which is at best rather unprofessional-looking.  Back-patch
          to 8.4 where \ef was introduced.
      
          Josh Kupershmidt
      62f9cdd7
    • P
      Perform resource group operations only when it's initialized · 939208b5
      Pengzhou Tang 提交于
      The resource group is enabled but not initialized on auxiliary processes
      and special backends like ftsprobe and filerep, previously we performed
      resource group operations no matter resource group is initialized or not
      which leads to some unexpected error.
      939208b5