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

Stefan Miklosovic commented on CASSANDRA-18105:
-----------------------------------------------

PRs

3.0 [https://github.com/apache/cassandra/pull/2286]
3.11 [https://github.com/apache/cassandra/pull/2289]
4.0 [https://github.com/apache/cassandra/pull/2290]
4.1 [https://github.com/apache/cassandra/pull/2291]
trunk [https://github.com/apache/cassandra/pull/2292]

Tests are more or less same as suggested on the PR for 3.0, however, for 3.11, 
I noticed that there is a bug for materialized view. I left out that MV test.

The error for MV test in 3.11 branch is that it is not possible to drop a 
materialized view (yeah, really). It will be visible if one takes the test in 
3.0 patch and tries it in 3.11 branch. It will end up throwing this:

This is thrown really just for 3.11 branch. 4.0+ branches are not affected. Nor 
3.0 is. Just 3.11.

Since this patch is dealing with indices primarily and it has nothing to do 
with MVs as such, I do not think that spending more time on fixing this bug is 
necessary.

{code}
Caused by: java.util.concurrent.ExecutionException: 
org.apache.cassandra.db.KeyspaceNotDefinedException: Keyspace 
system_distributed does not exist
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at 
org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:438)
        ... 11 more
Caused by: org.apache.cassandra.db.KeyspaceNotDefinedException: Keyspace 
system_distributed does not exist
        at 
org.apache.cassandra.thrift.ThriftValidation.validateKeyspace(ThriftValidation.java:85)
        at 
org.apache.cassandra.thrift.ThriftValidation.validateColumnFamilyWithCompactMode(ThriftValidation.java:114)
        at 
org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:822)
        at 
org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:816)
        at 
org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:680)
        at 
org.apache.cassandra.cql3.QueryProcessor.parseStatement(QueryProcessor.java:279)
        at 
org.apache.cassandra.cql3.QueryProcessor.prepareInternal(QueryProcessor.java:324)
        at 
org.apache.cassandra.cql3.QueryProcessor.executeInternal(QueryProcessor.java:332)
        at 
org.apache.cassandra.repair.SystemDistributedKeyspace.setViewRemoved(SystemDistributedKeyspace.java:307)
        at 
org.apache.cassandra.db.view.ViewManager.removeView(ViewManager.java:175)
        at org.apache.cassandra.db.view.ViewManager.reload(ViewManager.java:119)
        at org.apache.cassandra.config.Schema.dropView(Schema.java:772)
        at 
org.apache.cassandra.schema.SchemaKeyspace.lambda$updateKeyspace$23(SchemaKeyspace.java:1480)
        at java.util.HashMap$Values.forEach(HashMap.java:982)
        at 
java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1082)
        at 
org.apache.cassandra.schema.SchemaKeyspace.updateKeyspace(SchemaKeyspace.java:1480)
        at 
org.apache.cassandra.schema.SchemaKeyspace.mergeSchema(SchemaKeyspace.java:1451)
        at 
org.apache.cassandra.schema.SchemaKeyspace.mergeSchema(SchemaKeyspace.java:1413)
        at 
org.apache.cassandra.schema.SchemaKeyspace.mergeSchemaAndAnnounceVersion(SchemaKeyspace.java:1390)
        at 
org.apache.cassandra.service.MigrationManager$1.runMayThrow(MigrationManager.java:464)
        at 
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
{code}

> TRUNCATED data come back after a restart or upgrade
> ---------------------------------------------------
>
>                 Key: CASSANDRA-18105
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18105
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Feature/2i Index
>            Reporter: Ke Han
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x, 4.0.x, 4.1.x, 5.x
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> When we use the TRUNCATE command to delete all data in the table, the deleted 
> data come back after a node restart or upgrade. This problem happens at the 
> latest releases (2.2.19, 3.0.28, or 4.0.7)
> h1. Steps to reproduce
> h2. To reproduce it at release (3.0.28 or 4.0.7)
> Start up a single Cassandra node. Using the default configuration and execute 
> the following cqlsh commands.
> {code:java}
> CREATE KEYSPACE IF NOT EXISTS ks WITH REPLICATION = { 'class' : 
> 'SimpleStrategy', 'replication_factor' : 1 };
> CREATE TABLE  ks.tb (c3 TEXT,c4 TEXT,c2 INT,c1 TEXT, PRIMARY KEY (c1, c2, c3 
> ));
> INSERT INTO ks.tb (c3, c1, c2) VALUES ('val1','val2',1);
> CREATE INDEX IF NOT EXISTS tb ON ks.tb ( c3);
> TRUNCATE TABLE ks.tb;
> DROP INDEX IF EXISTS ks.tb; {code}
> Execute a read command
> {code:java}
> cqlsh> SELECT c2 FROM ks.tb; 
>  c2
> ----
> (0 rows) {code}
> Then, we flush the node and kill the Cassandra daemon by
> {code:java}
> bin/nodetool flush
> pgrep -f cassandra | xargs kill -9 {code}
> We restart the node. When the node has started, perform the same read, and 
> the deleted data comes back again.
> {code:java}
> cqlsh> SELECT c2 FROM ks.tb; 
>  c2
> ----
>   1
> (1 rows) {code}
> h2. To reproduce it at release (2.2.19)
> We don't need to kill the Cassandra daemon. Use bin/nodetool stopdaemon is 
> enough. The other steps are the same as reproducing it at 4.0.7 or 3.0.28.
> {code:java}
> bin/nodetool -h ::FFFF:127.0.0.1 flush 
> bin/nodetool -h ::FFFF:127.0.0.1 stopdaemon{code}
>  
> I have put the full log to reproduce it for release 4.0.7 and 2.2.19 in the 
> comments.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to