-
Notifications
You must be signed in to change notification settings - Fork 900
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
Old chunks are not dropped after restore #3782
Comments
Hi @1000101! What you need to do is upgrade to TimescaleDB 2.5.0 (the first version where we support PG14) and then upgrade to PostgreSQL 14. |
Hi @NunoFilipeSantos, thanks for your quick answer! Could you please clarify what you mean by that? So the proper way would be first to upgrade the old db with PG12 to TSDB 2.5.0 first and just then backup the data for the import into PG14? |
@1000101 Thank you! 😊
Let us know if this goes as expected. |
Oh right, so I did just that and these chunks don't get identified as old for some reason:
However the oldest entry is from 2021-10-29. And I've noticed a very strange thing in my testing environment (with no new inserts made to hypertable
This was all done in a testing environment. However the current active DB (with imported data) is working fine with the old data, it's just these chunks that didn't get dropped. Do you think it's safe to use |
I've just noticed that I can't even query caggs by bucket older than the time when I did restore. They are present (I can see their chunks |
@1000101 It sounds like the metadata for the hypertables etc. is not set correctly i.e. the db was not restored correctly. Did you set timescaledb.restoring on before restoring the db? Could you list the exact sequence of steps that you used to dump and restore the db? |
Yes, I was using the sequence as described in docs (except creating the blank db with tsdb extension, script did that):
The commands produced "normal" output. |
@1000101 will it be possible for you to share the pg_dump output here? We can then try it with PG12.x first and then retrace your steps to upgrading to PG14.x and go ahead from there. |
Sorry, the issue was stale for so long, that I discarded the database and just moved on. Unfortunately, it seems I can't downgrade to the tsdb version in question as I've already upgraded to 2.5.0. But I think this was it, which I disregarded as stated in #2566:
|
@1000101 I am closing this issue for now for lack of reproducible scenarios. Please feel free to open a new one in case you face any other issues in this specific area. |
Relevant system information:
postgres --version
): 14.0\dx
inpsql
): 2.5.0Describe the bug
Executing
SELECT drop_chunks('mytable', INTERVAL '7 days');
on a db recreated from a backup does not drop chunks older than 7 days.Data (~14 days of chunks) have been exported from pg 12.7, tsdb 2.2.1 using this procedure.
Then restored using this procedure.
To Reproduce
Steps to reproduce the behavior:
SELECT drop_chunks('mytable', INTERVAL '7 days');
Expected behavior
Additional context
Additional info
However I can see the chunks present in the new db (via autocomplete):
The text was updated successfully, but these errors were encountered: