1. 27 2月, 2020 6 次提交
  2. 26 2月, 2020 6 次提交
  3. 25 2月, 2020 2 次提交
    • H
      Introduce execute on initplan option for function · b387ef35
      Hubert Zhang 提交于
      For query like 'create table t as select * from f()',
      if f() needs to do dispatch, then it must be run on QD.
      Currently, function could be specified to execute on master,
      but the above CTAS query will run the function on EntryDB.
      In fact, QD needs to do the CTAS work and cannot run function
      at all.
      
      To overcome this problem, we introduce a new location option
      for function: EXECUTE ON INITPLAN and run the f() on initplan
      before the CTAS work and store function results into tuplestore.
      Then when the real function running on EntryDB, it skip the
      function logic, but fetch tuples from the tuplestore instead.
      
      New plan is like:
       Redistribute Motion 1:3  (slice1)
         Hash Key: f.i
         ->  Function Scan on f
               InitPlan 1 (returns $0)  (slice2)
                 ->  Function Scan on f f_1
      
      Note that this commit only has basic support for this feature,
      Only one function is allowed in CTAS query.
      
      (cherry picked from commit a21ff23b)
      b387ef35
    • P
      Check fts probe request before WaitLatch() in fts loop for timely fts probe response. (#9478) · 34a03e5f
      Paul Guo 提交于
      fts probe trigger via query gp_request_fts_probe_scan() or internal function
      FtsNotifyProber() may wait ~60 additionally seconds (i.e. guc
      gp_fts_probe_interval) because FtsLoop()->WaitLatch() blocks until timeout.
      The root cause is that it is possible that the latch in below stack is waken
      up at first.
      	WaitLatch()
      	SyncRepWaitForLSN()
      	RecordTransactionCommit()
      	CommitTransaction()
      	CommitTransactionCommand()
      	updateConfiguration()
      	processResponse()
      	FtsWalRepMessageSegments()
      	FtsLoop()
      
      I found this issue when testing test fts_unblock_primary. The test sometimes
      run for 60 more seconds than usual.
      
      Fix this by rechecking the probe request before FtsLoop()->WaitLatch().
      Reviewed-by: NAshwin Agrawal <aagrawal@pivotal.io>
      
      Cherry-picked from 545f4466
      34a03e5f
  4. 22 2月, 2020 5 次提交
  5. 21 2月, 2020 1 次提交
    • A
      Bugfix: rows might be split into wrong partitions · c79eefce
      Ashwin Agrawal 提交于
      split_rows() scans tuples from T and route them to new parts (A, B) based
      on A's or B's constraints. If T has one or more dropped columns before its
      partition key, T's partition key would have a different attribute number
      from its new parts. In this case, the constraints choose a wrong column
      which can cause bad behaviors.
      
      To fix it, each tuple iteration should reconstruct the partition tuple
      slot and assign it to econtext before ExecQual calls. The reconstruction
      process can happen once or twice because we assume A, B might have two
      different tupdescs.
      
      One bad behavior, rows are split into wrong partitions. Reproduce:
      
      ```sql
      DROP TABLE IF EXISTS users_test;
      
      CREATE TABLE users_test
      (
        id          INT,
        dd          TEXT,
        user_name   VARCHAR(40),
        user_email  VARCHAR(60),
        born_time   TIMESTAMP,
        create_time TIMESTAMP
      )
      DISTRIBUTED BY (id)
      PARTITION BY RANGE (create_time)
      (
        PARTITION p2019 START ('2019-01-01'::TIMESTAMP) END ('2020-01-01'::TIMESTAMP),
        DEFAULT PARTITION extra
      );
      
      /* Drop useless column dd for some reason */
      ALTER TABLE users_test DROP COLUMN dd;
      
      /* Forgot/Failed to split out new partitions beforehand */
      INSERT INTO users_test VALUES(1, 'A', 'A@abc.com', '1970-01-01', '2020-01-01 12:00:00');
      INSERT INTO users_test VALUES(2, 'B', 'B@abc.com', '1980-01-01', '2020-01-02 18:00:00');
      INSERT INTO users_test VALUES(3, 'C', 'C@abc.com', '1990-01-01', '2020-01-03 08:00:00');
      
      /* New partition arrives late */
      ALTER TABLE users_test SPLIT DEFAULT PARTITION START ('2020-01-01'::TIMESTAMP) END ('2021-01-01'::TIMESTAMP)
       INTO (PARTITION p2020, DEFAULT PARTITION);
      
      /*
       * - How many new users already in 2020?
       * - Wow, no one.
       */
      SELECT count(1) FROM users_test_1_prt_p2020;
      ```
      Reviewed-by: NGeorgios Kokolatos <gkokolatos@pivotal.io>
      Reviewed-by: NHeikki Linnakangas <hlinnakangas@pivotal.io>
      (cherry picked from commit 101922f1)
      Co-authored-by: NAshwin Agrawal <aagrawal@pivotal.io>
      c79eefce
  6. 19 2月, 2020 3 次提交
    • H
      Enhance gpfdist error log (#9230) (#9587) · d34adf5e
      Huiliang.liu 提交于
      Print errno and message if local_send() fails.
      Print detail information on session end
      d34adf5e
    • H
      Fix dependencies issue in GPPKG utility (6X_STABLE) (#9494) · bf7bc9e9
      Haozhou Wang 提交于
      1. When two gppkg packages have the same dependencies, gppkg utility
         will refuse to install the second gppkg package and throw an error.
         This patch fixes this issue and the second gppkg package can install
         successfully.
      
      2. Fix install/uninstall issue if the master and standby master use the
         same node address.
      
      PS: This patch is backported from the master branch
      bf7bc9e9
    • A
      Avoid ifaddrs utility crash · 78d4e6bb
      Ashwin Agrawal 提交于
      `ifa_addr` may be null for interface returned by getifaddrs(). Hence,
      checking for the same should be perfomed, else ifaddrs crashes. As
      side effect to this crashing, on my ubuntu laptop gpinitstandby always
      fails.
      
      Interface for which `getifaddrs()` returned null for me is:
      gpd0: flags=4240<POINTOPOINT,NOARP,MULTICAST>  mtu 1500
              unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
              RX packets 0  bytes 0 (0.0 B)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 0  bytes 0 (0.0 B)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      
      (gdb) p *list
      $5 = {ifa_next = 0x5555555586a8, ifa_name = 0x555555558694 "gpd0",
      ifa_flags = 4240, ifa_addr = 0x0, ifa_netmask = 0x0, ifa_ifu =
      {ifu_broadaddr = 0x0, ifu_dstaddr = 0x0}, ifa_data = 0x555555558bb8}
      Reviewed-by: NJacob Champion <pchampion@pivotal.io>
      Reviewed-by: NMark Sliva <msliva@pivotal.io>
      78d4e6bb
  7. 18 2月, 2020 1 次提交
  8. 17 2月, 2020 1 次提交
  9. 15 2月, 2020 6 次提交
  10. 14 2月, 2020 2 次提交
    • P
      Various dtm related code cleanup. (#9543) · d2f1b48d
      Paul Guo 提交于
      Main changes are:
      
      - Merge isQDContext() and isQEContext() since the later is a bit buggy and
        there is no need to separate them in gpdb master now.
      - Remove an incorrect or unnecessary switch in notifyCommittedDtxTransaction().
      - Rename some two phase variables or functions since they could be used in
        one phase also.
      - Remove some unnecessary Assert code (some are because previous code logic has
        judged; some are due to obvious reasons).
      - Rename DTX_STATE_PERFORMING_ONE_PHASE_COMMIT to
        DTX_STATE_NOTIFYING_ONE_PHASE_COMMIT to make code more align with 2PC code.
      - Remove useless state DTX_STATE_FORCED_COMMITTED.
      Reviewed-by: NHubert Zhang <hzhang@pivotal.io>
      Reviewed-by: NGang Xiong <gxiong@pivotal.io>
      
      Cherry-picked from 83da7ddf
      d2f1b48d
    • S
      Bump ORCA version to v3.91.0 · cd43e75e
      Shreedhar Hardikar 提交于
      Includes ORCA-side refactors & renames in preparation for supporting
      opfamilies in ORCA.
      cd43e75e
  11. 13 2月, 2020 4 次提交
    • P
      Revert "Various dtm related code cleanup. (#9543)" · 50d2c793
      Paul Guo 提交于
      This reverts commit 1c46340a.
      
      unit test fails (I did not test this locally).
      50d2c793
    • P
      Various dtm related code cleanup. (#9543) · 1c46340a
      Paul Guo 提交于
      Main changes are:
      
      - Merge isQDContext() and isQEContext() since the later is a bit buggy and
        there is no need to separate them in gpdb master now.
      - Remove an incorrect or unnecessary switch in notifyCommittedDtxTransaction().
      - Rename some two phase variables or functions since they could be used in
        one phase also.
      - Remove some unnecessary Assert code (some are because previous code logic has
        judged; some are due to obvious reasons).
      - Rename DTX_STATE_PERFORMING_ONE_PHASE_COMMIT to
        DTX_STATE_NOTIFYING_ONE_PHASE_COMMIT to make code more align with 2PC code.
      - Remove useless state DTX_STATE_FORCED_COMMITTED.
      Reviewed-by: NHubert Zhang <hzhang@pivotal.io>
      Reviewed-by: NGang Xiong <gxiong@pivotal.io>
      
      Cherry-picked from 83da7ddf
      1c46340a
    • A
      Incremental recovery and rebalance should run pg_rewind in parallel · 3ddbed8e
      Asim R P 提交于
      Incremental recovery and rebalance operations involve running
      pg_rewind against failed primaries.  This patch changes gprecoverseg
      such that pg_rewind is invoked in parallel, using the WorkerPool
      interface, for each affected segment in the cluster.  There is no
      reason to rewind segments one after the other.
      
      Fixes Github issue #9466
      
      Reviewed by: Mark Sliva and Paul Guo
      
      (cherry picked from commit 43ad9d05)
      3ddbed8e
    • H
      Allocate temporary hash tables in right memory context. · 133c0c9e
      Heikki Linnakangas 提交于
      We were passing the parent memory context as NULL, which caused them to
      be allocated permanently. That was surely not intended.
      133c0c9e
  12. 12 2月, 2020 2 次提交
  13. 11 2月, 2020 1 次提交
    • H
      packaging gpversion.py into gpdb clients tarball (#9534) (#9556) · ac468b85
      Huiliang.liu 提交于
      gpload uses gpversion.py to parse gpdb version. So that it can compatible with gpdb5 and gpdb6.
      Then we can only maintain one gpload version and some new features or bug fix could be used by gpdb5 customers.
      so we package gppylib.gpversion into gpdb clients tarball
      ac468b85