-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unable to drop keyspace or table if there are active secondary indexes #3202
Comments
Previously dropping a table with secondary indexes failed, because SI are internally backed by materialized views. This commit triggers dropping dependent secondary indexes before dropping a table. Fixes scylladb#3202
Previously dropping a table with secondary indexes failed, because SI are internally backed by materialized views. This commit triggers dropping dependent secondary indexes before dropping a table. Fixes scylladb#3202
This commit adds a test case for dropping a table with dependent secondary indexes. Dependent materialized views prohibit the table from being dropped, but dropping a table with dependent SI is legal. References scylladb#3202
This commit adds a test case for dropping a table with dependent secondary indexes. Dependent materialized views prohibit the table from being dropped, but dropping a table with dependent SI is legal. References scylladb#3202
There are two separate issues here, I think they should be split.
If any materialized views are present, first attempt to drop this keyspace will fail with |
This commit makes truncate_views() function acknowledge the case when some materialized view tables were already removed. It may happen when 'DROP KEYSPACE' is called on a keyspace with any materialized views present and also if 'DROP TABLE' with any secondary indexes is called. References scylladb#3202
Previously dropping a table with secondary indexes failed, because SI are internally backed by materialized views. This commit triggers dropping dependent secondary indexes before dropping a table. Fixes scylladb#3202
This commit adds a test case for dropping a table with dependent secondary indexes. Dependent materialized views prohibit the table from being dropped, but dropping a table with dependent SI is legal. References scylladb#3202
This commit adds a test case for dropping a table with dependent secondary indexes. Dependent materialized views prohibit the table from being dropped, but dropping a table with dependent SI is legal. References scylladb#3202
This commit clears table's views before truncating it in drop_column_family function. The only case when views are not empty during drop is when they're backing secondary indexes of a base table and they are all atomically dropped in the same go as the base table itself. This change will prevent trying to truncate views that were already dropped, which used to result in no_such_column_family error. References scylladb#3202
This commit adds a test case for dropping a table with dependent secondary indexes. Dependent materialized views prohibit the table from being dropped, but dropping a table with dependent SI is legal. References scylladb#3202
" This series addresses issue #3202 about dropping a table with secondary indexes present. Previously dropping such tables was impossible due to materialized view restrictions (which is an implementation detail of Scylla's secondary indexes). Implemented: * fixing 'DROP KEYSPACE' with active materialized views * adapting schema_builder to make it easy to drop indexes * dropping all dependent SI before dropping a table * a test case for dropping a table with secondary indexes " * 'drop_si_before_drop_table_3' of https://github.com/psarna/scylla: tests: add test for dropping a table with secondary indexes migration_manager: allow dropping table with secondary indexes schema: add clearing indexes to schema builder database: do not truncate already removed views
This commit clears table's views before truncating it in drop_column_family function. The only case when views are not empty during drop is when they're backing secondary indexes of a base table and they are all atomically dropped in the same go as the base table itself. This change will prevent trying to truncate views that were already dropped, which used to result in no_such_column_family error. References scylladb#3202 (cherry picked from commit f8237dd)
Previously dropping a table with secondary indexes failed, because SI are internally backed by materialized views. This commit triggers dropping dependent secondary indexes before dropping a table. Fixes scylladb#3202 (cherry picked from commit 7e4813a)
This commit adds a test case for dropping a table with dependent secondary indexes. Dependent materialized views prohibit the table from being dropped, but dropping a table with dependent SI is legal. References scylladb#3202 (cherry picked from commit 76848fb)
Installation details
Scylla version (or git commit hash): 2.1-rc3
Apache Cassandra lets users run
DROP KEYSPACE
andDROP TABLE
even if there are secondary indexes but Scylla trips over materialized views validation (that SI uses under the hood) and refuses that.The text was updated successfully, but these errors were encountered: