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

Incorrect view updates

    XMLWordPrintableJSON

Details

    • Normal

    Description

      Consider the following:

      create table t (p int, c int, v1 int, v2 int, primary key(p, c));
      create materialized view mv as select p, c, v1 from t 
      where p is not null and c is not null primary key (c, p);
      
      insert into t (p, c, v1, v2) VALUES(1, 1, 1, 1) using ttl 5;
      update t using ttl 1000 set v2 = 1 where p = 1 and c = 1;
      delete v2 from t where p = 1 and c = 1;
      
      // Wait 5 seconds
      select * from mv;
      
      c | p | v1
      ---+---+------
      1 | 1 | null

      The view row should be dead after 5 seconds, but it is not.

      This is because the liveness info calculated when deleting v2 is based on the base table update liveness info, which has the timestamp of the first insert statement. That liveness info is shadowed by the liveness info created in the update, which has a higher timestamp.

      Attachments

        Activity

          People

            Unassigned Unassigned
            duarten Duarte Nunes
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: