-
Notifications
You must be signed in to change notification settings - Fork 884
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
Updating to 2.0.0 on hypertable where chunks have been dropped fails #2791
Comments
Thank you for the bug report. It does indeed look like it TimescaleDB is looking for the chunk that was dropped during the upgrade, but could you check the contents of
|
Lost that database but this is on a different database where the missing chunk is
|
@brian-from-quantrocket Thanks, it was what I suspected. If you have a continuous aggregate on top of a hypertable, the chunks are not removed, they are just marked as dropped, and the update script did not take that into account. The fix is straightforward, but we need to write a test as well to avoid the problem in the future. |
If a chunk is marked dropped in `_timescaledb_catalog.chunk` it does not exist and it is not possible to construct a `REGCLASS` from it, so we have to check that we are not processing a dropped chunk. Fixes timescale#2791
If a chunk is marked dropped in `_timescaledb_catalog.chunk` it does not exist and it is not possible to construct a `REGCLASS` from it, so we have to check that we are not processing a dropped chunk. Fixes timescale#2791
If a chunk is marked dropped in `_timescaledb_catalog.chunk` it does not exist and it is not possible to construct a `REGCLASS` from it, so we have to check that we are not processing a dropped chunk. Fixes timescale#2791
If `drop_chunks` has been executed on a hypertable that has a continuous aggregate defined, the chunks will be removed and marked as dropped in `_timescaledb_catalog.chunk` but the lines will not be removed. This will cause problems for the update script since it is missing a check to only process chunks that are not dropped and will try to cast the chunk name into a `REGCLASS` for a table that does not exist. This commit fixes this by adding a check that the chunk is not dropped and also fixes the update test to not count dropped chunks when comparing with the chunk index since the chunk index does not count dropped chunks. Fixes timescale#2791
If `drop_chunks` has been executed on a hypertable that has a continuous aggregate defined, the chunks will be removed and marked as dropped in `_timescaledb_catalog.chunk` but the lines will not be removed. This will cause problems for the update script since it is missing a check to only process chunks that are not dropped and will try to cast the chunk name into a `REGCLASS` for a table that does not exist. This commit fixes this by adding a check that the chunk is not dropped and also fixes the update test to not count dropped chunks when comparing with the chunk index since the chunk index does not count dropped chunks. Fixes #2791
If `drop_chunks` has been executed on a hypertable that has a continuous aggregate defined, the chunks will be removed and marked as dropped in `_timescaledb_catalog.chunk` but the lines will not be removed. This will cause problems for the update script since it is missing a check to only process chunks that are not dropped and will try to cast the chunk name into a `REGCLASS` for a table that does not exist. This commit fixes this by adding a check that the chunk is not dropped and also fixes the update test to not count dropped chunks when comparing with the chunk index since the chunk index does not count dropped chunks. Fixes timescale#2791
If `drop_chunks` has been executed on a hypertable that has a continuous aggregate defined, the chunks will be removed and marked as dropped in `_timescaledb_catalog.chunk` but the lines will not be removed. This will cause problems for the update script since it is missing a check to only process chunks that are not dropped and will try to cast the chunk name into a `REGCLASS` for a table that does not exist. This commit fixes this by adding a check that the chunk is not dropped and also fixes the update test to not count dropped chunks when comparing with the chunk index since the chunk index does not count dropped chunks. Fixes #2791
Does TimescaleDB support upgrading to 2.0.0 on a database where chunks have previously been dropped with
drop_chunks
?Using Timescale's Docker images, I am upgrading from
timescale/timescaledb:1.7.3-pg12
totimescale/timescaledb:2.0.0-pg12
.I have two databases, each of which contains a similarly structured hypertable.
Both hypertables have compression enabled and both have continuous aggregates. The only difference between the two databases that I can see is that I have previously dropped chunks on one of the hypertables but not on the other. When I run
ALTER EXTENSION timescaledb UPDATE
on the database where no chunks have been dropped, it successfully updates to 2.0.0. But when I run the same command on the database where chunks have previously been dropped, it fails with the following error:Indeed, that relation does not exist:
I believe
_timescaledb_internal._hyper_1_1_chunk
was previously dropped withdrop_chunks
. Is it possible that timescale is mistakenly looking for it anyway?The text was updated successfully, but these errors were encountered: