You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sotirios Delimanolis (JIRA)" <ji...@apache.org> on 2016/03/24 19:23:25 UTC

[jira] [Updated] (CASSANDRA-11429) DROP TABLE IF EXISTS fails against table with similar name

     [ https://issues.apache.org/jira/browse/CASSANDRA-11429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sotirios Delimanolis updated CASSANDRA-11429:
---------------------------------------------
    Description: 
We had a table named {{our_keyspace.native_address_book_uploads_cache}} (note the uploads*) which we dropped. We then created a new table named {{our_keyspace.native_address_book_upload_cache}} (note the upload*).

We have a patching component that applies commands to prepare the schema using the C# driver. When we deploy, it tries to execute

{noformat}
DROP TABLE IF NOT EXISTS our_keyspace.native_address_book_uploads_cache;
{noformat}

This fails with

{noformat}
Caught an exception Cassandra.ServerErrorException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)
{noformat}

showing the Cassandra Java exception through the C# driver. Note the {{found}} cf_id of {{c712a590-f194-11e5-891d-2d7ca98597ba}}.

I can reproduce this with {{cqlsh}}.

{noformat}
selimanolis$ cqlsh
Connected to Default Cluster at hostname:9042.
[cqlsh 5.0.1 | Cassandra 2.1.13-SNAPSHOT | CQL spec 3.2.1 | Native protocol v3]
Use HELP for help.
cqlsh> SELECT cf_id from system.schema_columnfamilies  where keyspace_name = 'our_keyspace' and columnfamily_name ='native_address_book_uploads_cache';

 keyspace_name | columnfamily_name | bloom_filter_fp_chance | caching | cf_id | column_aliases | comment | compaction_strategy_class | compaction_strategy_options | comparator | compression_parameters | default_time_to_live | default_validator | dropped_columns | gc_grace_seconds | index_interval | is_dense | key_aliases | key_validator | local_read_repair_chance | max_compaction_threshold | max_index_interval | memtable_flush_period_in_ms | min_compaction_threshold | min_index_interval | read_repair_chance | speculative_retry | subcomparator | type | value_alias
---------------+-------------------+------------------------+---------+-------+----------------+---------+---------------------------+-----------------------------+------------+------------------------+----------------------+-------------------+-----------------+------------------+----------------+----------+-------------+---------------+--------------------------+--------------------------+--------------------+-----------------------------+--------------------------+--------------------+--------------------+-------------------+---------------+------+-------------

(0 rows)
cqlsh> SELECT cf_id from system.schema_columnfamilies  where keyspace_name = 'our_keyspace' and columnfamily_name ='native_address_book_upload_cache';

 cf_id
--------------------------------------
 c712a590-f194-11e5-891d-2d7ca98597ba

(1 rows)
cqlsh> drop TABLE IF EXISTS our_keyspace.native_address_book_uploads_cache;
InvalidRequest: code=2200 [Invalid query] message="No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename"
cqlsh> drop TABLE IF EXISTS our_keyspace.native_address_book_uploads_cache;
ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)">
cqlsh> 
{noformat}

The table doesn't exist. A table that has a similar name does. You'll notice that the new table has same {{cf_id}} found in the error message above. Why does Cassandra confuse the two?

Our expectation is for the {{DROP TABLE IF EXISTS}} to silently succeed.

Similarly, we expect a {{DROP TABLE}} to fail because the table doesn't exist. That's not what happens if you see below

{noformat}
cqlsh> DROP TABLE our_keyspace.native_address_book_uploads_cache;
ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)">
cqlsh> DROP TABLE our_keyspace.native_address_book_uploads_cacheadsfasdf;
InvalidRequest: code=2200 [Invalid query] message="unconfigured columnfamily native_address_book_uploads_cacheadsfasdf"
{noformat}

----

I cannot reproduce the problem with entirely new tables.

  was:
We had a table named {{our_keyspace.native_address_book_uploads_cache}} (note the uploads*) which we dropped. We then created a new table named {{our_keyspace.native_address_book_upload_cache}} (note the upload*).

We have a patching component that applies commands to prepare the schema using the C# driver. When we deploy, it tries to execute

{noformat}
DROP TABLE IF NOT EXISTS our_keyspace.native_address_book_uploads_cache;
{noformat}

This fails with

{noformat}
Caught an exception Cassandra.ServerErrorException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)
{noformat}

showing the Cassandra Java exception through the C# driver. Note the {{found}} cf_id of {{c712a590-f194-11e5-891d-2d7ca98597ba}}.

I can reproduce this with {{cqlsh}}.

{noformat}
selimanolis$ cqlsh
Connected to Default Cluster at hostname:9042.
[cqlsh 5.0.1 | Cassandra 2.1.13-SNAPSHOT | CQL spec 3.2.1 | Native protocol v3]
Use HELP for help.
cqlsh> SELECT cf_id from system.schema_columnfamilies  where keyspace_name = 'our_keyspace' and columnfamily_name ='native_address_book_uploads_cache';

 keyspace_name | columnfamily_name | bloom_filter_fp_chance | caching | cf_id | column_aliases | comment | compaction_strategy_class | compaction_strategy_options | comparator | compression_parameters | default_time_to_live | default_validator | dropped_columns | gc_grace_seconds | index_interval | is_dense | key_aliases | key_validator | local_read_repair_chance | max_compaction_threshold | max_index_interval | memtable_flush_period_in_ms | min_compaction_threshold | min_index_interval | read_repair_chance | speculative_retry | subcomparator | type | value_alias
---------------+-------------------+------------------------+---------+-------+----------------+---------+---------------------------+-----------------------------+------------+------------------------+----------------------+-------------------+-----------------+------------------+----------------+----------+-------------+---------------+--------------------------+--------------------------+--------------------+-----------------------------+--------------------------+--------------------+--------------------+-------------------+---------------+------+-------------

(0 rows)
cqlsh> SELECT cf_id from system.schema_columnfamilies  where keyspace_name = 'our_keyspace' and columnfamily_name ='native_address_book_upload_cache';

 cf_id
--------------------------------------
 c712a590-f194-11e5-891d-2d7ca98597ba

(1 rows)
cqlsh> drop TABLE IF EXISTS our_keyspace.native_address_book_uploads_cache;
InvalidRequest: code=2200 [Invalid query] message="No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename"
cqlsh> drop TABLE IF EXISTS our_keyspace.native_address_book_uploads_cache;
ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)">
cqlsh> 
{noformat}

The table doesn't exist. A table that has a similar name does. You'll notice that the new table has same {{cf_id}} found in the error message above. Why does Cassandra confuse the two?

Our expectation is for the {{DROP TABLE IF EXISTS}} to silently succeed.

Similarly, we expect a {{DROP TABLE}} to fail because the table doesn't exist. That's not what happens if you see below

{noformat}
cqlsh> DROP TABLE our_keyspace.native_address_book_uploads_cache;
ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)">
cqlsh> DROP TABLE our_keyspace.native_address_book_uploads_cacheadsfasdf;
InvalidRequest: code=2200 [Invalid query] message="unconfigured columnfamily native_address_book_uploads_cacheadsfasdf"
{noformat}


> DROP TABLE IF EXISTS fails against table with similar name
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-11429
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11429
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Sotirios Delimanolis
>
> We had a table named {{our_keyspace.native_address_book_uploads_cache}} (note the uploads*) which we dropped. We then created a new table named {{our_keyspace.native_address_book_upload_cache}} (note the upload*).
> We have a patching component that applies commands to prepare the schema using the C# driver. When we deploy, it tries to execute
> {noformat}
> DROP TABLE IF NOT EXISTS our_keyspace.native_address_book_uploads_cache;
> {noformat}
> This fails with
> {noformat}
> Caught an exception Cassandra.ServerErrorException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)
> {noformat}
> showing the Cassandra Java exception through the C# driver. Note the {{found}} cf_id of {{c712a590-f194-11e5-891d-2d7ca98597ba}}.
> I can reproduce this with {{cqlsh}}.
> {noformat}
> selimanolis$ cqlsh
> Connected to Default Cluster at hostname:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.13-SNAPSHOT | CQL spec 3.2.1 | Native protocol v3]
> Use HELP for help.
> cqlsh> SELECT cf_id from system.schema_columnfamilies  where keyspace_name = 'our_keyspace' and columnfamily_name ='native_address_book_uploads_cache';
>  keyspace_name | columnfamily_name | bloom_filter_fp_chance | caching | cf_id | column_aliases | comment | compaction_strategy_class | compaction_strategy_options | comparator | compression_parameters | default_time_to_live | default_validator | dropped_columns | gc_grace_seconds | index_interval | is_dense | key_aliases | key_validator | local_read_repair_chance | max_compaction_threshold | max_index_interval | memtable_flush_period_in_ms | min_compaction_threshold | min_index_interval | read_repair_chance | speculative_retry | subcomparator | type | value_alias
> ---------------+-------------------+------------------------+---------+-------+----------------+---------+---------------------------+-----------------------------+------------+------------------------+----------------------+-------------------+-----------------+------------------+----------------+----------+-------------+---------------+--------------------------+--------------------------+--------------------+-----------------------------+--------------------------+--------------------+--------------------+-------------------+---------------+------+-------------
> (0 rows)
> cqlsh> SELECT cf_id from system.schema_columnfamilies  where keyspace_name = 'our_keyspace' and columnfamily_name ='native_address_book_upload_cache';
>  cf_id
> --------------------------------------
>  c712a590-f194-11e5-891d-2d7ca98597ba
> (1 rows)
> cqlsh> drop TABLE IF EXISTS our_keyspace.native_address_book_uploads_cache;
> InvalidRequest: code=2200 [Invalid query] message="No keyspace has been specified. USE a keyspace, or explicitly specify keyspace.tablename"
> cqlsh> drop TABLE IF EXISTS our_keyspace.native_address_book_uploads_cache;
> ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)">
> cqlsh> 
> {noformat}
> The table doesn't exist. A table that has a similar name does. You'll notice that the new table has same {{cf_id}} found in the error message above. Why does Cassandra confuse the two?
> Our expectation is for the {{DROP TABLE IF EXISTS}} to silently succeed.
> Similarly, we expect a {{DROP TABLE}} to fail because the table doesn't exist. That's not what happens if you see below
> {noformat}
> cqlsh> DROP TABLE our_keyspace.native_address_book_uploads_cache;
> ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Column family ID mismatch (found c712a590-f194-11e5-891d-2d7ca98597ba; expected b8b40ed0-f194-11e5-b481-d944f7ad0ce3)">
> cqlsh> DROP TABLE our_keyspace.native_address_book_uploads_cacheadsfasdf;
> InvalidRequest: code=2200 [Invalid query] message="unconfigured columnfamily native_address_book_uploads_cacheadsfasdf"
> {noformat}
> ----
> I cannot reproduce the problem with entirely new tables.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)