1. 14 11月, 2020 1 次提交
    • A
      gpstart logs commands' stderr · 717f0c47
      Adam Lee 提交于
      I have seen too many "[CRITICAL]:-gpstart failed. (Reason='')
      exiting..." errors, and there was nothing in the log. The reason could
      be "SSH PATH", "Python modules" or some other issues.
      
      Log the stderr to save debugging efforts.
      717f0c47
  2. 12 11月, 2020 1 次提交
    • D
      Add Orca index only scan cost formula (#11106) · bc7ab7bd
      David Kimura 提交于
      Planner costs index-only-scan relative to index-scan. In the case of
      index-only-scan, `RelOptInfo->allvisfrac` can be used to reduce the cost
      when the visimap contains all-visible blocks. Thus, if index-only-scan
      is possible, it will be favored.
      
      In this commit, Orca also costs index-only-scan relative to index-scan
      and scales the cost based on percentage of all-visible blocks in the
      visimap. This is done by storing `pg_class.relallvisible` stats in
      CDXLRelStats which is accessible during costing. In DXL this is added to
      RelationStatistics:
      ```
      <dxl:RelationStatistics ... RelPages="XX" RelAllVisible="YY"/>
      ```
      
      Also in this commit, we update gpsd and minirepro to collect stats for
      relallvisible. In doing this we also udpated the tools to use python3
      sytnax.
      
      And finally, it also adds a new option "index_only_scan_tests" in
      cal_bitmap_test to callibrate index only scan cost/execution.
      bc7ab7bd
  3. 09 11月, 2020 1 次提交
    • X
      compatible gpload (#11103) · f7174966
      xiaoxiao 提交于
      * refactor gpload test file TEST.py
      
      1. migrate gpload test to pytest
      2. new function to form config file through yaml package and make it more reasonable
      3. add a case to cover gpload update_condition arggument
      
      * migrate gpload and TEST.py to python3.6
      new test case 43 to test gpload behavior when column name has capital letters and without data type
      change some ans file since psql react different
      
      * change sql to find reuseable external table to make gpload compatible in gp7 and gp6
      better TEST.py to write config file with ruamel.yaml moudle
      Co-authored-by: NXiaoxiaoHe <hxiaoxiao@vmware.com>
      f7174966
  4. 07 11月, 2020 3 次提交
  5. 05 11月, 2020 1 次提交
  6. 03 11月, 2020 1 次提交
  7. 31 10月, 2020 1 次提交
  8. 30 10月, 2020 3 次提交
    • C
      Fix source greenplum_path.sh error with set -u (#11085) · 1f429744
      Chen Mulong 提交于
      The error was introduced by dc96f667.
      If `set -u` was called before sourcing greenplum_path.sh with bash, an
      error `ZSH_VERSION: unbound variable` would be reported.
      To solve the issue, use shell syntax `{:-}` which will output an empty
      value if the variable doesn't exist.
      
      Tested with zsh, bash and dash.
      1f429744
    • C
      Make greenplum-path.sh compatible with more shells (#11043) · dc96f667
      Chen Mulong 提交于
      The generated greenplum_path.sh env file contained bash specific syntax
      previously, so it errors out if the user's shell is zsh.
      
      zsh doesn't have BASH_SOURCE. "${(%):-%x}" is the similar replacement
      for zsh.
      Also try to support other shells with some command combinations.
      Tested with bash/zsh/dash.
      dc96f667
    • D
      gpinitsystem -I should respect master dbid != 1 · 00ae3013
      dh-cloud 提交于
      Looking at GP documents, there is no indication that master dbid
      must be 1. However, when CREATE_QD_DB, gpinitsystem always writes
      "gp_dbid=1" into file `internal.auto.conf` even if we specify:
      
      ```
      mdw~5432~/data/master/gpseg-1~2~-1
       OR
      mdw~5432~/data/master/gpseg-1~0~-1
      ```
      
      But catalog gp_segment_configuration can have the correct master
      dbid value (2 or 0), the mismatch causes gpinitsystem hang.
      Users can run into such problem for their first time to use
      gpinitsystem -I.
      
      Here we test dbid 0, because PostmasterMain() will simply check
      dbid >= 0 (non-utility mode), it says:
      
      > This value must be >= 0, or >= -1 in utility mode
      
      It seems 0 is a valid value.
      
      Changes:
      
      - use specified master dbid field when CREATE_QD_DB.
      - remove unused macros MASTER_DBID, InvalidDbid in C sources.
      Reviewed-by: NAshwin Agrawal <aashwin@vmware.com>
      00ae3013
  9. 27 10月, 2020 1 次提交
    • A
      Fix a shell issue of empty string · 5db43663
      Adam Lee 提交于
      If the $(UBUNTU_PLATFORM) is an empty string, the test command will fail,
      double quotes it to fix.
      
      ```
      --- mock for platform
      /bin/sh: line 0: [: =: unary operator expected
      ```
      5db43663
  10. 26 10月, 2020 1 次提交
  11. 24 10月, 2020 1 次提交
    • D
      gpstart: testing of improve handling of down segment hosts · e39465ae
      David Krieger 提交于
      The tests in commit be5d11e2 contained a typo that caused the changes
      in the Scenario "gpstart starts even if the standby host is unreachable"
      to not properly cleanup after itself.  Though the test feature still
      passes, this leaves a bug to be found later when more tests are added.
      e39465ae
  12. 23 10月, 2020 1 次提交
    • A
      gprecoverseg: log the error if pg_rewind fails · 57756cc0
      Adam Lee 提交于
      It didn't log the error message before if pg_rewind fails, fix that to make
      DBA/field/developer's life eaisier.
      
      Before this:
      ```
      20201022:15:19:10:011118 gprecoverseg:earth:adam-[INFO]:-Running pg_rewind on required mirrors
      20201022:15:19:12:011118 gprecoverseg:earth:adam-[WARNING]:-Incremental recovery failed for dbid 2. You must use gprecoverseg -F to recover the segment.
      20201022:15:19:12:011118 gprecoverseg:earth:adam-[INFO]:-Starting mirrors
      20201022:15:19:12:011118 gprecoverseg:earth:adam-[INFO]:-era is 0406b847bf226356_201022151031
      ```
      
      After this:
      ```
      20201022:15:33:31:019577 gprecoverseg:earth:adam-[INFO]:-Running pg_rewind on required mirrors
      20201022:15:33:31:019577 gprecoverseg:earth:adam-[WARNING]:-pg_rewind: fatal: could not find common ancestor of the source and target cluster's timelines
      20201022:15:33:31:019577 gprecoverseg:earth:adam-[WARNING]:-Incremental recovery failed for dbid 2. You must use gprecoverseg -F to recover the segment.
      20201022:15:33:31:019577 gprecoverseg:earth:adam-[INFO]:-Starting mirrors
      20201022:15:33:31:019577 gprecoverseg:earth:adam-[INFO]:-era is 0406b847bf226356_201022151031
      ```
      57756cc0
  13. 22 10月, 2020 1 次提交
    • J
      gpstart: improve handling of down segment hosts · be5d11e2
      Jamie McAtamney 提交于
      Currently, if a host is unreachable when gpstart is run, it will not report this
      and will instead fail with an error that is both inaccurate and unhelpful to the
      user, such as claiming that checksums are invalid for segments on a given host
      when it simply can't reach that host to verify the checksums.
      
      This commit adds a check to verify that all hosts are reachable before beginning
      the startup process and, if one or more hosts are not reachable, marks segments
      on those hosts down (in gparray, not in the cluster) so gpstart won't try to run
      any checks against unreachable hosts and so that the cluster can still be started
      in this state so long as there are otherwise enough valid segments to start it.
      be5d11e2
  14. 21 10月, 2020 1 次提交
  15. 09 10月, 2020 1 次提交
    • D
      Replace list() with set() validation in analyzedb · 1a7b4c83
      Denis Smirnov 提交于
      After testing analyzedb on a huge database with 170k tables we
      have found a bottleneck while printing candidate list to analyze.
      It took about 45 minutes to print all tables. The bottleneck was
      in O(n^2) complexity when we validated candidates in a loop with
      a list() instead of set(). The same O(n^2) validation is made while
      running analyze commands on executor pool.
      This commit change candidate type from list() to set() to reduce
      complexity from O(n^2) to O(n).
      1a7b4c83
  16. 01 10月, 2020 3 次提交
    • B
      Exclude only 127.0.0.x and ::1 address. · 555aba93
      Bhuvnesh Chaudhary 提交于
      With the ifaddrs utility, we excluded ip addresses on the loopback
      interface which caused regression causing replication entries to be not
      populated for such interfaces causing gpaddmirrors and gpinitstandby to
      fail. Routable IP addresses can be assigned to the loopback interface,
      and this case was not considered earlier.
      This commit fixes the issues by allowing all loopback addresses
      except 127.0.0.1 and ::1 address
      555aba93
    • A
      gpinitsystem: remove sorting hostname logic · 880ce21e
      Ashwin Agrawal 提交于
      In case of multi-host setup, gpinitsystem used to sort the hostnames
      provided in hostfile. This logic seems guessing user intention and
      hence unnecessary intelligence. Better to just use the order in which
      names appear in file to deploy GPDB.
      
      Searching though the historical code of greenplum, found previously it
      used sort command but that used to yield unintended outcome and hence
      logic was coded in python (because the desired outcome wished is
      equivalent to what sort --version-sort would give). Though why sorting
      existed in first place is no where to be found.
      
      Input host file:
      -------
      sdw1-1
      sdw10-1
      sdw1-2
      sdw10-2
      -------
      
      Sorted:
      -------
      sdw1-1
      sdw1-2
      sdw10-1
      sdw10-2
      -------
      
      This logic got broken with Python3 changes, as the regex coded doesn't
      work with Python3. It's still mystery for me how it worked for Python2
      even. Anyway, lets just avoid sorting as we have no idea what naming
      convention user is having for hostnames.
      880ce21e
    • A
      Delete logic to cleanup shared memory on unclean shutdown · 44d90150
      Ashwin Agrawal 提交于
      Postgres has logic to reuse or cleanup the shared-memory from previous
      unclean shut-down. Plus, also starting b0fc0df9 the System V shared
      memory consumption was dramatically reduced. Hence, no need to have
      this logic in utilities to clean up shared memory.
      
      The main reason to make this change now is postmaster.pid file format
      changed and postmaster status is recorded on last
      line. CleanSharedMem() was coded with expectation last line will
      always be shared memory key, no more holds true due to it. If we have
      to keep this logic around need to change the logic to read line 7 from
      file and not last line. Given the need doesn't exist, just deleting
      the logic instead of fixing it.
      
      Based on inputs from Heikki Linnakangas and Asim R P.
      44d90150
  17. 25 9月, 2020 12 次提交
    • J
      Update gpexpand to Python 3 · 379cd8e5
      Jamie McAtamney 提交于
      Change sorting to use key functions, use bytestrings for interview
      379cd8e5
    • J
      3c124b2f
    • A
      Update packcore tests to Python 3 · da34086f
      Ashwin Agrawal 提交于
      da34086f
    • T
      Replace unix.InterfaceAddrs with gp.IfAddrs · c3167d17
      Tyler Ramer 提交于
      This was an outstanding TODO, and there is an added benefit of removing
      yet another extensive shell command which is fragile.
      Authored-by: NTyler Ramer <tramer@vmware.com>
      c3167d17
    • J
      Update isolation2 tests to Python 3 · 05a33dda
      Jamie McAtamney 提交于
      This commit is mostly general Python 3 changes of the sort already made to the
      utilities code (updating print syntax, updating imports, using bytestrings when
      necessary, fixing sorting behavior, and so forth).
      
      The major change of note in this commit is entirely replacing plpythonu with
      plpython3u.  While it would technically be possible to support both versions of
      PL/Python concurrently, as the version of Python used by PL/Python doesn't have
      to match the version used for the utilities, we've made the decision not to try
      to support both, since users will need to update to Python 3 regardless.
      Co-authored-by: NAshwin Agrawal <aashwin@vmware.com>
      Co-authored-by: NJamie McAtamney <jmcatamney@vmware.com>
      Co-authored-by: NTyler Ramer <tramer@vmware.com>
      05a33dda
    • T
      Update utilities test code for Python 3 · ab965ba5
      Tyler Ramer 提交于
      This commit makes several broad changes to address conversion issues common to
      multiple test files:
      
      - Several built-in functions have been deprecated or renamed, or now need to
        use bytestrings (and associated encoding and decoding) instead of strings
      
      - There is a "test case" run when ComputeCatalogUpdate is executed as a
        standalone program, but this should not be present in shipped code, so we
        remove it
      
      - Some shelled-out commands in test code have been simplified due to changes
        to shell escaping, file redirection, and string manipulation, moving string
        parsing logic from shell commands to internal Python logic wherever possible
      Co-authored-by: NAshwin Agrawal <aashwin@vmware.com>
      Co-authored-by: NJamie McAtamney <jmcatamney@vmware.com>
      Co-authored-by: NTyler Ramer <tramer@vmware.com>
      ab965ba5
    • J
      Update gpcheckcat for Python 3 · 63fca133
      Jamie McAtamney 提交于
      - Certain objects in gpcheckcat can no longer be sorted with Python 3's new
        hashing logic, and the sorting was not functionally necessary, so the sorting
        has been removed.
      
      - In Python 2, variables of type gpcatalog.GPCatalogTable were automatically
        coerced to strings when performing string comparisons.  Python 3 is stricter,
        so an explicit conversion is required.
      
      - The reduce function is no longer built in and must be imported, and the changes
        to sorting require a separate key function in the orphan table check.
      Co-authored-by: NJamie McAtamney <jmcatamney@vmware.com>
      Co-authored-by: NTyler Ramer <tramer@vmware.com>
      63fca133
    • J
      Replace pickling with json and shlex in utilities · b248209e
      Jamie McAtamney 提交于
      Pickling was previously used in several utilities when shelling out commands
      and/or executing commands remotely, in order to avoid needing to escape strings
      when passing them back to the master.  The actual string contents were largely
      or wholly ASCII, so pickling was overkill for that purpose.
      
      The semantics of byte strings in Python 3 breaks the pickling logic, so we've
      taken the opportunity to simplify that whole logic stack.  Code that formerly
      pickled strings now uses shlex.quote() to escape strings where possible and
      serializes strings with json where that is insufficient, removing any helper
      functions that are no longer necessary.
      Authored-by: NJamie McAtamney <jmcatamney@vmware.com>
      Authored-by: NTyler Ramer <tramer@vmware.com>
      
      Removed unused or unecessary helper functions from gppylib
      
      Shell escape function was unused and python 3 shlex.quote() function
      should be used anyway.
      
      canStringBeParsedAsInt was a silly helper function, and also failed to
      actually complete the cast as string.
      Authored-by: NTyler Ramer <tramer@vmware.com>
      b248209e
    • J
      Update utilities code to work with Python 3 · 78f5cf43
      Jamie McAtamney 提交于
      This commit makes several broad changes to address conversion issues common to
      multiple utilities:
      
      - The input and output of subprocess in Python 3 are now bytestrings instead
        of strings. Thus, some sanitizing of inputs and outputs is necessary
      
      - Many built-in functions like raw_input and __cmp__ are deprecated in Python 3,
        and as a side effect list sorting and hashing work differently, requiring a
        different set of helper functions
      
      - Implicit relative imports no longer work, so dbconn (in utilities code) and
        mgmt_utils (in test code) must be added to the search path and imported using
        a full path instead
      
      - File objects require flush methods in python3, and popen2 has been deprecated
      Co-authored-by: NJamie McAtamney <jmcatamney@vmware.com>
      Co-authored-by: NTyler Ramer <tramer@vmware.com>
      78f5cf43
    • T
      Remove subprocess32 · 6071056d
      Tyler Ramer 提交于
      The subprocess32 package is a backport of Python 3 subprocess functionality to
      Python 2, so with the upgrade to Python 3 it is no longer necessary.
      
      This commit deletes the package from pythonSrc and changes import statements to
      import subprocess directly, instead of falling back to it only if subprocess32
      is not importable.
      Co-authored-by: NJamie McAtamney <jmcatamney@vmware.com>
      Co-authored-by: NTyler Ramer <tramer@vmware.com>
      6071056d
    • T
      Allow GPDB to build and test with Python 3 · 7306abea
      Tyler Ramer 提交于
      - Update Python file shebangs to use python3 and update gp_replicate_check and
        gpversion.py to allow running under Python 3
      
      - Use Centos 7 dev containers with Python 3 and pip3 installed for testing, as
        prod containers do not yet work with Python 3, and update Travis with Python 3
      
      - Install dependencies with pip3 to get Python 3-compatible versions
      
      - Copy the Python 3 version of .so files, don't unset PYTHONHOME and PYTHONPATH,
        and don't remove built files from install locations, so that the Python 2 and
        Python 3 versions of various files can coexist
      Co-authored-by: NJamie McAtamney <jmcatamney@vmware.com>
      Co-authored-by: NKris Macoskey <kmacoskey@vmware.com>
      Co-authored-by: NTyler Ramer <tramer@vmware.com>
      7306abea
    • J
      Run 2to3 against Python code · 54a65573
      Jamie McAtamney 提交于
      The 2to3 utility is an officially-supported script to automatically convert
      Python 2 code to Python 3.  It's not a complete fix by any means, but it
      handles most basic syntax transformations and similar.
      
      This commit is the result of running 2to3 against every Python file in the
      gpMgmt directory, so it's quite large and fairly scattershot.  Manual updates
      to any code that 2to3 can't handle will come in later commits.
      54a65573
  18. 16 9月, 2020 1 次提交
  19. 14 9月, 2020 1 次提交
    • J
      Fix gpexpand help usage · cb2afaf9
      japinli 提交于
      In commit 5eaa5889, the --novacuum option is removed, however the help
      page of gpexpand keep the -V option, which is a short option for
      --novacuum.
      cb2afaf9
  20. 09 9月, 2020 3 次提交
  21. 07 9月, 2020 1 次提交