cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Tunnicliffe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11021) Inserting static column fails with secondary index on clustering key
Date Mon, 18 Jan 2016 18:26:39 GMT

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

Sam Tunnicliffe commented on CASSANDRA-11021:
---------------------------------------------

Thanks for the patch, I've made a couple of small tweaks & pushed it to my repo so that
CI will run against it. The changes I made were:
* Changed the logic slightly in the {{insertRow}} method in {{CassandraIndexer}} to bail early
whenever the row is static, but the indexed column is not. Your fix would works fine for this
particular issue, but this saves some unneccesary processing when a static value is updated.
* Also added something similar in {{updateRow}}, although this doesn't trigger the same error,
some additional work is performed that we can skip.
* Relocated the unit test to {{org.apache.cassandra.cql3.validation.entites.SecondaryIndexTest}}
(the fixture it was originally in relates to the internal index of SSTable files, rather than
to secondary indexes).

Once CI has verified everything, I'll commit.

||branch||testall||dtest||
|[11021-3.0|https://github.com/beobal/cassandra/tree/11021-3.0]|[testall|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11021-3.0-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11021-3.0-dtest]|
|[11021-3.3|https://github.com/beobal/cassandra/tree/11021-3.3]|[testall|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11021-3.3-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11021-3.3-dtest]|
|[11021-trunk|https://github.com/beobal/cassandra/tree/11021-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11021-trunk-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-11021-trunk-dtest]|


> Inserting static column fails with secondary index on clustering key
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-11021
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11021
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local Write-Read Paths
>            Reporter: Stefan Podkowinski
>            Assignee: Stefan Podkowinski
>
> Creating a secondary index on a clustering key fails with an exception in case a static
column is involved.
> {code}
> CREATE TABLE test (k int, t int, s text static, v text, PRIMARY KEY (k, t));
> CREATE INDEX ix ON test (t);
> INSERT INTO test(k, t, s, v) VALUES (0, 1, 'abc', 'def');
> {code}
> {code}
> ERROR [SharedPool-Worker-2] 2016-01-15 11:42:27,484 StorageProxy.java:1336 - Failed to
apply mutation locally : {}
> java.lang.ArrayIndexOutOfBoundsException: 0
>         at org.apache.cassandra.db.AbstractClusteringPrefix.get(AbstractClusteringPrefix.java:59)
~[main/:na]
>         at org.apache.cassandra.index.internal.composites.ClusteringColumnIndex.getIndexedValue(ClusteringColumnIndex.java:58)
~[main/:na]
>         at org.apache.cassandra.index.internal.CassandraIndex.getIndexedValue(CassandraIndex.java:598)
~[main/:na]
>         at org.apache.cassandra.index.internal.CassandraIndex.insert(CassandraIndex.java:490)
~[main/:na]
>         at org.apache.cassandra.index.internal.CassandraIndex.access$100(CassandraIndex.java:53)
~[main/:na]
>         at org.apache.cassandra.index.internal.CassandraIndex$1.indexPrimaryKey(CassandraIndex.java:437)
~[main/:na]
>         at org.apache.cassandra.index.internal.CassandraIndex$1.insertRow(CassandraIndex.java:347)
~[main/:na]
>         at org.apache.cassandra.index.SecondaryIndexManager$WriteTimeTransaction.onInserted(SecondaryIndexManager.java:795)
~[main/:na]
>         at org.apache.cassandra.db.partitions.AtomicBTreePartition$RowUpdater.apply(AtomicBTreePartition.java:275)
~[main/:na]
>         at org.apache.cassandra.db.partitions.AtomicBTreePartition.addAllWithSizeDelta(AtomicBTreePartition.java:154)
~[main/:na]
>         at org.apache.cassandra.db.Memtable.put(Memtable.java:240) ~[main/:na]
>         at org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:1145)
~[main/:na]
>         at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:494) ~[main/:na]
>         at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:384) ~[main/:na]
>         at org.apache.cassandra.db.Mutation.apply(Mutation.java:205) ~[main/:na]
>         at org.apache.cassandra.service.StorageProxy$$Lambda$166/492512700.run(Unknown
Source) ~[na:na]
>         at org.apache.cassandra.service.StorageProxy$8.runMayThrow(StorageProxy.java:1330)
~[main/:na]
>         at org.apache.cassandra.service.StorageProxy$LocalMutationRunnable.run(StorageProxy.java:2480)
[main/:n
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message