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

RangeName queries might not return all the results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.0.6, 3.6
    • Legacy/CQL
    • None
    • Normal

    Description

      It seems that if a page end in the middle of a partition the remaining rows of the partition will never be returned.

      The problem can be reproduced using the java driver with the following code:

              session = cluster.connect();
              session.execute("CREATE KEYSPACE IF NOT EXISTS test WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : '1'}");
              session.execute("USE test");
              session.execute("DROP TABLE IF EXISTS test");
              session.execute("CREATE TABLE IF NOT EXISTS test (a int, b int, c int, d int, PRIMARY KEY(a, b, c))");
      
              PreparedStatement prepare = session.prepare("INSERT INTO test (a, b, c, d) VALUES (?, ?, ?, ?);");
              for (int i = 1; i < 4; i++)
                  for (int j = 1; j < 5; j++)
                      for (int k = 1; k < 5; k++)
                      session.execute(prepare.bind(i, j, k, i + j));
      
              ResultSet rs = session.execute(session.newSimpleStatement("SELECT * FROM test WHERE b = 1 and c IN (1, 2, 3) ALLOW FILTERING")
                                                    .setFetchSize(4));
              for (Row row : rs)
              {
                  System.out.println(row); // Only one row will be returned for partition 2 instead of 3
              }
      

      Attachments

        Issue Links

          Activity

            People

              blerer Benjamin Lerer
              blerer Benjamin Lerer
              Benjamin Lerer
              Sylvain Lebresne
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: