1. 12 10月, 2019 1 次提交
  2. 11 10月, 2019 5 次提交
    • H
      Generate bitmap AM opfamilies automatically from btree opfamilies. · e782e31b
      Heikki Linnakangas 提交于
      Bitmap AM relies on B-tree index code for all the operator support. In
      fact, it creates an actual B-tree index, the LOV index, and lets the LOV
      index evaluate the operators. We should have all the same operator classes
      and families for bitmap index AM that we have for B-trees.
      
      Perhaps we should teach the planner to reuse the B-tree opfamilies for
      bitmap indexes. But for now, let's auto-generate the bitmap opfamiles at
      initdb-time from the corresponding B-tree opfamilies. That ensures that the
      two stay in sync, and we don't need to carry the diff vs. upstream in the
      catalog headers.
      
      This changes the OIDs for the opclasses and opfamilies, so bump catversion.
      That shouldn't affect upgrade, or clients, though. They should operate on
      opclass/opfamily names, not OIDs.
      
      Some of the operators are still not indexable using bitmap indexes, because
      they are handled by special code in the backend, see
      match_special_index_operator(). But it doesn't do harm to have the entries
      in the catalogs for them, anyway. An example of this is the inet << inet
      operator and its siblings.
      
      One user-visible effect of this is that you can now create a bitmap index
      on the 'complex' datatype.
      
      I did this now, because I was seeing 'opr_sanity' test failure on the 9.6
      merge branch, because some cross-type operators were missing for bitmap
      indexes. That was because the integer bitmap operator classes were not
      gathered into the same operator family, they were still following the old
      model, from before operator families were introduced. So there were
      separate int2_ops, int4_ops, int8_ops operator families, whereas with the
      B-tree, there's only one integer_ops operator family, which contains all
      the opclasses and cross-type operators. I don't think it makes any
      practical difference, though. For the B-tree, including all "compatible"
      operators in the same opfamily allows the planner to deduce quals more
      freely, but I'm not sure if that's significant for the bitmap AM, because
      all the b-tree operators already exist.
      
      Also change pg_am.amsupport for bitmap AM, to account for the new
      'sortsupport' support function that was added to B-tree AM. I'm not sure
      if bitmap indexes can actually make use of it yet, but we now copy all
      the pg_amproc rows, so pg_am.amsupport better match or 'opr_sanity' test
      complains.
      Reviewed-by: NAshwin Agrawal <aagrawal@pivotal.io>
      e782e31b
    • H
      Clean up out/readfuncs.c · f19073f2
      Heikki Linnakangas 提交于
      - Don't write Path->parent, to avoid infinite recursion, and revert the
        GPDB changes in outPlannerInfo that were previously used to avoid it.
        There's no need to differ from upstream in this area, so let's not.
      
      - Add missing window_pathkeys handling from outPlannerInfo. Was missed in
        a merge, I guess. No reason to differ from upstream.
      
      - Remove out/readfast support for Paths and other structs that are only
        used within the planner, and not needed in segments.
      
      - Don't serialize Flow->hashExprs. It's also not needed in segments, and
        it might contain PlaceHolderVars because it's not processed by
        set_plan_references()
      
      The infinite recursion issue was spotted by Melanie and Deep.
      Reviewed-by: NGeorgios Kokolatos <gkokolatos@pivotal.io>
      Reviewed-by: NSoumyadeep Chakraborty <sochakraborty@pivotal.io>
      f19073f2
    • H
      Enable -Wimplicit-fallthrough by default if GCC >=7 (#8798) · d3b671c2
      Hao Wu 提交于
      GCC 7+ has a compiling option, -Wimplicit-fallthrough, which will
      generate a warning/error if the code falls through cases(or default)
      implicitly. The implicity may cause some bugs that are hardly to catch.
      
      To enable this compile option, all switch-cases are not allowed to
      fall through implicitly. To accomplish this target, 2 steps are done:
      1. Append a comment line /* fallthrough */ or like at the end of case block.
      2. Add break clause at the end of case block, if the last statement is
        ereport(ERROR) or like.
      
      When -Wimplicit-fallthrough is enabled, -Werror=implicit-fallthrough
      is also set. So fallthrough must be done explicitly.
      Re-generate configure after modifying configure.in
      
      No implicit-fallthrough for gpmapreduce and orafce
      Reviewed-by: NHeikki Linnakangas <hlinnakangas@pivotal.io>
      Reviewed-by: NGeorgios Kokolatos <gkokolatos@pivotal.io>
      Reviewed-by: NPaul Guo <pguo@pivotal.io>
      d3b671c2
    • B
      Fix spilling of aggstate with compression · 6b25396e
      Bhuvnesh Chaudhary 提交于
      Earlier while creating the workfile for hash aggregates, the data
      was written to file for each agg state, and after all the aggstate's
      data has been written, the total size was updated in the file. For
      updating the total size, it used to SEEK backwards to the offset where
      total size was written previously.
      
      It used to work for workfiles without compression. However, when
      gp_workfile_compression=on, the workfiles are compressed, an attempt to
      SEEK the earlier offset will error out, as for compressed file its
      not expected to go back.
      
      This commit fixes the issue by writing all the data to a buffer, so that
      the total size is known, and after that its written to the file.
      Co-Authored-By: NAshwin Agrawal <aagrawal@pivotal.io>
      Signed-off-by: NAshwin Agrawal <aagrawal@pivotal.io>
      6b25396e
    • D
      Docs - change from libedit to readline · 9de3196f
      David Yozie 提交于
      9de3196f
  3. 10 10月, 2019 10 次提交
  4. 09 10月, 2019 6 次提交
  5. 08 10月, 2019 10 次提交
    • H
      Move a few GPDB-specific pg_dump C functions to separate file. · cf65a4ab
      Heikki Linnakangas 提交于
      The reason to do this now is that the dumputils mock test was failing to
      compile, on the 9.6 merge branch, because of the Assert that was added to
      dumputils.c. I'm not sure why, but separating the GPDB functions to a
      separate file seem like a good idea anyway, so let's just do that.
      cf65a4ab
    • H
      Change fix for Motion node's tdhasoids confusion, and add tests. · 6b53e2d7
      Heikki Linnakangas 提交于
      In master, we already got this fix as part of the 9.5 merge. Change it
      slightly, so that we don't use the subplan's tuple descriptor as is, but
      only copy the "tdhasoid" flag from it. It's in principle possible that
      some unimportant information, like attribute names or typmods, are not
      set up in the subplan's result type, and should be computed from the
      Motion's target list. We're not seeing problems like that on master, but
      on the 9.6 merge branch we are.
      
      More importantly, this adds bespoken tests for this scenario. It arose
      in the 'rowsecurity' test, but this doesn't have anything to do with
      row-level security, so it was accidental.
      
      We didn't backport the fix to 6X_STABLE before, so do that now.
      
      Fixes https://github.com/greenplum-db/gpdb/issues/8765.
      Reviewed-by: NGeorgios Kokolatos <gkokolatos@pivotal.io>
      6b53e2d7
    • B
    • B
      Publish server builds from compile tasks · 94a8ffc9
      Bradford D. Boyle 提交于
      Server release candidate artifacts are not published until after an
      extensive set of tests have passed in the CI pipeline. These tests
      include ICW and all the CLI test suites. It is not unusual for time
      between a commit being pushed to a release candidate being published to
      be several hours, potentially slowing down the feedback cycle for
      component teams.
      
      This commit adds a "published" output to the compliation tasks. The new
      build artifact is stored in an immutable GCS bucket with the version in
      the filename. This makes it trivial for other pipelines to safely
      consume the latest build.
      
      This artifact **has not** passed any sort of testing (e.g., ICW) and
      should only be used in development pipelines that need
      near-instantaneous feedback on commits going into GPDB.
      
      For the server-build artifact, `((rc-build-type-gcs))` will resolve to
      `.debug` for the with asserts pipeline and `''` (i.e., empty string) for the
      without asserts pipeline. The two types of server artifacts that are
      "published" are:
      
      1. server-build
      2. server-rc
      
      server-build is the output of the compilation task and has had no
      testing; server-rc is a release candidate of the server component.
      Authored-by: NBradford D. Boyle <bboyle@pivotal.io>
      94a8ffc9
    • A
      Use different database for fsyc, heap_checksum and walrep tests · 2cfd2b2c
      Ashwin Agrawal 提交于
      Previously, fsyc, heap_checksum and walrep tests used separate
      databases. But seems with merge when src/makefiles/pgxs.mk added
      --dbname to REGRESS_OPTS, all of these tests started using
      `contrib_regression` database even if each of these tests defined
      --dbname=<>, it was overridden from src/makefiles/pgxs.mk.
      
      Hence, set USE_MODULE_DB=1 which makes these tests to use
      --dbname=$(CONTRIB_TESTDB_MODULE) instead of
      `contrib_regression`. This way these will again start having separate
      database.
      2cfd2b2c
    • A
      Add retry in test reader_waits_for_lock for lock checking · 74cb8dcc
      Ashwin Agrawal 提交于
      Command in next session gets executed in parallel to current session
      in case "&" is used. Hence, if session 1 command is running very slow,
      but session 0 commands gets executed fast, can cause flaky test. To
      avoid the same, add retries to check for all processes for session are
      blocked or not.
      74cb8dcc
    • M
      docs - add guc optimizer_use_gpdb_allocators (#8767) · 7927eb4b
      Mel Kiyama 提交于
      * docs - add guc optimizer_use_gpdb_allocators
      
      * docs - add information about improved GPDB query mem. mgmt.
      7927eb4b
    • C
      Revert "Enable optimizer_use_gpdb_allocators guc by default (#8771)" · e06fc220
      Chris Hajas 提交于
      This reverts commit b81d4501.
      
      The resource group tests use ORCA and need to be modified for this
      change.
      e06fc220
    • C
      Enable optimizer_use_gpdb_allocators guc by default (#8771) · b81d4501
      Chris Hajas 提交于
      This guc makes ORCA use gpdb allocators. This allows for faster
      optimization due to less overhead, reduced memory during optimization
      due to smaller/fewer headers, and makes ORCA observe vmem limits instead
      of crashing.
      Authored-by: NChris Hajas <chajas@pivotal.io>
      b81d4501
    • H
      Set locus correctly on Append node, if there are General locus children. · c6355348
      Heikki Linnakangas 提交于
      I found the logic to decide the target locus hard to understand, so I
      rewrote it in a table-driven approach. I hope it's not just me.
      
      Fixes github issue https://github.com/greenplum-db/gpdb/issues/8711Reviewed-by: NZhenghua Lyu <zlv@pivotal.io>
      c6355348
  6. 05 10月, 2019 1 次提交
    • C
      Bump ORCA version to 3.74.0, Introduce PallocMemoryPool for use in GPORCA (#8643) · 99dfccc2
      Chris Hajas 提交于
      We introduce a new type of memory pool and memory pool manager:
      CMemoryPoolPalloc and CMemoryPoolPallocManager
      
      The motivation for this PR is to improve memory allocation/deallocation
      performance when using GPDB allocators. Additionally, we would like to
      use the GPDB memory allocators by default (change the default for
      optimizer_use_gpdb_allocators to on), to prevent ORCA from crashing when
      we run out of memory (OOM). However, with the current way of doing
      things, doing so would add around 10 % performance overhead to ORCA.
      
      CMemoryPoolPallocManager overrides the default CMemoryPoolManager in
      ORCA, and instead creates a CMemoryPoolPalloc memory pool instead of a
      CMemoryPoolTracker. In CMemoryPoolPalloc, we now call MemoryContextAlloc
      and pfree instead of gp_malloc and gp_free, and we don’t do any memory
      accounting.
      
      So where does the performance improvement come from? Previously, we
      would (essentially) pass in gp_malloc and gp_free to an underlying
      allocation structure (which has been removed on the ORCA side). However,
      we would add additional headers and overhead to maintain a list of all
      of these allocations. When tearing down the memory pool, we would
      iterate through the list of allocations and explicitly free each one. So
      we would end up doing overhead on the ORCA side, AND the GPDB side.
      However, the overhead on both sides was quite expensive!
      
      If you want to compare against the previous implementation, see the
      Allocate and Teardown functions in CMemoryPoolTracker.
      
      With this PR, we improve optimization time by ~15% on average and up to
      30-40% on some queries which are memory intensive.
      
      This PR does remove memory accounting in ORCA. This was only enabled
      when the optimizer_use_gpdb_allocators GUC was set. By setting
      `optimizer_use_gpdb_allocators`, we still capture the memory used when
      optimizing a query in ORCA, without the overhead of the memory
      accounting framework.
      
      Additionally, Add a top level ORCA context where new contexts are created
      
      The OptimizerMemoryContext is initialized in InitPostgres(). For each
      memory pool in ORCA, a new memory context is created in
      OptimizerMemoryContext.
      
      Bumps ORCA version to 3.74.0
      
      This is a re-commit of 339dedf0d2, which didn't properly catch/rethrow
      exceptions in gpos_init.
      Co-authored-by: NShreedhar Hardikar <shardikar@pivotal.io>
      Co-authored-by: NChris Hajas <chajas@pivotal.io>
      99dfccc2
  7. 04 10月, 2019 7 次提交