-
Notifications
You must be signed in to change notification settings - Fork 671
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
Dropping a schema that has a type used in a distribution column of a table fails #5780
Comments
This should be fixed on Citus 11 via #5372. Can you repro on master? |
1 similar comment
This comment was marked as duplicate.
This comment was marked as duplicate.
yeah, I can reproduce on master too. |
This looks like a different codepath reached from My suggestion is to update this codepath and introduce new helper functions that read the information from catalog tables directly, and remove the dependency on the caches.
|
What we fail to access is the distribution column and its type, because it is dropped from previous SET citus.shard_count TO 4;
CREATE TYPE my_type AS (int_field int);
CREATE TABLE tbl (a my_type);
SELECT create_distributed_table('tbl', 'a');
-- the following should error out but it doesn't
-- it drops the distribution column of the table in the coordinator -- OOPS!
-- doesn't propagate anything to shards
DROP TYPE my_type CASCADE;
NOTICE: drop cascades to column a of table tbl
-- OOPS no distribution column
\d+ tbl
Table "public.tbl"
Column | Type | Collation | Nullable | Default
--------+------+-----------+----------+---------
-- shards are still there!!
SELECT run_command_on_workers($$ SELECT json_agg(relname) FROM pg_class WHERE relname LIKE 'tbl%'$$);
run_command_on_workers
----------------------------------------------------------------
(localhost,9701,t,"[""tbl"", ""tbl_102008"", ""tbl_102010""]")
(localhost,9702,t,"[""tbl"", ""tbl_102009"", ""tbl_102011""]")
(2 rows)
SELECT * FROM citus_shards;
ERROR: cache lookup failed for type 17132
DROP TABLE tbl;
ERROR: cache lookup failed for type 17132 EDIT: problem already mentioned in https://github.com/citusdata/citus-enterprise/issues/687 |
When dropping objects, citus_drop_trigger should not depend on the validity of the caches for placements as it causes may cause error messages from time to time. With this commit we remove the depencency on the validity on caches for shard placements. Fixes: #5780
Reproducible on 10.2 (and maybe in older versions too):
The text was updated successfully, but these errors were encountered: