cassandra-commits mailing list archives

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


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.


> Inserting static column fails with secondary index on clustering key
> --------------------------------------------------------------------
>                 Key: CASSANDRA-11021
>                 URL:
>             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 - Failed to
apply mutation locally : {}
> java.lang.ArrayIndexOutOfBoundsException: 0
>         at org.apache.cassandra.db.AbstractClusteringPrefix.get(
>         at org.apache.cassandra.index.internal.composites.ClusteringColumnIndex.getIndexedValue(
>         at org.apache.cassandra.index.internal.CassandraIndex.getIndexedValue(
>         at org.apache.cassandra.index.internal.CassandraIndex.insert(
>         at org.apache.cassandra.index.internal.CassandraIndex.access$100(
>         at org.apache.cassandra.index.internal.CassandraIndex$1.indexPrimaryKey(
>         at org.apache.cassandra.index.internal.CassandraIndex$1.insertRow(
>         at org.apache.cassandra.index.SecondaryIndexManager$WriteTimeTransaction.onInserted(
>         at org.apache.cassandra.db.partitions.AtomicBTreePartition$RowUpdater.apply(
>         at org.apache.cassandra.db.partitions.AtomicBTreePartition.addAllWithSizeDelta(
>         at org.apache.cassandra.db.Memtable.put( ~[main/:na]
>         at org.apache.cassandra.db.ColumnFamilyStore.apply(
>         at org.apache.cassandra.db.Keyspace.apply( ~[main/:na]
>         at org.apache.cassandra.db.Keyspace.apply( ~[main/:na]
>         at org.apache.cassandra.db.Mutation.apply( ~[main/:na]
>         at org.apache.cassandra.service.StorageProxy$$Lambda$166/
Source) ~[na:na]
>         at org.apache.cassandra.service.StorageProxy$8.runMayThrow(
>         at org.apache.cassandra.service.StorageProxy$
> {code}

This message was sent by Atlassian JIRA

View raw message