cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-7684) flush makes rows invisible to cluster key equality query
Date Tue, 05 Aug 2014 12:01:16 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-7684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sylvain Lebresne updated CASSANDRA-7684:
----------------------------------------

    Attachment: 7684.txt

That was due to a small mess up in the code deserializing cells from sstable in the static
case. More precisely, {{AbstractCompoundCellNameType.CompositeDeserializer}} was checking
the static marker at the beginning of each components, which on top of being useless was too
late since the {{nextIsStatic}} value was set after it was first used by {{compareNextTo}}.
Attaching rather trivial patch to fix (the patch adds the example above as a unit test too).

> flush makes rows invisible to cluster key equality query
> --------------------------------------------------------
>
>                 Key: CASSANDRA-7684
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7684
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: 2.1.0.rc5
>            Reporter: Jonathan Halliday
>            Assignee: Sylvain Lebresne
>         Attachments: 7684.txt
>
>
> {noformat}
> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor':
1 };
> USE test;
> CREATE TYPE point_t (x double, y double);
> CREATE TABLE points (partitionkey int, b boolean static, clusteringkey point_t, PRIMARY
KEY (partitionkey, clusteringkey) );
> INSERT INTO points (partitionkey, clusteringkey) VALUES (1, {x:-104.9925100000,y:39.7476520000});
> select * from points WHERE partitionkey=1 AND clusteringkey = {x:-104.9925100000,y:39.7476520000};
>  partitionkey | clusteringkey           | b
> --------------+-------------------------+------
>             1 | {x: -104.99, y: 39.748} | null
> (1 rows)
> cqlsh:test> update points set b = true where partitionkey=1;
> cqlsh:test> select * from points WHERE partitionkey=1 AND clusteringkey = {x:-104.9925100000,y:39.7476520000};
>  partitionkey | clusteringkey           | b
> --------------+-------------------------+------
>             1 | {x: -104.99, y: 39.748} | True
> (1 rows)
> {noformat}
> // run bin/nodetool flush here
> {noformat}
> cqlsh:test> select * from points WHERE partitionkey=1 AND clusteringkey = {x:-104.9925100000,y:39.7476520000};
> (0 rows)
> cqlsh:test> select * from points WHERE partitionkey=1;
>  partitionkey | clusteringkey           | b
> --------------+-------------------------+------
>             1 | {x: -104.99, y: 39.748} | True
> (1 rows)
> {noformat}
> i.e. the data is not lost, it's just invisible when read from sstable, but visible when
read from memtable.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message