When running `make format` it will update all files. If a file does not
actually require reformatting, it will trigger a re-build of the entire
code base.
This commit instead compare the re-formatted file with the existing one
and does not update it unless it has actually changed.
This commit fixes memory leaks in the Background Worker infrastructure.
Notably, it fixes a leak in the launcher and BGW scheduler where shared
message queue handles would not be freed, and it fixes a leak where
BackgroundWorkerHandles were not freed in the scheduler.
Add license information to files missing it and fix the license
check script to honor the return code of both the apache license
check and the TSL license check. Previously errors occurring during
apache license check would not be reflected in the return code of
the script, so only the TSL license check was effective.
Adding checks for `pg_isolation_regress` and `pg_regress` and not
running the tests if the programs cannot be found either installed in
default directories or provided with the `PG_PATH` variable, or the
`PG_SOURCE_DIR` variable.
Previously the compile image for the ABI tests was based on a different
postgres image than the run image (e.g. 10-alpine vs 10.2-alpine). This
created dependency problems between different version of ssl packages
that may be available under different alpine versions.
We fix this by forcing the run image to be based off of the same image
as the compile version.
We were not building timescaledb with debug enabled in the sanitizer
tests, causing tests which needed debug symbols to fail. This commit
changes the sanitizer tests to include such symbols. We still enable
optimizations, as that results in more realistic build environment for
memory tests.
This commit also ensures some tests which should only be run in debug
builds are in fact only run in debug builds.
The commit message template may include the actual diff to be
committed separated with a special scissors line. This patch adds
support for the scissors line to the commit hook otherwise
the diff content may trigger any of the rules.
Our coding guidelines recommend following "The seven rules of a great
Git commit message" by Chris Beams:
https://chris.beams.io/posts/git-commit/
This change adds a Git commit hook that validates all Git commit
messages according to these rules (at least to the extent possible).
Currently, the hook simply prints a warning and a list of violations
in case of a non-conforming Git commit message. The commit is
otherwise accepted. This could be changed to entirely fail the commit,
or, via another hook, fail to push any code that is non-conformant.
The hook will be installed on a CMake run or when the hook source
changes.
With the forthcoming new sanitizer image running tests in parallel
causes machines to run out of resources, and fail tests spuriously
This commit forces test_sanitizers.sh to run tests sequentially to
prevent this.
When doing a gapfill query with multiple columns that may contain
NULLs it is not trivial to remove NULL values from individual columns
with a WHERE clause, this new locf option allows those NULL values
to be ignored in gapfill queries with locf.
We drop the old locf function because we dont want 2 locf functions.
Unfortunately this means any views using locf have to be dropped.
This commit adds a sanitizer run script, and updates travis to
run it in our nightly builds. Valgrind has been very slow and
unstable, so much so that we only run it during pre-release
tests, and even then it doesn't necissarily provide useful
output. The sanitizer tests run about 10x faster, and seem
stable.
We currently only run ASan and UBSan, as MSan has too many
issues within postgres's own initialization functions. As MSan
cannot be added to a binary that enables ASan, it would require
separate jobs anyway.
The script for running clang-format on the source code now properly
excludes hidden directories and CMake directories from the source code
scan. Including these directories may otherwise break clang-format
because hidden directories are often used for IDE/tools caches (e.g.,
`cquery`) where the cache files have the same ending as the source
code.
We are switching from pgindent to clang-format for several
reasons:
1) pgindent is harder to set up and depends on other tools
like gobjdump that differ between OSes making it harder
to set up a proper development environment.
2) clang-format is more standard and works better
with various IDEs and editors.
Our clang-format wrapper script is transactional in that this
version of the script copies all files to a temporary directory,
runs clang-format in the temp dir, and only then copies the files
back. This should prevent mis-formatting when the script is cancled
in the middle of running.
We changes travis to use clang-format instead of pgindent
and thus it uses a different docker image to do the format test.
We also changes travis to use the new clang docker
image for the license check and prefix checks for consistency.
This also paves the way for us to use more clang features for tests
in the future.
Nothing appears to use scripts/start-test-docker.sh, so it can be
safely removed. docker-run.sh was still referenced on our docs
page, but should soon be removed. It no longer actually provides
anything useful (i.e., any memory settings it used to have have
been removed) and is out-of-date with newer Docker setups. To
remove the burden of keeping it up to date, we should just remove.
This commit adds support for dynamically loaded submodules to timescaledb
as well an initial license-key implementation in the tsl subdirectory.
Dynamically loaded modules allow our users to determine which licenses they
wish to use for their version of timescaledb; if they wish to only use
Apache-Licensed code, they do not load the Timescale-Licensed submodule. Calls
from the Apache-Licensed code into the Timescale-Licensed submodule are
handled via dynamicaly-set function pointers; see tsl/src/Readme.module.md for
more details.
This commit also adds code for license keys for the ApacheOnly, Community, and
Enterprise editions. The license key determines which features are enabled,
and controls loading the submodule: when a license key that requires the
sub-module is installed, the module is automatically loaded.
Currently the ApacheOnly and Community license-keys are hardcoded to be
"ApacheOnly" and "Community" respectively. The first version of the enterprise
license-key is described in tsl/src/Readme.module.md
Remove EXIT trap handler because it seems to occasionally capture exit
code from something that is not an update test resulting in error
state even though all update tests were successful.
This fixes a number of issues with the update test script that
prohibited it from displaying a log of any failing tests. In
particular, the script needs to be run with `set +e` to ensure a test
error doesn't immediately cause an exit without recording the failed
log.
This commit makes four changes:
1. Adds the ts_ prefix to some functions that were missed in the last
pass
2. Adds static to some variables that were confined to a single file but
missing it
3. Adds the ability to disable using "hidden" visibility by default by
setting the USE_DEFAULT_VISIBILITY variable
4. Switches the prefix-check in travis to use the flag defined in 3 so
that the checker now checks all non-static symbols we define
This fixes multiple warnings in bash 4.4:
scripts/check_file_license_apache.sh: line 22: warning: command substitution: ignored null byte in input
and is also more correct since we dont want to inject 0-Bytes into the string