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

Inconsistent static column behavior after row deletion

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Not A Problem
    • 2.1.1
    • None
    • None
    • Normal

    Description

      I've a table with static column defined. I'm inserting some rows with TTL defined, then one of row expires TTL of all the rows with same PK turns into null:

      cqlsh:test> create table tt ( c1 text , c2 text , c3 text, cs text static, PRIMARY KEY (c1, c2) );
      cqlsh:test> insert into tt (c1, c2, c3, cs) VALUES ( '1', '1-1', 'x', 's1') USING TTL 10;
      cqlsh:test> insert into tt (c1, c2, c3, cs) VALUES ( '1', '1-2', 'x', 's2') USING TTL 5;
      cqlsh:test> insert into tt (c1, c2, c3, cs) VALUES ( '1', '1-3', 'x', 's3') USING TTL 20;
      cqlsh:test> insert into tt (c1, c2, c3, cs) VALUES ( '1', '1-4', 'x', 's4') USING TTL 3;
      cqlsh:test> select * from tt;
      
       c1 | c2  | cs | c3
      ----+-----+----+----
        1 | 1-1 | s4 |  x
        1 | 1-2 | s4 |  x
        1 | 1-3 | s4 |  x
        1 | 1-4 | s4 |  x
      
      (4 rows)
      
      cqlsh:test> select * from tt;
      
       c1 | c2  | cs | c3
      ----+-----+----+----
        1 | 1-1 | s4 |  x
        1 | 1-2 | s4 |  x
        1 | 1-3 | s4 |  x
        1 | 1-4 | s4 |  x
      
      (4 rows)
      
      cqlsh:test> select * from tt;
      
       c1 | c2  | cs   | c3
      ----+-----+------+----
        1 | 1-1 | null |  x
        1 | 1-2 | null |  x
        1 | 1-3 | null |  x
      (3 rows)
      
      

      Same scenario with manual DELETion leads to another result:

      cqlsh:test> create table tt1 ( c1 text , c2 text , c3 text, cs text static, PRIMARY KEY (c1, c2) );
      cqlsh:test> insert into tt1 (c1, c2, c3, cs) VALUES ( '1', '1-1', 'x', 's1');
      cqlsh:test> insert into tt1 (c1, c2, c3, cs) VALUES ( '1', '1-2', 'x', 's2');
      cqlsh:test> insert into tt1 (c1, c2, c3, cs) VALUES ( '1', '1-3', 'x', 's3');
      cqlsh:test> insert into tt1 (c1, c2, c3, cs) VALUES ( '1', '1-4', 'x', 's4');
      cqlsh:test> select * from tt1;
      
       c1 | c2  | cs | c3
      ----+-----+----+----
        1 | 1-1 | s4 |  x
        1 | 1-2 | s4 |  x
        1 | 1-3 | s4 |  x
        1 | 1-4 | s4 |  x
      
      (4 rows)
      cqlsh:test> delete from tt1 WHERE c1='1' AND c2 = '1-2';
      cqlsh:test> select * from tt1;
      
       c1 | c2  | cs | c3
      ----+-----+----+----
        1 | 1-1 | s4 |  x
        1 | 1-3 | s4 |  x
        1 | 1-4 | s4 |  x
      
      (3 rows)
      
      cqlsh:test> delete from tt1 WHERE c1='1' AND c2 = '1-4';
      cqlsh:test> select * from tt1;
      
       c1 | c2  | cs | c3
      ----+-----+----+----
        1 | 1-1 | s4 |  x
        1 | 1-3 | s4 |  x
      
      (2 rows)
      

      Is this behavior bug or it's declared somewhere? Is it really good that deletion behavior is inconsistent?

      Attachments

        Activity

          People

            Unassigned Unassigned
            viasyn viasyn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: