Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Duplicate
-
None
-
None
-
Normal
Description
Consider the following commands, ran against trunk:
echo "DROP MATERIALIZED VIEW ks.mv; DROP TABLE ks.base;" | bin/cqlsh echo "CREATE TABLE ks.base (p int, c int, v int, PRIMARY KEY (p, c));" | bin/cqlsh echo "CREATE MATERIALIZED VIEW ks.mv AS SELECT p, c FROM base WHERE p IS NOT NULL AND c IS NOT NULL PRIMARY KEY (c, p);" | bin/cqlsh echo "INSERT INTO ks.base (p, c) VALUES (0, 0) USING TTL 10;" | bin/cqlsh # wait for row liveness to get closer to expiration sleep 6; echo "UPDATE ks.base USING TTL 8 SET v = 0 WHERE p = 0 and c = 0;" | bin/cqlsh echo "SELECT p, c, ttl(v) FROM ks.base; SELECT * FROM ks.mv;" | bin/cqlsh p | c | ttl(v) ---+---+-------- 0 | 0 | 7 (1 rows) c | p ---+--- 0 | 0 (1 rows) # wait for row liveness to expire sleep 4; echo "SELECT p, c, ttl(v) FROM ks.base; SELECT * FROM ks.mv;" | bin/cqlsh p | c | ttl(v) ---+---+-------- 0 | 0 | 3 (1 rows) c | p ---+--- (0 rows)
Notice how the view row is removed even though the base row is still live. I would say this is because in ViewUpdateGenerator#computeLivenessInfoForEntry the TTLs are compared instead of the expiration times, but I'm not sure I'm getting that far ahead in the code when updating a column that's not in the view.
Attachments
Issue Links
- is duplicated by
-
CASSANDRA-11500 Obsolete MV entry may not be properly deleted
- Resolved
- is related to
-
CASSANDRA-6782 setting TTL on some columns seems to expire whole row
- Resolved
-
CASSANDRA-11475 MV code refactor
- Resolved
- relates to
-
CASSANDRA-13547 Filtered materialized views missing data
- Resolved
-
CASSANDRA-11500 Obsolete MV entry may not be properly deleted
- Resolved
-
CASSANDRA-13409 Materialized Views: View cells are resurrected
- Resolved