You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to remove the retention policy (delete after 14 days) and added a new one (delete after 6 month) but the data was still removed after 14 days.
What do the docs say now?
It does not say that the jobs linked to retention policy are NOT automatically removed when "SELECT remove_retention_policy(schema_tablename);" is called. After the remove_retention_policy(..) first not retention policy did show up but after SELECT add_retention_policy(schema_tablename, drop_after => INTERVAL '6 months') the old (14 days) and the new (6 month) retention policy showed up on the jobs.
Used this query to check:
SELECT jobs.hypertable_schema
,jobs.hypertable_name
,jobs.schedule_interval
,jobs.config
,jobs.scheduled
,jobs.fixed_schedule
FROM timescaledb_information.jobs
WHERE jobs.hypertable_schema = :schema_name
AND jobs.hypertable_name = :table_name
AND jobs.proc_name = 'policy_retention'
;
This wasn't recognized at first as the assumption is that by removing one and adding a new one, actually only the newly added retention policy is active and the deleted one is "ACTUALLY" deleted.
After I've recognized that the data is still deleted after 14 days I looked up the Jobs and there the 14 days delete job is still there executed every day.
The final solution (hopefully) was to delete the Job by the job_id (SELECT delete_job(NNNN);).
Now the Job list looks good.
What should the docs say?
It should be noted that even if you call remove_retention_policy(..) you should manually delete the attached job.
The system where this issues showed itself was TimescaleDB v "2.12.2" ... there are newer versions so maybe this was a bug but I've not found it mentioned in the changelogs and I so far did not test it on the latest release.
Describe the bug
I tried to remove the retention policy (delete after 14 days) and added a new one (delete after 6 month) but the data was still removed after 14 days.
What do the docs say now?
It does not say that the jobs linked to retention policy are NOT automatically removed when "SELECT remove_retention_policy(schema_tablename);" is called. After the remove_retention_policy(..) first not retention policy did show up but after SELECT add_retention_policy(schema_tablename, drop_after => INTERVAL '6 months') the old (14 days) and the new (6 month) retention policy showed up on the jobs.
Used this query to check:
This wasn't recognized at first as the assumption is that by removing one and adding a new one, actually only the newly added retention policy is active and the deleted one is "ACTUALLY" deleted.
After I've recognized that the data is still deleted after 14 days I looked up the Jobs and there the 14 days delete job is still there executed every day.
The final solution (hopefully) was to delete the Job by the job_id (SELECT delete_job(NNNN);).
Now the Job list looks good.
What should the docs say?
It should be noted that even if you call remove_retention_policy(..) you should manually delete the attached job.
The system where this issues showed itself was TimescaleDB v "2.12.2" ... there are newer versions so maybe this was a bug but I've not found it mentioned in the changelogs and I so far did not test it on the latest release.
Page affected
/api/latest/data-retention/remove_retention_policy/
The text was updated successfully, but these errors were encountered: