If the scheduler receives an error, it will never restart again since `bgw_restart_time` is set to `BGW_NEVER_RESTART`, which will prevent all jobs from executing. This commit adds the GUC `timescaledb.bgw_scheduler_restart_time` that can be set to the restart time for the scheduler. It defaults to 60 seconds, which is the default restart interval for background workers defined by PostgreSQL. It also adds `timescaledb.debug_bgw_scheduler_exit_status` to be able to shutdown the scheduler with a non-zero exit status, which allows the restart functionality to be tested. It also ensures that `backend_type` is explicitly set up rather than copied from `application_name` and add some more information to `application_name`. It also updates the tests to use `backend_type` where applicable. To avoid exhausting slots when the launcher restarts, it will kill all existing schedulers and start new ones. Since background worker slots are easily exhausted in the `bgw_launcher` test, we do not run it repeatedly in the flakes workflow.
PostgreSQL tests for TimescaleDB
The CMake configuration within this directory makes it possible to run the standard PostgreSQL test suite with the TimescaleDB extension loaded. This is useful to ensure that TimescaleDBs modifications planner and DDL hooks are compatible with standard PostgreSQL.
Running
The configuration within adds a new CMake target, pginstallcheck
,
that allows running the PostgreSQL test suite using a modified test
schedule. The target requires access to the PostgreSQL source code,
which can be configured via the PG_SOURCE_DIR
CMake variable. The
source tree needs to be compiled, at least the src/test/regress
directory. If the path to a PostgreSQL source tree is not
auto-detected, this variable can be set manually to point to the right
location.
# In top-level directory of a TimescaleDB source tree
$ mkdir build && cd build
$ cmake -DPG_SOURCE_DIR=<path/to/pg/source> ..
Once CMake is correctly configured, run:
$ make pginstallcheck