1. 29 3月, 2018 14 次提交
    • H
      Add a test case for autovacuum on template0. · 1b52d013
      Heikki Linnakangas 提交于
      Commit 4e655714 enabled autovacuum for template0, but didn't include any
      tests to check that autovacuum really runs on template0. This commit adds
      that.
      
      To make this run faster, make debug_burn_xids burn 4096 XIDs instead of
      1024.
      Co-authored-by: NXin Zhang <xzhang@pivotal.io>
      1b52d013
    • M
      Revert "update the typo of commands in the README" · 618c7780
      Mike Roth 提交于
      This reverts commit f7de81d6.
      CLA was not signed
      618c7780
    • P
      Support replicated table in GPDB · 7efe3204
      Pengzhou Tang 提交于
      * Support replicated table in GPDB
      
      Currently, tables are distributed across all segments by hash or random in GPDB. There
      are requirements to introduce a new table type that all segments have the duplicate
      and full table data called replicated table.
      
      To implement it, we added a new distribution policy named POLICYTYPE_REPLICATED to mark
      a replicated table and added a new locus type named CdbLocusType_SegmentGeneral to specify
      the distribution of tuples of a replicated table.  CdbLocusType_SegmentGeneral implies
      data is generally available on all segments but not available on qDisp, so plan node with
      this locus type can be flexibly planned to execute on either single QE or all QEs. it is
      similar with CdbLocusType_General, the only difference is that CdbLocusType_SegmentGeneral
      node can't be executed on qDisp. To guarantee this, we try our best to add a gather motion
      on the top of a CdbLocusType_SegmentGeneral node when planing motion for join even other
      rel has bottleneck locus type, a problem is such motion may be redundant if the single QE
      is not promoted to executed on qDisp finally, so we need to detect such case and omit the
      redundant motion at the end of apply_motion(). We don't reuse CdbLocusType_Replicated since
      it's always implies a broadcast motion bellow, it's not easy to plan such node as direct
      dispatch to avoid getting duplicate data.
      
      We don't support replicated table with inherit/partition by clause now, the main problem is
      that update/delete on multiple result relations can't work correctly now, we can fix this
      later.
      
      * Allow spi_* to access replicated table on QE
      
      Previously, GPDB didn't allow QE to access non-catalog table because the
      data is incomplete,
      we can remove this limitation now if it only accesses replicated table.
      
      One problem is QE need to know if a table is replicated table,
      previously, QE didn't maintain
      the gp_distribution_policy catalog, so we need to pass policy info to QE
      for replicated table.
      
      * Change schema of gp_distribution_policy to identify replicated table
      
      Previously, we used a magic number -128 in gp_distribution_policy table
      to identify replicated table which is quite a hack, so we add a new column
      in gp_distribution_policy to identify replicated table and partitioned
      table.
      
      This commit also abandon the old way that used 1-length-NULL list and
      2-length-NULL list to identify DISTRIBUTED RANDOMLY and DISTRIBUTED
      FULLY clause.
      
      Beside, this commit refactor the code to make the decision-making of
      distribution policy more clear.
      
      * support COPY for replicated table
      
      * Disable row ctid unique path for replicated table.
        Previously, GPDB use a special Unique path on rowid to address queries
        like "x IN (subquery)", For example:
        select * from t1 where t1.c2 in (select c2 from t3), the plan looks
        like:
         ->  HashAggregate
               Group By: t1.ctid, t1.gp_segment_id
                  ->  Hash Join
                        Hash Cond: t2.c2 = t1.c2
                      ->  Seq Scan on t2
                      ->  Hash
                          ->  Seq Scan on t1
      
        Obviously, the plan is wrong if t1 is a replicated table because ctid
        + gp_segment_id can't identify a tuple, in replicated table, a logical
        row may have different ctid and gp_segment_id. So we disable such plan
        for replicated table temporarily, it's not the best way because rowid
        unique way maybe the cheapest plan than normal hash semi join, so
        we left a FIXME for later optimization.
      
      * ORCA related fix
        Reported and added by Bhuvnesh Chaudhary <bchaudhary@pivotal.io>
        Fallback to legacy query optimizer for queries over replicated table
      
      * Adapt pg_dump/gpcheckcat to replicated table
        gp_distribution_policy is no longer a master-only catalog, do
        same check as other catalogs.
      
      * Support gpexpand on replicated table && alter the dist policy of replicated table
      7efe3204
    • kennycool's avatar
      update the typo of commands in the README · f7de81d6
      kennycool 提交于
      f7de81d6
    • H
      Refactor parserOpenTable, to match upstream better. · c97c0927
      Heikki Linnakangas 提交于
      This seems like a more clear and robust way to do this, and matches the
      upstream code more closely, too.
      c97c0927
    • H
      Remove test that breaks every time system columns are added or removed. · a9ca3d2d
      Heikki Linnakangas 提交于
      This test keeps breaking whenever any new columns are added or removed from
      tables with more than 20 columns. That's a pain, we've had to change the
      expected output of this test practically every time we merge. Now that I
      look at this more closely, I don't see the point of this query, so let's
      just remove it.
      a9ca3d2d
    • D
      Remove FIXME about group_id in Distinct HashAgg · 2b25c663
      Dhanashree Kashid 提交于
      With the 8.4 merge, planner considers using HashAgg to implement
      DISTINCT. At the end of planning, we replace the expressions in the
      targetlist of certain operators (including Agg) into OUTER references
      in targetlist of its lefttree (see set_plan_refs() >
      set_upper_references()).
      But, as per the code, in the case when grouping() or group_id() are
      present in the target list of Agg, it skips the replacement and this is
      problematic in case the Agg is implementing DISTINCT.
      
      It seems that the Agg's targetlist need not compute grouping() or
      group_id() when its lefttree is computing it. In that case, it may
      simply refer to it. This would then also apply to other operators
      WindowAgg, Result & PartitionSelector.
      
      However, the Repeat node needs to compute these functions at each stage
      because group_id is derived from RepeatState::repeat_count. Thus, it
      connot be replaced by an OUTER reference.
      
      Hence, this commit removes the special case for these functions for all
      operators except Repeat. Then, a DISTINCT HashAgg produces the correct
      results.
      Signed-off-by: NShreedhar Hardikar <shardikar@pivotal.io>
      2b25c663
    • A
      Test should pass correct gp_dbid when starting segments. · aeec7baf
      Ashwin Agrawal 提交于
      Not passing the right gp_dbid, caused test running after these test to
      fail, as gp_inject_fault checks dbid to set the fault or not. If
      segment was started with gp_dbid=0, the fault fails to set in other
      tests causing failures.
      aeec7baf
    • A
      5addadb6
    • A
      b62cef98
    • A
      Check for probe timeout if ftsPoll() timeout/interrupt happens. · e6dff59e
      Ashwin Agrawal 提交于
      FTS went in infinite loop without this fix on probe if primary failed
      to respond back to probe request. Encountered the issue using suspend
      fault for fts message handler.
      e6dff59e
    • A
      Add promote file to pg_basebackup exclude list. · 2b76293c
      Ashwin Agrawal 提交于
      If primary has promote file and pg_basebackup copies over the same,
      then due to existency of the same mirror gets auto-promoted which is
      very dangerous. Hence avoid copying over promote file.
      2b76293c
    • A
      Make gp_fts_probe_retries guc user facing. · 5ad527f0
      Ashwin Agrawal 提交于
      Not seeing reason for blocking visibility of this guc. Similar to all
      other fts gucs, its useful.
      5ad527f0
    • A
      CHECK_FOR_INTERRUPTS for infinite_loop fault type. · 06f3fb4d
      Ashwin Agrawal 提交于
      If infinite_loop fault is set and shut-down is requested, bail-out
      instead of waiting and needing forced kill. It was this way till
      commit ae760e25 removed the
      `IsFtsShudownRequested()` check. Didn't intentionaly change the
      suspend fault as it never had shut-down check and don't wish to change
      behavior of any tests using the same.
      06f3fb4d
  2. 28 3月, 2018 6 次提交
    • A
      Remove redundant distributed transaction state. · ecc217e8
      Asim R P 提交于
      The DTX_STATE_FORCED_COMMITTED was identical to
      DTX_STATE_INSERTED_COMMITTED.
      ecc217e8
    • A
      Cleanup CommitTransaction and related code and align closer to upstream · 01d88778
      Asim R P 提交于
      Remove a log message to indicate if a QE reader is writing an XLOG
      record.  Back in GPDB 4.3 when lazy XID feature didn't exist, a QE
      reader would be assigned a valid transaction ID.  That could lead to
      extending CLOG and generating XLOG.  This case no longer applies to
      GPDB.
      01d88778
    • A
      Avoid infinite loop in processCopyEndResults · 25bc3855
      Asim R P 提交于
      The command "COPY enumtest FROM stdin;" hit an infinite loop on merge
      branch.  Code indicates that the issue can happen on master as well.
      QD backend went into infinite loop when the connection was already
      closed from QE end.  The TCP connection was in CLOSE_WAIT state.
      Libpq connection status was CONNECTION_BAD and asyncStatus was
      PGASYNC_BUSY.
      
      Fix the infinite loop by checking libpq connection status in each
      iteration.
      25bc3855
    • K
      Bump gpbackup version to 1.0.2 · 88abdd0f
      Karen Huddleston 提交于
      Authored-by: NKaren Huddleston <khuddleston@pivotal.io>
      88abdd0f
    • B
      Add GUC to enable / disable Join Associativity in ORCA · bb68b5c6
      Bhuvnesh Chaudhary 提交于
      This commit introduces a GUC `optimizer_enable_associativity` to enable
      or disable join associativity. Join Associativity increases the search
      space as it increases the numbers of groups to represent a join and its
      associative counterpart, i.e (A X B) X C ~ A X (B X C).
      
      This patch, by default disables join associativity transform, if
      required the users can enable the transform. There are few plan changes
      which are observed due to this change. However, further evaluation of
      the plan changes revealed that even though the cost of the the resulting
      plan has increased, the execution time went down by 1-2 seconds.
      
      For the queries with plan changes, there are 3 tables which are joined,
      i.e A, B and C. If we increase the number of tuples returned by the
      subquery which forms A', we see the old plan. But if the tuples in
      relation B and C is significantly higher, the plan changes with the
      patch yeild faster execution times. This suggests that we may need to
      tune the cost model to adapt to such cases.
      
      The plan cost increase is 1000x as compared to the old plans, this 1000x
      factor is due to the value of `optimizer_nestloop_factor=1024`, if you
      set the value of the GUC `optimizer_nestloop_factor=1`, the plan before
      or after the patch remains same.
      bb68b5c6
    • A
      Use gpxlogloc data type in missing_xlog test. · 6f1353c7
      Ashwin Agrawal 提交于
      Thank You Heikki for pointing out the presence of `gpxlogloc` data type to
      compare xlog locations instead of exiting hacks in test.
      6f1353c7
  3. 27 3月, 2018 5 次提交
  4. 24 3月, 2018 2 次提交
    • G
      Apply DEB_BUILD_OPTIONS for debuild command · c3093daa
      Goutam Tadi 提交于
      - Use nocheck to skip `make check` in test
      - Use parallel to use 6 parallel processes
      c3093daa
    • S
      Remove FIXMEs from create_view test · 997f67d0
      Shreedhar Hardikar 提交于
      Although standard SQL ignores the ORDER BYs in views (and sub-selects),
      PostgreSQL and thus GPDB preserves them.
      
      For the query in create_view.sql, the expected output will be sorted
      according to the ORDER BY clause in the view definition. But, if the
      rows come in the wrong order from the view then gpdiff.pl will not
      report it as an error.
      
      Remove the FIXME in this file, since there is no way to enforce the
      order via gpdiff.pl.
      
      Instead, to test the output row ordering, this commit modifies the
      queries in gp_create_view.sql and adds an order-sensitive operator -
      row_number().
      Signed-off-by: NDhanashree Kashid <dkashid@pivotal.io>
      997f67d0
  5. 23 3月, 2018 6 次提交
  6. 22 3月, 2018 7 次提交
    • R
      d5fb628f
    • P
      Fix SIGSEGV issue when freeing gangs · 772bca3f
      Pengzhou Tang 提交于
      Previously, to avoid the leak of the gang if someone terminates
      the query in the middle of gang creation, we added a global pointer
      named CurrentGangCreating so the partially created gang can also be
      destroyed at the end of the transaction. However, the memory context
      named GangContext where CurrentGangCreating was created may be reset
      before CurrentGangCreating is actually destroyed and a SIGSEGV may
      occur. So this commit makes sure that CurrentGangCreating is destroyed
      ahead of other created gangs and the reset of GangContext.
      772bca3f
    • A
      Add info to help debug if missing_xlog test fails. · ee722999
      Ashwin Agrawal 提交于
      ee722999
    • K
      ci: split icw_extensions_gpcloud by platform · f4965548
      Kris Macoskey 提交于
      f4965548
    • K
      ci: remove icw gate and restructure passing conditions · 46fe563a
      Kris Macoskey 提交于
      Allows the compile and icw tests for each platform to pass
      and fail independently of other platforms.
      
      The gate jobs were born out of necessity to handle infrastructure issues
      with concourse. Now that infrastructure issues have been stabilized,
      it's time to review the layout of the pipeline again.
      
      This commit removes the icw_start_gate job that multiplexed a passing
      condition from all of the compile jobs that sat in front of every icw
      job. This was not desirable following a longer running
      issue with the compilation on one platform, ubuntu16, that then blocked
      icw tests on the remaining platforms.
      
      Replacing the passing condition of icw_start_gate on each icw job is the
      corresponding compilation job for the test, based on platform.
      
      E.G.
      
      This:
                          (blocks)          (blocks)
      compile_gpdb_centos6  -> gate_icw_start -> icw_planner_centos6
      compile_gpdb_ubuntu16 ->                -> icw_planner_ubuntu16
      
      Is now this:
      
                          (blocks)
      compile_gpdb_centos6  -> icw_planner_centos6
                          (blocks)
      compile_gpdb_ubuntu16 -> icw_planner_ubuntu16
      Signed-off-by: NTaylor Vesely <tvesely@pivotal.io>
      46fe563a
    • L
      docs - fix incorrect R version reference (#4734) · 4a65bde9
      Lisa Owen 提交于
      4a65bde9
    • A
      Remove not supported concurrent bitmap index test. · bb5b9160
      Ashwin Agrawal 提交于
      Concurrent index builds are not supoorted in greenplum. Seems there exist GUC
      gp_create_index_concurrently under which we still allow the creations. But still
      with the same for bitmap indexes CONCURRENTLY cannot be supported.
      
      This test keeps failing randomly in CI due to "WARNING: ignoring query cancel
      request for synchronous replication to ensure cluster consistency." This happens
      as during bitmap index creation it locally commits on each segment and then one
      of the segment errors during index build with "ERROR: CONCURRENTLY is not
      supported when creating bitmap indexes", issues cancelation message to other
      segments.
      bb5b9160