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 21:03:25 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=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 | 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)