Francisco Guerrero created CASSANDRA-18697:
----------------------------------------------

             Summary: Skip ColumnFamilyStore#topPartitions initialization when 
client or tool mode
                 Key: CASSANDRA-18697
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18697
             Project: Cassandra
          Issue Type: Bug
            Reporter: Francisco Guerrero
            Assignee: Francisco Guerrero


In {{org.apache.cassandra.db.ColumnFamilyStore}} the {{topPartitions}} is 
initialized when the keyspace is not a system keyspace. However, when running 
the cassandra library as client mode or tool mode, the initialization also 
happens. However, {{TopPartitionTracker}} performs queries to the {{system}} 
keyspace, which might not be available in most of the cases. For that reason, 
we should skip initialization of {{topPartitions}} when running on client mode 
or tool mode.

In utilities and external libraries, this can produce a warning that is 
displayed with a stack trace. This warning can be misleading for end users, and 
can cause confusion. But more importantly, the initialization of 
{{topPartitions}} is not required in this mode.

The warning is similar to this:
{code:java}
    WARN org.apache.cassandra.db.SystemKeyspace: Could not load stored top 
SIZES partitions for ...
    org.apache.cassandra.db.KeyspaceNotDefinedException: keyspace system does 
not exist
            at 
org.apache.cassandra.schema.Schema.validateTable(Schema.java:xxx) ~[?:?]
            at 
org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:xxx)
 ~[?:?]
            at 
org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:xxx)
 ~[?:?]
            at 
org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:xxx)
 ~[?:?]
            at 
org.apache.cassandra.cql3.QueryProcessor.parseAndPrepare(QueryProcessor.java:xxx)
 ~[?:?]
            ... {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to