Erik Swanson created CASSANDRA-14751:
----------------------------------------

             Summary: Can't truncate counter CFs via Thrift
                 Key: CASSANDRA-14751
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14751
             Project: Cassandra
          Issue Type: Bug
         Environment: Cassandra 3.11.2
            Reporter: Erik Swanson


When connecting to Cassandra 3.11.2 using Thrift, attempting to truncate a CF 
with counters results in "invalid operation for commutative table [table name]".

It appears that there was no checking re this prior to the materialized views 
work. The materialized views work added:

{{CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, cfname, 
true);}}

This was changed to `..., false);`  in 
3be99eeaa3546fecaf474d848eecca6aa0254a22, "ninja fix commutative op flag for 
truncate validation", but that fix (allowing truncation of CFs that do not 
include counters) breaks truncation of CFs that do contain counters.

It's possible to truncate counter CFs via CQL, but that's no help re trying to 
get an application that uses Thrift to work, which needs to be able to truncate 
as part of its test suite.

Because truncation via CQL works, or at least appears to work, would the 
appropriate fix be to change CassandraServer.truncate to use this function on 
ThriftValidation instead?:

{{// To be used when the operation should be authorized whether this is a 
counter CF or not}}
{{public static CFMetaData validateColumnFamily(String keyspaceName, String 
cfName) throws org.apache.cassandra.exceptions.InvalidRequestException}}
{{{}}
{{ return validateColumnFamilyWithCompactMode(keyspaceName, cfName, false);}}
{{}}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to