timescaledb-backup
timescaledb-backup copied to clipboard
ts-dump fails on `alter_job_schedule` error unless jobs == 0
trafficstars
This error does not reproduce when ts-dump is called with --jobs 0. Otherwise, calling ts-dump on my system as follows...
ts-dump \
--db-URI postgresql://myuser@myserver/mydatabase \
--dump-dir $targetdir \
--jobs 3 \
--verbose true
...results in the application timing out with these log messages:
stdout:
2021/03/27 17:52:22 WARNING: problem while rescheduling jobs: ERROR: function alter_job_schedule(integer, next_start => timestamp with time zone) does not exist (SQLSTATE 42883)
2021/03/27 18:02:21 2021-03-27 18:02:21.947694 -0700 PDT m=+600.003882206 timed out waiting for jobs to be rescheduled, exiting
pg log:
2021-03-27 17:52:22.812 PDT [83511] ERROR: function alter_job_schedule(integer, next_start => timestamp with time zone) does not exist at character 47
2021-03-27 17:52:22.812 PDT [83511] HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2021-03-27 17:52:22.812 PDT [83511] STATEMENT: SELECT t.job_id, prev_start FROM
(SELECT (alter_job_schedule(p.job_id, next_start=> now()+ ('15 min' + random()*'5 min'::interval))).*, p.next_start as prev_start
FROM timescaledb_information.policy_stats p
WHERE NOT(last_finish ='-infinity' AND next_start = '-infinity')
AND next_start < now()+'10 min'
AND p.job_type IN ('compress_chunks', 'reorder') ) t
The alter_job_schedule function does exist in my database:
\df _timescale.alter_job_schedule
+------------+--------------------+-------------------------------------------------------
| Schema | Name | Result data type
|------------+--------------------+-------------------------------------------------------
| _timescale | alter_job_schedule | TABLE(job_id integer, schedule_interval interval, max_
+------------+--------------------+-------------------------------------------------------
My system:
| pkg | version |
|---|---|
| timescaledb | 1.7.4 |
| timescaledb-tools | 0.11.0 |
| SELECT version() | PostgreSQL 11.9 on x86_64-apple-darwin16.7.0, compiled by Apple LLVM version 9.0.0 (clang-900.0.39.2), 64-bit |
| macOS | 10.12.6 |
| CPU | MacPro5,1 (6-Core Intel Xeon) |
It seems the function alter_job_schedule exists in public schema. (Since timescaledb version ?)
# \df alter_job_schedule
List of functions
Schema | Name | Result data type | Argument data types | Type
--------+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------
public | alter_job_schedule | TABLE(job_id integer, schedule_interval interval, max_runtime interval, max_retries integer, retry_period interval, next_start timestamp with time zone) | job_id integer, schedule_interval interval DEFAULT NULL::interval, max_runtime interval DEFAULT NULL::interval, max_retries integer DEFAULT NULL::integer, retry_period interval DEFAULT NULL::interval, if_exists boolean DEFAULT false, next_start timestamp with time zone DEFAULT NULL::timestamp with time zone | func
(1 row)
But in lower versions of timescaledb extension, there's no function name alter_job_schedule ?