Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-7684

flush makes rows invisible to cluster key equality query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.1.0
    • None
    • None
    • 2.1.0.rc5

    • Normal

    Description

      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)
      

      // run bin/nodetool flush here

      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)
      

      i.e. the data is not lost, it's just invisible when read from sstable, but visible when read from memtable.

      Attachments

        1. 7684.txt
          5 kB
          Sylvain Lebresne

        Activity

          People

            slebresne Sylvain Lebresne
            jhalliday Jonathan Halliday
            Sylvain Lebresne
            Aleksey Yeschenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: