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

Cache lookup failure after dropping type used in partition column #6392

Open
naisila opened this issue Oct 3, 2022 · 0 comments · May be fixed by #6393
Open

Cache lookup failure after dropping type used in partition column #6392

naisila opened this issue Oct 3, 2022 · 0 comments · May be fixed by #6393

Comments

@naisila
Copy link
Member

naisila commented Oct 3, 2022

What we fail to access is the distribution column and its type, because it is dropped from previous DROP TYPE comp_type CASCADE. The issue can be reproduced as follows:

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

Originally posted by @naisila in #5780 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant