1. 23 2月, 2017 14 次提交
  2. 05 2月, 2017 1 次提交
    • J
      Fix gppersistentrebuild and its behave tests · 42bd56dc
      Jimmy Yih 提交于
      The gppersistentrebuild tool was trying to use string_agg without
      casting the oid to text. This used to work before but not anymore. The
      behave tests only have two scenarios but the second scenario would
      always fail because it would run when a primary/mirror segment pair
      were still in resync mode.
      42bd56dc
  3. 23 2月, 2017 15 次提交
    • L
      Fix unit test pollution when calling apply patches · 8017d883
      Larry Hamel 提交于
      * When mocking, we may setup patches that are not cleaned up properly
        and causes test pollutions. Ensure that we do tearDown properly and
        raise a condition if we are not.
      Signed-off-by: NMarbin Tan <mtan@pivotal.io>
      8017d883
    • L
      Add gpconfig --file flag · a86e4901
      Larry Hamel 提交于
      When running gpconfig -s with --file option, we can now view the
      postgresql.conf guc settings instead of just viewing the user guc
      settings in the database. This option also reports if there are any
      inconsistencies with the postgresql.conf between the segments.
      
      reformat gpconfig:
      * enable unit testing
      
      remove gpconfig white-space
      
      Add gpconfig behave tests:
      * When you run gpconfig with -s and --file, you can sometimes run into
      a nonetype string format error. This is due to us not joining all the
      threads properly and closing them out properly.
      
      * Added gpconfig behave tests to ensure that we are not missing anything
       in the unittest tests. As we are mocking the pool, we need to make sure
       that we are not doing anything silly, so adding minimal behave tests.
       Single node is probably enough.
      Signed-off-by: NChumki Roy <croy@pivotal.io>
      Signed-off-by: NMarbin Tan <mtan@pivotal.io>
      a86e4901
    • M
      Update gpconfig help doc · 83e0f5b0
      Marbin Tan 提交于
      83e0f5b0
    • L
      Fix typos and syntax errors · c58c9bc7
      Larry Hamel 提交于
      Signed-off-by: NMarbin Tan <mtan@pivotal.io>
      c58c9bc7
    • M
      Remove white space · ab5e9de8
      Marbin Tan 提交于
      ab5e9de8
    • L
      Remove dead code · 555343a7
      Larry Hamel 提交于
      Signed-off-by: NMarbin Tan <mtan@pivotal.io>
      555343a7
    • L
      Ensure that we use the current python instead of hardcoded value · beb3e5a2
      Larry Hamel 提交于
      * Fixing a hardcoded python library path that may not be valid for other
        python version.
      Signed-off-by: NMarbin Tan <mtan@pivotal.io>
      beb3e5a2
    • A
    • S
      Fix QX coverity issues (#1832) · b0fd898b
      Shreedhar Hardikar 提交于
      * Using uninitialized value kstr.
      
      Field kstr.isPrefixOnly is uninitialized when calling memcpy on line
      3536. Setting kstr is OK since the memcpy will copy the value to ret.
      
      * Buffer not null terminated
      
      Calling strncpy with a maximum size argument of 1024 bytes on
      destination array work_set_path of size 1024 bytes might leave the
      destination string unterminated.
      
      Upstream precedent : 586dd5d6
      b0fd898b
    • A
    • H
      Fix gpcrondump of external tables. · 8578af5e
      Heikki Linnakangas 提交于
      Commit 821b8e10 changed pg_dump's shouldPrintColumn() function to return
      true for all columns in an external table, and changed dumpExternal() to use
      the shouldPrintColumn() function. However, that change was not made to the
      copy of shouldPrintColumn() in cdb_dump_include.c.
      
      That oversight didn't cause any ill effects, until commit 58b86683 came
      along and refreshed cdb_dump_agent.c's copy of the dumpExternal() function,
      to match that in pg_dump.c. With that change cdb_dump_agent's dumpExternal()
      started to call shouldPrintColumn() for external tables, but its version of
      shouldPrintColumn() didn't have the change to always return true for
      external tables yet. As a result, external tables didn't have any of their
      columns included.
      
      To fix, update cdb_dump's copy of shouldPrintColumn() to match that in
      pg_dump.c.
      8578af5e
    • H
      Fix crash if relcache is invalidated while looking up compress type. · 4581f3fa
      Heikki Linnakangas 提交于
      Many callers of get_funcs_for_compression(), like the one from
      appendonly_insert_init() pass a reference to the relcache as argument,
      like this:
      
        get_funcs_for_compression(NameStr(rel->rd_appendonly->compresstype));
      
      If a relcache invalidation happens while looking up compression type,
      that reference to rel->rd_appendonly is free'd and becomes invalid.
      get_funcs_for_compression() performs a catalog lookup, and can therefore
      invalidate the reference itself, before using it.
      
      Make get_funcs_for_compression (GetCompressionImplementation, actually)
      to tolerate that, by making a copy of the argument before calling
      heap_open, which can cause the cache invalidation.
      
      RelationData->rd_index potentially has the same problem, but I don't see
      any problematic call sites that would pass a rel->rd_index reference
      to a function like this. In rd_appendonly, all the other fields but
      compresstype are pass-by-value types (Oid, bool, etc.), that don't have
      the same hazard.
      
      The crash can be reproduced easily by compiling with --enable-testutils,
      setting gp_test_system_cache_flush_force=plain, in a psql session, and
      performing any select or update on a compressed AO table. I am not adding
      a regression test, as it would only work with --enable-testutils, but it
      would be a good idea to run all the regression tests with that GUC enabled,
      every once in a while.
      4581f3fa
    • J
      Remove inapplicable sanity check [#121649701] · 407bc1c5
      Jesse Zhang and Taylor Vesely 提交于
      `rowMarks` in a Query object represent relations whose tuples are subject
      to locking when a query contains `FOR SHARE` or `FOR UPDATE` clauses in
      a SELECT. Those rowMarks are wholesale carried over to an EState, via
      PlannedStmt.
      
      In Postgres the optimizer (planner) would add a junk TID column for each
      table in the rowMarks. And the executor will lock the tuples when
      executing the root node in the plan.
      
      The check we are removing seems dormant even in Postgres: to actually
      cover the `elog(ERROR)`, the code path needs to have
        0. No junk TID columns
        0. A non-empty rowMarks list
      
      In Postgres the above conditions are all-or-nothing. So the check feels
      more like an `Assert` rather than an `elog(ERROR)`, and it seems to be
      dead code.
      
      In Greenplum, the above condition does not hold. Greenplum has a
      different (but compliant) implementation, where we place a lock on each
      table in the rowMarks.  Consequently, we do *not* generate the junk
      column in the plan (except for tables that are only on the master). This
      is reasonable because the root node is most likely executing in a
      different slice from the leaf nodes (which are most likely SCAN's): by
      the time a (hypothetical) TID reaches the root node, there's no
      guarantee that the tuple has not passed through a motion node, hence it
      makes no sense locking it.
      
      This commit removes that check.
      407bc1c5
    • H
      Remove redundant direct dispatch tests. · a92d0e33
      Heikki Linnakangas 提交于
      These exact same tests were in both 'direct_dispatch', and in
      'bfv_dd_types'. Oddly, one SELECT was missing from 'bfv_dd_types', though.
      Add the missing SELECT there, and remove all these type tests from
      'direct_dispatch'.
      
      Now that there are no duplicate table names in these tests, also run
      'direct_dispatch' in the same parallel group as the rest of the direct
      dispatch tests. That's a more logical grouping.
      a92d0e33
    • H
      Make bfv_temp test more robust. · b81a2ca0
      Heikki Linnakangas 提交于
      The test disconnects, and immediately reconnects and checks that temp
      table from the previous session has been removed. However, the old backend
      removes the tables only after the disconnection, so there's a race
      condition here: the new session might query pg_tables and still see the
      table, if the old session was not fast enough to remove it first.
      
      Add a two-second sleep, to make the race condition less likely to happen.
      This is not guaranteed to avoid the race altogether, but I don't see an
      easy way to wait for the specific event that the old backend has exited.
      
      A sleep in a test that doesn't run in parallel with other tests is a bit
      annoying, as it directly makes the whole regression suite slower. To
      compensate for that, move the test to run in parallel with the other
      nearby bfv_* tests. Those other tests don't use temp tables, so it still
      works.
      
      Also, modify the validation query in the test that checks that there are
      no temp tables, to return whole rows, not just COUNT(*). That'll make
      analyzing easier, if this test fails.
      b81a2ca0
  4. 22 2月, 2017 10 次提交