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

2018-08-07 Thread Chakravarthi Manepalli (JIRA)


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

Chakravarthi Manepalli commented on CASSANDRA-11429:


I am creating the tables concurrently, and i faced the similar issue but in the 
reverse manner. I have got the entry in system_schema keyspace about the index, 
but the index is not getting created.
Then, I stopped the node and cleared data folder and started cassandra again 
and loaded the schema loader and I faced the same issue again. !column family 
mismatch.png! 

> 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
>Priority: Major
> Attachments: column family mismatch.png
>
>
> 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:  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 

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

2016-03-24 Thread Joel Knighton (JIRA)

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

Joel Knighton commented on CASSANDRA-11429:
---

I'm afraid I'm at the end of my debugging ability here - usually, the cause of 
issues like this is that the UUID {{cf_id}} is not deterministic, so if the 
same table is created concurrently, it receives two different UUIDs, and the 
schema migration process cannot reconcile this. In this scenario, the two 
different values for {{cf_id}} (found and expected) would be those of the 
"same" table created concurrently.

It sounds like you're doing these schema changes correctly (to the extent of my 
familiarity with the topic). [~iamaleksey] is your best bet to have another 
idea what might be happening here.

> 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:  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 

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

2016-03-24 Thread Sotirios Delimanolis (JIRA)

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

Sotirios Delimanolis commented on CASSANDRA-11429:
--

Right. We make all our changes sequentially from a single source, relying on 
the driver to wait for schema change agreement before proceeding to the next 
change. Nothing is done concurrently, at least not how I'm understanding it.

Unfortunately, I got rid of all the evidence. But I assume 
{{b8b40ed0-f194-11e5-b481-d944f7ad0ce3}} was the {{cf_id}} of the old table 
("uploads"). If it's not, I'm even more confused. Why is Cassandra mentioning 
it at all in relation to the {{cf_id}} of the new table? Is that what's going 
on?

> 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:  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

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

2016-03-24 Thread Joel Knighton (JIRA)

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

Joel Knighton commented on CASSANDRA-11429:
---

Hmm - just to be clear, even concurrent modifications on a single node could be 
a problem here.

I don't believe that's what's happening - the new table has {{cf_id}} 
{{c712a590-f194-11e5-891d-2d7ca98597ba}}, but what table has {{cf_id}} 
{{b8b40ed0-f194-11e5-b481-d944f7ad0ce3}}?

> 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:  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:  message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: 
> java.lang.RuntimeException: 
> org.apache.cassandra.exceptions.ConfigurationException: 

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

2016-03-24 Thread Sotirios Delimanolis (JIRA)

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

Sotirios Delimanolis commented on CASSANDRA-11429:
--

It's not. The deployment process starts and blocks on a single host in the 
cluster. So all those CREATE IF NOT EXISTS/DROP/ALTER are only run on one node, 
sequentially. I haven't seen anything that suggests that this process isn't 
working as intended.

Why is Cassandra associating the old table with the found new table {{cf_id}}, 
{{c712a590-f194-11e5-891d-2d7ca98597ba}}? Please clarify "Cassandra isn't 
confusing the two.".

Only restarting the nodes didn't help. I had to actually clear those cache 
files.

> 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:  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}
> 

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

2016-03-24 Thread Joel Knighton (JIRA)

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

Joel Knighton commented on CASSANDRA-11429:
---

Is it possible that you were issuing multiple {{CREATE TABLE}} statements 
concurrently? It looks like that is almost certainly the issue, and you are 
seeing the symptoms of a schema mismatch.

Going down the list:
- There is no problem resulting from the similar names. Cassandra isn't 
confusing the two.
- It looks like the same table was created concurrently, and the issue caused 
is a consequence of [CASSANDRA-5202]. See [CASSANDRA-9933], [CASSANDRA-11143]. 
The ticket for fixing this is [CASSANDRA-10699].
- The restarting of all nodes is likely what resolved the issue.

> 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:  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 

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

2016-03-24 Thread Sotirios Delimanolis (JIRA)

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

Sotirios Delimanolis commented on CASSANDRA-11429:
--

I should mention that the following logs appeared at startup 

{noformat}
INFO  [pool-2-thread-1] 2016-03-24 19:18:04,806 AutoSavingCache.java:240 - 
Harmless error reading saved cache 
/home/var/cassandra/saved_caches/KeyCache-ba.db
java.lang.RuntimeException: Cache schema version 
22506978-06de-3af5-811c-509b6cef245f does not match current schema version 
c9f76283-941e-3485-819a-816bbbde3d4f
at 
org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:188) 
~[apache-cassandra-2.1.13.jar:2.1.13-SNAPSHOT]
at 
org.apache.cassandra.cache.AutoSavingCache$3.call(AutoSavingCache.java:148) 
[apache-cassandra-2.1.13.jar:2.1.13-SNAPSHOT]
at 
org.apache.cassandra.cache.AutoSavingCache$3.call(AutoSavingCache.java:144) 
[apache-cassandra-2.1.13.jar:2.1.13-SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
[na:1.8.0_72]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[na:1.8.0_72]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[na:1.8.0_72]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
INFO  [pool-3-thread-1] 2016-03-24 19:18:04,806 AutoSavingCache.java:240 - 
Harmless error reading saved cache 
/home/var/cassandra/saved_caches/RowCache-ba.db
java.lang.RuntimeException: Cache schema version 
22506978-06de-3af5-811c-509b6cef245f does not match current schema version 
c9f76283-941e-3485-819a-816bbbde3d4f
at 
org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:188) 
~[apache-cassandra-2.1.13.jar:2.1.13-SNAPSHOT]
at 
org.apache.cassandra.cache.AutoSavingCache$3.call(AutoSavingCache.java:148) 
[apache-cassandra-2.1.13.jar:2.1.13-SNAPSHOT]
at 
org.apache.cassandra.cache.AutoSavingCache$3.call(AutoSavingCache.java:144) 
[apache-cassandra-2.1.13.jar:2.1.13-SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
[na:1.8.0_72]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[na:1.8.0_72]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[na:1.8.0_72]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
{noformat}

After clearing that {{saved_caches}} folder across the cluster and restarting 
all nodes, the error went away. How did we get into this situation?

 

> 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 |