Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Content Bug] [Site Bug] Issue with the page: /api/latest/data-retention/remove_retention_policy/ #3787

Open
julbts opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@julbts
Copy link

julbts commented Jan 30, 2025

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:

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.

Page affected

/api/latest/data-retention/remove_retention_policy/

@julbts julbts added bug Something isn't working documentation Improvements or additions to documentation labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant