alter_job function. To alter an existing , refer to it by job_id. The
job_id runs a given , and its current schedule can be found in the
timescaledb_information.jobs view, which lists information about every
scheduled s, as well as in timescaledb_information.job_stats. The
job_stats view also gives information about when each was last run and
other useful statistics for deciding what the new schedule should be.
Calculate the next start on failure
When a run results in a runtime failure, the next start of the is calculated taking into account both itsretry_period and schedule_interval.
The next_start time is calculated using the following formula:
next_start time is not put off indefinitely or produce timestamps so large they end up out of
range, it is capped at 5*schedule_interval.
Also, more than 20 consecutive failures are not considered, so if the number of consecutive failures is higher, then it
multiplies by 20.
Additionally, for s with fixed schedules, the system ensures that if the next start ( calculated as specified),
surpasses the next scheduled execution, the is executed again at the next scheduled slot and not after that. This
ensures that the does not miss scheduled executions.
There is a distinction between runtime failures that do not cause the to crash and crashes.
In the event of a crash, the next start calculation follows the same formula,
but it is always at least 5 minutes after the ‘s last finish, to give an operator enough time to disable it before
another crash.
Samples
-
Reschedule ID
1000so that it runs every two days: -
Disable scheduling of the compression policy on the
conditions: -
Reschedule ID
1000so that it next runs at 9:00:00 on 15 March, 2020: -
Alter a policy:
You can pause and restart a policy, change how often the policy runs and the scheduling. To do this:
However, to change the
afterorcreated_before, the compression settings, or the the policy is acting on, you must remove the policy and add a new one.
Arguments
The syntax is:
When a begins, the
next_start parameter is set to infinity. This
prevents the from attempting to be started again while it is running. When
the completes, whether or not the job is successful, the parameter is
automatically updated to the next computed start time.
Note that altering the next_start value is only effective for the next
execution of the in case of fixed schedules. On the next execution, it will
automatically return to the schedule.