Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.3.1 #3373

Merged
merged 41 commits into from
Jul 6, 2021
Merged

Release 2.3.1 #3373

merged 41 commits into from
Jul 6, 2021

Commits on Jun 29, 2021

  1. Remove unused job_type from policies

    When refactoring the job code the job_type was removed from our
    catalog but a few places got overlooked that still had a variable
    holding the job type.
    svenklemm authored and mkindahl committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    cedf2e1 View commit details
    Browse the repository at this point in the history
  2. Fix issues in update smoke test

    Corrected a function name and replaced a variable with the explicit
    commands to use.
    mkindahl committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    846b468 View commit details
    Browse the repository at this point in the history
  3. Add 2.3.0 to update test scripts

    The update tests for PG11, PG12, and PG13 are updated to include
    release 2.3.0.
    erimatnor authored and mkindahl committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    805a9f6 View commit details
    Browse the repository at this point in the history
  4. Fix broken links in TimescaleDB NOTICE

    Link to Telemetry page explains more than disable it
    
    Co-authored-by: Mike Freedman <mfreed@cs.princeton.edu>
    2 people authored and mkindahl committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    5b64d62 View commit details
    Browse the repository at this point in the history
  5. Fix flaky pg_dump test

    Stop background workers in test after calling timescaledb_post_restore
    since this function restarts background workers.
    svenklemm authored and mkindahl committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    48b30eb View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2021

  1. Configuration menu
    Copy the full SHA
    9b36f72 View commit details
    Browse the repository at this point in the history
  2. Add some more randomness to chunk assignment

    Previously the assignment of data nodes to chunks had a bit
    of a thundering-herd problem for multiple hypertables
    without space partions: the data node assigned for the
    first chunk was always the same across hypertables.
    We fix this by adding the hypertable_id to the
    index into the datanode array. This de-synchronizes
    across hypertables but maintains consistency for any
    given hypertable.
    
    We could make this consistent for space partitioned tables
    as well but avoid doing so now to prevent partitions
    jumping nodes due to this change.
    
    This also effects tablespace selection in the same way.
    cevian authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    07407cd View commit details
    Browse the repository at this point in the history
  3. Remove unused bucket_width argument

    continuous_agg_update_materialization() doesn't use this argument and
    we can't rely on a fixed bucket_width in the future anyway.
    Aleksander Alekseev authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    67eacf8 View commit details
    Browse the repository at this point in the history
  4. Fix memory overflow

    Fix heap buffer overflow in remote connection cache.
    mfundul authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    ce5438f View commit details
    Browse the repository at this point in the history
  5. Remove paths that reference parent relids for compressed chunks

    We explicilty filter paths for compressed chunks that
    have spurious join clauses between the compressed chunk and
    the original chunk or hypertable. However there are other
    cases where a chunk could be a child rel
    (i.e. RELOPT_OTHER_MEMBER_REL) such as when the chunk is
    referenced as part of a UNION ALL query. We remove all
    paths that have spurious join clauses between the compressed
    chunk and any implied parent for the chunk.
    
    Fixes timescale#2917
    gayyappan authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    9838965 View commit details
    Browse the repository at this point in the history
  6. Fix pull_varnos miscomputation of relids set

    Upstream fixed a bug with miscomputation of relids for
    PlaceHolderVar. Those fixes changed the signature of pull_varnos,
    make_simple_restrictinfo and make_restrictinfo.
    The fixes got backported to the PG12 and PG13 branch but to not
    break compatibility with extensions the old functions were left in.
    This patch makes our code use the new functions when compiling
    against a postgres version that has them.
    
    postgres/postgres@1cce024fd2
    postgres/postgres@73fc2e5bab
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    5f74a39 View commit details
    Browse the repository at this point in the history
  7. Fix compile error

    Error: 'nest_level' may be used uninitialized in this function.
    mfundul authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    bef7c08 View commit details
    Browse the repository at this point in the history
  8. Make aggregate in caggs fully qualified

    When querying continuous aggregate views with a search_path not
    including public the query will fail cause the function reference
    in the finalize call is not fully qualified.
    
    This can surface when querying caggs through postgres_fdw which
    resets search_path to contain only pg_catalog.
    
    Fixes timescale#1919
    Fixes timescale#3326
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    9d634be View commit details
    Browse the repository at this point in the history
  9. Constify parameters and return values of core APIs

    Harden core APIs by adding the `const` qualifier to pointer parameters
    and return values passed by reference. Adding `const` to APIs has
    several benefits and potentially reduces bugs.
    
    * Allows core APIs to be called using `const` objects.
    * Callers know that objects passed by reference are not modified as a
      side-effect of a function call.
    * Returning `const` pointers enforces "read-only" usage of pointers to
      internal objects, forcing users to copy objects when mutating them
      or using explicit APIs for mutations.
    * Allows compiler to apply optimizations and helps static analysis.
    
    Note that these changes are so far only applied to core API
    functions. Further work can be done to improve other parts of the
    code.
    erimatnor authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    3084fa7 View commit details
    Browse the repository at this point in the history
  10. Fix pg_init_privs objsubid handling

    pg_init_privs can have multiple entries per relation if the relation
    has per column privileges. An objsubid different from 0 means that
    the entry is for a column privilege. Since we do not currently
    restore column privileges we have to ignore those rows otherwise
    the update script will fail when tables with column privileges are
    present.
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    a198ce5 View commit details
    Browse the repository at this point in the history
  11. Fix failed update with parallel workers

    When executing "ALTER EXTENSION timescaledb UPDATE TO ..." it will fail
    if parallel workers spawn for the update itself. Disable parallel
    execution during the update.
    mfundul authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    e171255 View commit details
    Browse the repository at this point in the history
  12. Fix flaky pg_dump test

    Call pg_terminate_backend on all active sessions on the database to
    be used as template database to prevent on error on CREATE DATABASE.
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    b82999e View commit details
    Browse the repository at this point in the history
  13. Harden pg_init_privs query

    Since we are only interested in entries with classoid pg_class
    our queries should reflect that. Without these restrictions
    objects that have entries for multiple classoids can cause the
    extension update to fail.
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    3329c01 View commit details
    Browse the repository at this point in the history
  14. Improve trigger handling on distributed hypertables

    Triggers on distributed hypertables can now be renamed due to having
    the rename statement forwarded to data nodes. This also applies to
    other objects on such tables, like constraints and indexes, since they
    share the same DDL "rename" machinery. Tests are added for these
    cases.
    
    For convenience, trigger functions on distributed hypertables will now
    also be created automatically on the data nodes. In other words, it is
    no longer necessary to pre-create the trigger function on all data
    nodes.
    
    This change also fixes an issue with statement-level triggers, which
    weren't properly propagated to data nodes during `CREATE TRIGGER`.
    
    Fixes timescale#3238
    erimatnor authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    c71f42e View commit details
    Browse the repository at this point in the history
  15. Filter out chunk and hypertable ids from test output

    Currently any tests in regresscheck-shared can only include
    EXPLAIN output if they only access the precreated hypertables
    as hypertables and chunks created in the test itself will
    have ids depending on execution order of the shared tests.
    This patch filters out those ids so shared tests can include
    EXPLAIN output for local hypertables.
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    3003c84 View commit details
    Browse the repository at this point in the history
  16. Format CMake files

    Format the CMake files using the `cmake-format`.
    mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    a0082cb View commit details
    Browse the repository at this point in the history
  17. Fix update tests to handle sequences

    The post-update script was handling preserving initprivs for newly
    added catalog tables and views. However, newly added catalog sequences
    need separate handling otherwise update tests start failing. We also
    now grant privileges for all future sequences in the update tests.
    
    In passing, default the PG_VERSION in the update tests to 12 since we
    don't work with PG11 anymore.
    nikkhils authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    b71bf16 View commit details
    Browse the repository at this point in the history
  18. Run sanitizer tests on PG12

    Change sanitizer test to run on PG12 and make it use the same
    infrastructure as the other linux regression tests.
    
    Co-authored-by: Sven Klemm <sven@timescale.com>
    2 people authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    e882bcf View commit details
    Browse the repository at this point in the history
  19. Fix Regression Linux i386 workflow

    Change the postgresql ftp URL from snapshot/ to source/. This way we
    do not need to react to every new commit upstream, but only whenever
    the postgresql minor version changes.
    
    Co-authored-by: Mats Kindahl <mats.kindahl@gmail.com>
    mfundul and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    dacf921 View commit details
    Browse the repository at this point in the history
  20. Fix memory overflow

    Fix heap buffer overflow when renaming compressed hypertable columns.
    mfundul authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    66a7ebf View commit details
    Browse the repository at this point in the history
  21. Move timestamp_limits and with_clause_parser test

    Move the timestamp_limits and with_clause_parser test to
    regresscheck-shared since those tests don't need a private
    database incurring less overhead to run those tests.
    Also add missing ORDER BY clauses to some of the queries
    in timestamp_limits to make the output more stable.
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    a4e8ecf View commit details
    Browse the repository at this point in the history
  22. Add compatibility macro for convert_tuples_by_name

    PG13 removes the msg parameter for convert_tuples_by_name so this
    patch provides a compatibility macro that abstracts the version
    differences away.
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    95154fc View commit details
    Browse the repository at this point in the history
  23. Fix SkipScan distinct column identification

    The SkipScan code assumed the first entry in PathKeys would match
    the distinct column. This is not always true as postgres will remove
    entries from PathKeys it considers constant leading to SkipScan
    operating on the wrong column under those circumstances.
    This did most likely not cause any wrong results as the other
    constraints for SkipScan to apply still had to be satisfied but
    resulted in very inefficient query execution for those affected
    queries.
    This patch refactors the SkipScan code to use the distinctClause
    from the Query instead.
    
    Fixes timescale#3330
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    d6bf30b View commit details
    Browse the repository at this point in the history
  24. Stabilize timestamp_limits test output

    Remove the chunk name completely from output as the name might have
    different length leading to different output as table headers are
    adjusted to the length of the field values.
    svenklemm authored and mkindahl committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    a7e79bd View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2021

  1. Generate downgrade script

    This commit add functions and code to generate a downgrade script from
    the current version to the previous version. This requires execution
    from a Git repository since it retrieves the prolog and epilog for the
    "downgrade" file from the version given by `update_from_version` in the
    `version.config` file.
    
    The commit adds several CMake functions that simplifies the composition
    of script files, but these are not used to generate the update scripts.
    A potential improvement is to use the scripts to also generate the
    update scripts.
    
    This commit supports generating a downgrade script from the
    current version to the previous version. Other versions are handled
    using a variable containing file names of reverse update
    scripts and  the source and target version is extracted from the file
    names, which is assumed to be of the form
    `<source-version>--<target-version>.sql`.
    
    In addition to adding support for generating downgrade scripts, the
    commit adds a downgrade test file that tests a release in a similar way
    to the update script and adds it as a workflow.
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    b3df0ee View commit details
    Browse the repository at this point in the history
  2. Fix memory overflow

    Fix heap buffer overflow in hypertable expansion.
    mfundul authored and mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    643bb18 View commit details
    Browse the repository at this point in the history
  3. Fix ABI breakage test in CI

    Add the files that had been missing from the docker environment since
    the introduction of the downgrade scripts.
    mfundul authored and mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    b76f54a View commit details
    Browse the repository at this point in the history
  4. Improve DecompressChunk qual pushdown

    Allow pushdown of RelabelType expressions into the scan below the
    DecompressChunk node. When using varchar columns as segmentby
    columns constraints on those columns would not be pushed down
    because postgres would inject RelabelType nodes that where not
    accepted as valid expression for pushdown leading to bad performance
    because the filter could only be applied after decompression.
    
    Fixes timescale#3351
    svenklemm authored and mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    eefd3e4 View commit details
    Browse the repository at this point in the history
  5. Fix output file for compression_qualpushdown

    The output file `compression_qualpushdown-11.out` was not updated.
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    211d572 View commit details
    Browse the repository at this point in the history
  6. Update test files

    Output for `compression_qualpushdown-13.out` was not correct.
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    90ec629 View commit details
    Browse the repository at this point in the history
  7. Always define 'format' target

    If `clang-format` is not found `CLANG_FORMAT` will be set to a false
    value, which will prevent the `format` target from being defined if
    `cmake-format` is not installed.
    
    This commit fixes that by always creating a `format` target since
    `clang-format` is always created even if `CLANG_FORMAT` is false.
    
    We do not redefine `CLANG_FORMAT` to a non-false value since it is
    expected to contain a path to an executable and if set to a true value
    that is not a path it could be used in a way that leads to strange
    errors.
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    4fa6e26 View commit details
    Browse the repository at this point in the history
  8. Export variables to docker-build

    This commit export the `GENERATE_DOWNGRADE_SCRIPT` and `PG_VERSION`
    variables from `test_downgrade_to_tag.sh` to `docker-build.sh`.
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    9cf1915 View commit details
    Browse the repository at this point in the history
  9. Fix bad use of repalloc

    In contrast to `realloc`, the PostgreSQL function `repalloc` does not
    accept a NULL pointer and fall back on `palloc`. For that reason it is
    necessary to check if the pointer is NULL and either use `palloc` or
    `repalloc`.
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    c71b17a View commit details
    Browse the repository at this point in the history
  10. Split update and downgrade version

    During an update, it is not possible to run the downgrade scripts until
    the release has been tagged, but the update scripts can be run. This
    means that we need to split the previous version into two different
    fields: one for running the update tests and one for running the
    downgrade tests.
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    ab244cd View commit details
    Browse the repository at this point in the history
  11. Add downgrade script

    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    7d8e189 View commit details
    Browse the repository at this point in the history
  12. Release 2.3.1

    This maintenance release contains bugfixes since the 2.3.0 release. We
    deem it moderate priority for upgrading. The release introduces the
    possibility of generating downgrade scripts, improves the trigger
    handling for distributed hypertables, adds some more randomness to
    chunk assignment to avoid thundering herd issues in chunk assignment,
    and fixes some issues in update handling as well as some other bugs.
    
    **Bugfixes**
    * timescale#3279 Add some more randomness to chunk assignment
    * timescale#3288 Fix failed update with parallel workers
    * timescale#3300 Improve trigger handling on distributed hypertables
    * timescale#3304 Remove paths that reference parent relids for compressed chunks
    * timescale#3305 Fix pull_varnos miscomputation of relids set
    * timescale#3310 Generate downgrade script
    * timescale#3314 Fix heap buffer overflow in hypertable expansion
    * timescale#3317 Fix heap buffer overflow in remote connection cache.
    * timescale#3327 Make aggregate in caggs fully qualified
    * timescale#3327 Make aggregates in caggs fully qualified
    * timescale#3336 Fix pg_init_privs objsubid handling
    * timescale#3345 Fix SkipScan distinct column identification
    * timescale#3355 Fix heap buffer overflow when renaming compressed hypertable columns.
    * timescale#3367 Improve DecompressChunk qual pushdown
    * timescale#3377 Fix bad use of repalloc
    
    **Thanks**
    * @db-adrian for reporting an issue when accessing cagg view through postgres_fdw
    * @fncaldas and @pgwhalen for reporting an issue accessing caggs when public is not in search_path
    * @fvannee, @mglonnro and @ebreijo for reporting an issue with the upgrade script
    * @fvannee for reporting a performance regression with SkipScan
    mkindahl committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    6d90bd7 View commit details
    Browse the repository at this point in the history